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 {
164 * Must be last for serialization purposes
169 typedef enum LDKSecp256k1Error {
170 LDKSecp256k1Error_IncorrectSignature,
171 LDKSecp256k1Error_InvalidMessage,
172 LDKSecp256k1Error_InvalidPublicKey,
173 LDKSecp256k1Error_InvalidSignature,
174 LDKSecp256k1Error_InvalidSecretKey,
175 LDKSecp256k1Error_InvalidRecoveryId,
176 LDKSecp256k1Error_InvalidTweak,
177 LDKSecp256k1Error_NotEnoughMemory,
178 LDKSecp256k1Error_CallbackPanicked,
180 * Must be last for serialization purposes
182 LDKSecp256k1Error_Sentinel,
186 * A serialized transaction, in (pointer, length) form.
188 * This type optionally owns its own memory, and thus the semantics around access change based on
189 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
190 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
191 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
192 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
193 * you would be invalid.
195 * Note that, while it may change in the future, because transactions on the Rust side are stored
196 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
197 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
198 * `data_is_owned` either set or unset at your discretion.
200 typedef struct LDKTransaction {
202 * This is non-const for your convenience, an object passed to Rust is never written to.
209 typedef struct LDKCVec_u8Z {
215 * A transaction output including a scriptPubKey and value.
216 * This type *does* own its own memory, so must be free'd appropriately.
218 typedef struct LDKTxOut {
219 struct LDKCVec_u8Z script_pubkey;
223 typedef struct LDKSecretKey {
227 typedef union LDKCResult_SecretKeyErrorZPtr {
228 struct LDKSecretKey *result;
229 enum LDKSecp256k1Error *err;
230 } LDKCResult_SecretKeyErrorZPtr;
232 typedef struct LDKCResult_SecretKeyErrorZ {
233 union LDKCResult_SecretKeyErrorZPtr contents;
235 } LDKCResult_SecretKeyErrorZ;
237 typedef struct LDKPublicKey {
238 uint8_t compressed_form[33];
241 typedef union LDKCResult_PublicKeyErrorZPtr {
242 struct LDKPublicKey *result;
243 enum LDKSecp256k1Error *err;
244 } LDKCResult_PublicKeyErrorZPtr;
246 typedef struct LDKCResult_PublicKeyErrorZ {
247 union LDKCResult_PublicKeyErrorZPtr contents;
249 } LDKCResult_PublicKeyErrorZ;
254 * The set of public keys which are used in the creation of one commitment transaction.
255 * These are derived from the channel base keys and per-commitment data.
257 * A broadcaster key is provided from potential broadcaster of the computed transaction.
258 * A countersignatory key is coming from a protocol participant unable to broadcast the
261 * These keys are assumed to be good, either because the code derived them from
262 * channel basepoints via the new function, or they were obtained via
263 * CommitmentTransaction.trust().keys() because we trusted the source of the
264 * pre-calculated keys.
266 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
268 * Nearly everywhere, inner must be non-null, however in places where
269 * the Rust equivalent takes an Option, it may be set to null to indicate None.
271 LDKnativeTxCreationKeys *inner;
278 * An error in decoding a message or struct.
280 typedef struct MUST_USE_STRUCT LDKDecodeError {
282 * Nearly everywhere, inner must be non-null, however in places where
283 * the Rust equivalent takes an Option, it may be set to null to indicate None.
285 LDKnativeDecodeError *inner;
289 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
290 struct LDKTxCreationKeys *result;
291 struct LDKDecodeError *err;
292 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
294 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
295 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
297 } LDKCResult_TxCreationKeysDecodeErrorZ;
302 * One counterparty's public keys which do not change over the life of a channel.
304 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
306 * Nearly everywhere, inner must be non-null, however in places where
307 * the Rust equivalent takes an Option, it may be set to null to indicate None.
309 LDKnativeChannelPublicKeys *inner;
311 } LDKChannelPublicKeys;
313 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
314 struct LDKChannelPublicKeys *result;
315 struct LDKDecodeError *err;
316 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
318 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
319 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
321 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
323 typedef union LDKCResult_TxCreationKeysErrorZPtr {
324 struct LDKTxCreationKeys *result;
325 enum LDKSecp256k1Error *err;
326 } LDKCResult_TxCreationKeysErrorZPtr;
328 typedef struct LDKCResult_TxCreationKeysErrorZ {
329 union LDKCResult_TxCreationKeysErrorZPtr contents;
331 } LDKCResult_TxCreationKeysErrorZ;
336 * Information about an HTLC as it appears in a commitment transaction
338 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
340 * Nearly everywhere, inner must be non-null, however in places where
341 * the Rust equivalent takes an Option, it may be set to null to indicate None.
343 LDKnativeHTLCOutputInCommitment *inner;
345 } LDKHTLCOutputInCommitment;
347 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
348 struct LDKHTLCOutputInCommitment *result;
349 struct LDKDecodeError *err;
350 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
352 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
353 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
355 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
360 * Late-bound per-channel counterparty data used to build transactions.
362 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
364 * Nearly everywhere, inner must be non-null, however in places where
365 * the Rust equivalent takes an Option, it may be set to null to indicate None.
367 LDKnativeCounterpartyChannelTransactionParameters *inner;
369 } LDKCounterpartyChannelTransactionParameters;
371 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
372 struct LDKCounterpartyChannelTransactionParameters *result;
373 struct LDKDecodeError *err;
374 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
376 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
377 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
379 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
384 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
385 * The fields are organized by holder/counterparty.
387 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
388 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
390 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
392 * Nearly everywhere, inner must be non-null, however in places where
393 * the Rust equivalent takes an Option, it may be set to null to indicate None.
395 LDKnativeChannelTransactionParameters *inner;
397 } LDKChannelTransactionParameters;
399 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
400 struct LDKChannelTransactionParameters *result;
401 struct LDKDecodeError *err;
402 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
404 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
405 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
407 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
409 typedef struct LDKSignature {
410 uint8_t compact_form[64];
413 typedef struct LDKCVec_SignatureZ {
414 struct LDKSignature *data;
416 } LDKCVec_SignatureZ;
421 * Information needed to build and sign a holder's commitment transaction.
423 * The transaction is only signed once we are ready to broadcast.
425 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
427 * Nearly everywhere, inner must be non-null, however in places where
428 * the Rust equivalent takes an Option, it may be set to null to indicate None.
430 LDKnativeHolderCommitmentTransaction *inner;
432 } LDKHolderCommitmentTransaction;
434 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
435 struct LDKHolderCommitmentTransaction *result;
436 struct LDKDecodeError *err;
437 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
439 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
440 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
442 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
447 * A pre-built Bitcoin commitment transaction and its txid.
449 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
451 * Nearly everywhere, inner must be non-null, however in places where
452 * the Rust equivalent takes an Option, it may be set to null to indicate None.
454 LDKnativeBuiltCommitmentTransaction *inner;
456 } LDKBuiltCommitmentTransaction;
458 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
459 struct LDKBuiltCommitmentTransaction *result;
460 struct LDKDecodeError *err;
461 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
463 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
464 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
466 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
471 * This class tracks the per-transaction information needed to build a commitment transaction and to
472 * actually build it and sign. It is used for holder transactions that we sign only when needed
473 * and for transactions we sign for the counterparty.
475 * This class can be used inside a signer implementation to generate a signature given the relevant
478 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
480 * Nearly everywhere, inner must be non-null, however in places where
481 * the Rust equivalent takes an Option, it may be set to null to indicate None.
483 LDKnativeCommitmentTransaction *inner;
485 } LDKCommitmentTransaction;
487 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
488 struct LDKCommitmentTransaction *result;
489 struct LDKDecodeError *err;
490 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
492 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
493 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
495 } LDKCResult_CommitmentTransactionDecodeErrorZ;
500 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
501 * transaction and the transaction creation keys) are trusted.
503 * See trust() and verify() functions on CommitmentTransaction.
505 * This structure implements Deref.
507 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
509 * Nearly everywhere, inner must be non-null, however in places where
510 * the Rust equivalent takes an Option, it may be set to null to indicate None.
512 LDKnativeTrustedCommitmentTransaction *inner;
514 } LDKTrustedCommitmentTransaction;
516 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
517 struct LDKTrustedCommitmentTransaction *result;
519 * Note that this value is always NULL, as there are no contents in the Err variant
522 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
524 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
525 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
527 } LDKCResult_TrustedCommitmentTransactionNoneZ;
529 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
530 struct LDKCVec_SignatureZ *result;
532 * Note that this value is always NULL, as there are no contents in the Err variant
535 } LDKCResult_CVec_SignatureZNoneZPtr;
537 typedef struct LDKCResult_CVec_SignatureZNoneZ {
538 union LDKCResult_CVec_SignatureZNoneZPtr contents;
540 } LDKCResult_CVec_SignatureZNoneZ;
542 typedef struct LDKCVec_PublicKeyZ {
543 struct LDKPublicKey *data;
545 } LDKCVec_PublicKeyZ;
550 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
551 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
554 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
556 * Nearly everywhere, inner must be non-null, however in places where
557 * the Rust equivalent takes an Option, it may be set to null to indicate None.
559 LDKnativePeerHandleError *inner;
561 } LDKPeerHandleError;
563 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
564 struct LDKCVec_u8Z *result;
565 struct LDKPeerHandleError *err;
566 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
568 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
569 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
571 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
573 typedef union LDKCResult_NonePeerHandleErrorZPtr {
575 * Note that this value is always NULL, as there are no contents in the OK variant
578 struct LDKPeerHandleError *err;
579 } LDKCResult_NonePeerHandleErrorZPtr;
581 typedef struct LDKCResult_NonePeerHandleErrorZ {
582 union LDKCResult_NonePeerHandleErrorZPtr contents;
584 } LDKCResult_NonePeerHandleErrorZ;
586 typedef union LDKCResult_boolPeerHandleErrorZPtr {
588 struct LDKPeerHandleError *err;
589 } LDKCResult_boolPeerHandleErrorZPtr;
591 typedef struct LDKCResult_boolPeerHandleErrorZ {
592 union LDKCResult_boolPeerHandleErrorZPtr contents;
594 } LDKCResult_boolPeerHandleErrorZ;
599 * Features used within an `init` message.
601 typedef struct MUST_USE_STRUCT LDKInitFeatures {
603 * Nearly everywhere, inner must be non-null, however in places where
604 * the Rust equivalent takes an Option, it may be set to null to indicate None.
606 LDKnativeInitFeatures *inner;
610 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
611 struct LDKInitFeatures *result;
612 struct LDKDecodeError *err;
613 } LDKCResult_InitFeaturesDecodeErrorZPtr;
615 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
616 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
618 } LDKCResult_InitFeaturesDecodeErrorZ;
623 * Features used within a `node_announcement` message.
625 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
627 * Nearly everywhere, inner must be non-null, however in places where
628 * the Rust equivalent takes an Option, it may be set to null to indicate None.
630 LDKnativeNodeFeatures *inner;
634 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
635 struct LDKNodeFeatures *result;
636 struct LDKDecodeError *err;
637 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
639 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
640 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
642 } LDKCResult_NodeFeaturesDecodeErrorZ;
647 * Features used within a `channel_announcement` message.
649 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
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 LDKnativeChannelFeatures *inner;
656 } LDKChannelFeatures;
658 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
659 struct LDKChannelFeatures *result;
660 struct LDKDecodeError *err;
661 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
663 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
664 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
666 } LDKCResult_ChannelFeaturesDecodeErrorZ;
671 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
672 * with our counterparty.
674 typedef struct MUST_USE_STRUCT LDKChannelConfig {
676 * Nearly everywhere, inner must be non-null, however in places where
677 * the Rust equivalent takes an Option, it may be set to null to indicate None.
679 LDKnativeChannelConfig *inner;
683 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
684 struct LDKChannelConfig *result;
685 struct LDKDecodeError *err;
686 } LDKCResult_ChannelConfigDecodeErrorZPtr;
688 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
689 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
691 } LDKCResult_ChannelConfigDecodeErrorZ;
696 * An Err type for failure to process messages.
698 typedef struct MUST_USE_STRUCT LDKLightningError {
700 * Nearly everywhere, inner must be non-null, however in places where
701 * the Rust equivalent takes an Option, it may be set to null to indicate None.
703 LDKnativeLightningError *inner;
707 typedef union LDKCResult_boolLightningErrorZPtr {
709 struct LDKLightningError *err;
710 } LDKCResult_boolLightningErrorZPtr;
712 typedef struct LDKCResult_boolLightningErrorZ {
713 union LDKCResult_boolLightningErrorZPtr contents;
715 } LDKCResult_boolLightningErrorZ;
720 * A channel_announcement message to be sent or received from a peer
722 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
724 * Nearly everywhere, inner must be non-null, however in places where
725 * the Rust equivalent takes an Option, it may be set to null to indicate None.
727 LDKnativeChannelAnnouncement *inner;
729 } LDKChannelAnnouncement;
734 * A channel_update message to be sent or received from a peer
736 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
738 * Nearly everywhere, inner must be non-null, however in places where
739 * the Rust equivalent takes an Option, it may be set to null to indicate None.
741 LDKnativeChannelUpdate *inner;
745 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
746 struct LDKChannelAnnouncement a;
747 struct LDKChannelUpdate b;
748 struct LDKChannelUpdate c;
749 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
751 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
752 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
754 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
759 * A node_announcement message to be sent or received from a peer
761 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
763 * Nearly everywhere, inner must be non-null, however in places where
764 * the Rust equivalent takes an Option, it may be set to null to indicate None.
766 LDKnativeNodeAnnouncement *inner;
768 } LDKNodeAnnouncement;
770 typedef struct LDKCVec_NodeAnnouncementZ {
771 struct LDKNodeAnnouncement *data;
773 } LDKCVec_NodeAnnouncementZ;
775 typedef union LDKCResult_NoneLightningErrorZPtr {
777 * Note that this value is always NULL, as there are no contents in the OK variant
780 struct LDKLightningError *err;
781 } LDKCResult_NoneLightningErrorZPtr;
783 typedef struct LDKCResult_NoneLightningErrorZ {
784 union LDKCResult_NoneLightningErrorZPtr contents;
786 } LDKCResult_NoneLightningErrorZ;
791 * An accept_channel message to be sent or received from a peer
793 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
795 * Nearly everywhere, inner must be non-null, however in places where
796 * the Rust equivalent takes an Option, it may be set to null to indicate None.
798 LDKnativeAcceptChannel *inner;
805 * An open_channel message to be sent or received from a peer
807 typedef struct MUST_USE_STRUCT LDKOpenChannel {
809 * Nearly everywhere, inner must be non-null, however in places where
810 * the Rust equivalent takes an Option, it may be set to null to indicate None.
812 LDKnativeOpenChannel *inner;
819 * A funding_created message to be sent or received from a peer
821 typedef struct MUST_USE_STRUCT LDKFundingCreated {
823 * Nearly everywhere, inner must be non-null, however in places where
824 * the Rust equivalent takes an Option, it may be set to null to indicate None.
826 LDKnativeFundingCreated *inner;
833 * A funding_signed message to be sent or received from a peer
835 typedef struct MUST_USE_STRUCT LDKFundingSigned {
837 * Nearly everywhere, inner must be non-null, however in places where
838 * the Rust equivalent takes an Option, it may be set to null to indicate None.
840 LDKnativeFundingSigned *inner;
847 * A funding_locked message to be sent or received from a peer
849 typedef struct MUST_USE_STRUCT LDKFundingLocked {
851 * Nearly everywhere, inner must be non-null, however in places where
852 * the Rust equivalent takes an Option, it may be set to null to indicate None.
854 LDKnativeFundingLocked *inner;
861 * An announcement_signatures message to be sent or received from a peer
863 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
865 * Nearly everywhere, inner must be non-null, however in places where
866 * the Rust equivalent takes an Option, it may be set to null to indicate None.
868 LDKnativeAnnouncementSignatures *inner;
870 } LDKAnnouncementSignatures;
875 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
876 * transaction updates if they were pending.
878 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
880 * Nearly everywhere, inner must be non-null, however in places where
881 * the Rust equivalent takes an Option, it may be set to null to indicate None.
883 LDKnativeCommitmentUpdate *inner;
885 } LDKCommitmentUpdate;
890 * A revoke_and_ack message to be sent or received from a peer
892 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
894 * Nearly everywhere, inner must be non-null, however in places where
895 * the Rust equivalent takes an Option, it may be set to null to indicate None.
897 LDKnativeRevokeAndACK *inner;
904 * A closing_signed message to be sent or received from a peer
906 typedef struct MUST_USE_STRUCT LDKClosingSigned {
908 * Nearly everywhere, inner must be non-null, however in places where
909 * the Rust equivalent takes an Option, it may be set to null to indicate None.
911 LDKnativeClosingSigned *inner;
918 * A shutdown message to be sent or received from a peer
920 typedef struct MUST_USE_STRUCT LDKShutdown {
922 * Nearly everywhere, inner must be non-null, however in places where
923 * the Rust equivalent takes an Option, it may be set to null to indicate None.
925 LDKnativeShutdown *inner;
932 * A channel_reestablish message to be sent or received from a peer
934 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
936 * Nearly everywhere, inner must be non-null, however in places where
937 * the Rust equivalent takes an Option, it may be set to null to indicate None.
939 LDKnativeChannelReestablish *inner;
941 } LDKChannelReestablish;
946 * An error message to be sent or received from a peer
948 typedef struct MUST_USE_STRUCT LDKErrorMessage {
950 * Nearly everywhere, inner must be non-null, however in places where
951 * the Rust equivalent takes an Option, it may be set to null to indicate None.
953 LDKnativeErrorMessage *inner;
958 * Used to put an error message in a LightningError
960 typedef enum LDKErrorAction_Tag {
962 * The peer took some action which made us think they were useless. Disconnect them.
964 LDKErrorAction_DisconnectPeer,
966 * The peer did something harmless that we weren't able to process, just log and ignore
968 LDKErrorAction_IgnoreError,
970 * The peer did something incorrect. Tell them.
972 LDKErrorAction_SendErrorMessage,
974 * Must be last for serialization purposes
976 LDKErrorAction_Sentinel,
977 } LDKErrorAction_Tag;
979 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
980 struct LDKErrorMessage msg;
981 } LDKErrorAction_LDKDisconnectPeer_Body;
983 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
984 struct LDKErrorMessage msg;
985 } LDKErrorAction_LDKSendErrorMessage_Body;
987 typedef struct MUST_USE_STRUCT LDKErrorAction {
988 LDKErrorAction_Tag tag;
990 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
991 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
996 * The information we received from a peer along the route of a payment we originated. This is
997 * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
998 * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
1000 typedef enum LDKHTLCFailChannelUpdate_Tag {
1002 * We received an error which included a full ChannelUpdate message.
1004 LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
1006 * We received an error which indicated only that a channel has been closed
1008 LDKHTLCFailChannelUpdate_ChannelClosed,
1010 * We received an error which indicated only that a node has failed
1012 LDKHTLCFailChannelUpdate_NodeFailure,
1014 * Must be last for serialization purposes
1016 LDKHTLCFailChannelUpdate_Sentinel,
1017 } LDKHTLCFailChannelUpdate_Tag;
1019 typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
1020 struct LDKChannelUpdate msg;
1021 } LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
1023 typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
1024 uint64_t short_channel_id;
1026 } LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
1028 typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
1029 struct LDKPublicKey node_id;
1031 } LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
1033 typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
1034 LDKHTLCFailChannelUpdate_Tag tag;
1036 LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
1037 LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
1038 LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
1040 } LDKHTLCFailChannelUpdate;
1045 * A query_channel_range message is used to query a peer for channel
1046 * UTXOs in a range of blocks. The recipient of a query makes a best
1047 * effort to reply to the query using one or more reply_channel_range
1050 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
1052 * Nearly everywhere, inner must be non-null, however in places where
1053 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1055 LDKnativeQueryChannelRange *inner;
1057 } LDKQueryChannelRange;
1062 * A query_short_channel_ids message is used to query a peer for
1063 * routing gossip messages related to one or more short_channel_ids.
1064 * The query recipient will reply with the latest, if available,
1065 * channel_announcement, channel_update and node_announcement messages
1066 * it maintains for the requested short_channel_ids followed by a
1067 * reply_short_channel_ids_end message. The short_channel_ids sent in
1068 * this query are encoded. We only support encoding_type=0 uncompressed
1069 * serialization and do not support encoding_type=1 zlib serialization.
1071 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
1073 * Nearly everywhere, inner must be non-null, however in places where
1074 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1076 LDKnativeQueryShortChannelIds *inner;
1078 } LDKQueryShortChannelIds;
1081 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
1082 * broadcast to most peers).
1083 * These events are handled by PeerManager::process_events if you are using a PeerManager.
1085 typedef enum LDKMessageSendEvent_Tag {
1087 * Used to indicate that we've accepted a channel open and should send the accept_channel
1088 * message provided to the given peer.
1090 LDKMessageSendEvent_SendAcceptChannel,
1092 * Used to indicate that we've initiated a channel open and should send the open_channel
1093 * message provided to the given peer.
1095 LDKMessageSendEvent_SendOpenChannel,
1097 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
1099 LDKMessageSendEvent_SendFundingCreated,
1101 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
1103 LDKMessageSendEvent_SendFundingSigned,
1105 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
1107 LDKMessageSendEvent_SendFundingLocked,
1109 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
1111 LDKMessageSendEvent_SendAnnouncementSignatures,
1113 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
1114 * message should be sent to the peer with the given node_id.
1116 LDKMessageSendEvent_UpdateHTLCs,
1118 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
1120 LDKMessageSendEvent_SendRevokeAndACK,
1122 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
1124 LDKMessageSendEvent_SendClosingSigned,
1126 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
1128 LDKMessageSendEvent_SendShutdown,
1130 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
1132 LDKMessageSendEvent_SendChannelReestablish,
1134 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
1135 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
1137 * Note that after doing so, you very likely (unless you did so very recently) want to call
1138 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
1139 * This ensures that any nodes which see our channel_announcement also have a relevant
1140 * node_announcement, including relevant feature flags which may be important for routing
1143 LDKMessageSendEvent_BroadcastChannelAnnouncement,
1145 * Used to indicate that a node_announcement should be broadcast to all peers.
1147 LDKMessageSendEvent_BroadcastNodeAnnouncement,
1149 * Used to indicate that a channel_update should be broadcast to all peers.
1151 LDKMessageSendEvent_BroadcastChannelUpdate,
1153 * Broadcast an error downstream to be handled
1155 LDKMessageSendEvent_HandleError,
1157 * When a payment fails we may receive updates back from the hop where it failed. In such
1158 * cases this event is generated so that we can inform the network graph of this information.
1160 LDKMessageSendEvent_PaymentFailureNetworkUpdate,
1162 * Query a peer for channels with funding transaction UTXOs in a block range.
1164 LDKMessageSendEvent_SendChannelRangeQuery,
1166 * Request routing gossip messages from a peer for a list of channels identified by
1167 * their short_channel_ids.
1169 LDKMessageSendEvent_SendShortIdsQuery,
1171 * Must be last for serialization purposes
1173 LDKMessageSendEvent_Sentinel,
1174 } LDKMessageSendEvent_Tag;
1176 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
1177 struct LDKPublicKey node_id;
1178 struct LDKAcceptChannel msg;
1179 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
1181 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
1182 struct LDKPublicKey node_id;
1183 struct LDKOpenChannel msg;
1184 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
1186 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
1187 struct LDKPublicKey node_id;
1188 struct LDKFundingCreated msg;
1189 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
1191 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
1192 struct LDKPublicKey node_id;
1193 struct LDKFundingSigned msg;
1194 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
1196 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
1197 struct LDKPublicKey node_id;
1198 struct LDKFundingLocked msg;
1199 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
1201 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
1202 struct LDKPublicKey node_id;
1203 struct LDKAnnouncementSignatures msg;
1204 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
1206 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
1207 struct LDKPublicKey node_id;
1208 struct LDKCommitmentUpdate updates;
1209 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
1211 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
1212 struct LDKPublicKey node_id;
1213 struct LDKRevokeAndACK msg;
1214 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
1216 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
1217 struct LDKPublicKey node_id;
1218 struct LDKClosingSigned msg;
1219 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
1221 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
1222 struct LDKPublicKey node_id;
1223 struct LDKShutdown msg;
1224 } LDKMessageSendEvent_LDKSendShutdown_Body;
1226 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
1227 struct LDKPublicKey node_id;
1228 struct LDKChannelReestablish msg;
1229 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
1231 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
1232 struct LDKChannelAnnouncement msg;
1233 struct LDKChannelUpdate update_msg;
1234 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
1236 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
1237 struct LDKNodeAnnouncement msg;
1238 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
1240 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
1241 struct LDKChannelUpdate msg;
1242 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
1244 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
1245 struct LDKPublicKey node_id;
1246 struct LDKErrorAction action;
1247 } LDKMessageSendEvent_LDKHandleError_Body;
1249 typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
1250 struct LDKHTLCFailChannelUpdate update;
1251 } LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
1253 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
1254 struct LDKPublicKey node_id;
1255 struct LDKQueryChannelRange msg;
1256 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
1258 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
1259 struct LDKPublicKey node_id;
1260 struct LDKQueryShortChannelIds msg;
1261 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
1263 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
1264 LDKMessageSendEvent_Tag tag;
1266 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
1267 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
1268 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
1269 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
1270 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
1271 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
1272 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
1273 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
1274 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
1275 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
1276 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
1277 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
1278 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
1279 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
1280 LDKMessageSendEvent_LDKHandleError_Body handle_error;
1281 LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
1282 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
1283 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
1285 } LDKMessageSendEvent;
1287 typedef struct LDKCVec_MessageSendEventZ {
1288 struct LDKMessageSendEvent *data;
1290 } LDKCVec_MessageSendEventZ;
1295 * Details about one direction of a channel. Received
1296 * within a channel update.
1298 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
1300 * Nearly everywhere, inner must be non-null, however in places where
1301 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1303 LDKnativeDirectionalChannelInfo *inner;
1305 } LDKDirectionalChannelInfo;
1307 typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
1308 struct LDKDirectionalChannelInfo *result;
1309 struct LDKDecodeError *err;
1310 } LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
1312 typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
1313 union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
1315 } LDKCResult_DirectionalChannelInfoDecodeErrorZ;
1320 * Details about a channel (both directions).
1321 * Received within a channel announcement.
1323 typedef struct MUST_USE_STRUCT LDKChannelInfo {
1325 * Nearly everywhere, inner must be non-null, however in places where
1326 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1328 LDKnativeChannelInfo *inner;
1332 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
1333 struct LDKChannelInfo *result;
1334 struct LDKDecodeError *err;
1335 } LDKCResult_ChannelInfoDecodeErrorZPtr;
1337 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
1338 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
1340 } LDKCResult_ChannelInfoDecodeErrorZ;
1345 * Fees for routing via a given channel or a node
1347 typedef struct MUST_USE_STRUCT LDKRoutingFees {
1349 * Nearly everywhere, inner must be non-null, however in places where
1350 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1352 LDKnativeRoutingFees *inner;
1356 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
1357 struct LDKRoutingFees *result;
1358 struct LDKDecodeError *err;
1359 } LDKCResult_RoutingFeesDecodeErrorZPtr;
1361 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
1362 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
1364 } LDKCResult_RoutingFeesDecodeErrorZ;
1366 typedef struct LDKFourBytes {
1370 typedef struct LDKSixteenBytes {
1374 typedef struct LDKTenBytes {
1379 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1380 * look up the corresponding function in rust-lightning's docs.
1382 typedef struct LDKThirtyTwoBytes {
1384 } LDKThirtyTwoBytes;
1387 * An address which can be used to connect to a remote peer
1389 typedef enum LDKNetAddress_Tag {
1391 * An IPv4 address/port on which the peer is listening.
1395 * An IPv6 address/port on which the peer is listening.
1399 * An old-style Tor onion address/port on which the peer is listening.
1401 LDKNetAddress_OnionV2,
1403 * A new-style Tor onion address/port on which the peer is listening.
1404 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
1405 * wrap as base32 and append \".onion\".
1407 LDKNetAddress_OnionV3,
1409 * Must be last for serialization purposes
1411 LDKNetAddress_Sentinel,
1412 } LDKNetAddress_Tag;
1414 typedef struct LDKNetAddress_LDKIPv4_Body {
1415 struct LDKFourBytes addr;
1417 } LDKNetAddress_LDKIPv4_Body;
1419 typedef struct LDKNetAddress_LDKIPv6_Body {
1420 struct LDKSixteenBytes addr;
1422 } LDKNetAddress_LDKIPv6_Body;
1424 typedef struct LDKNetAddress_LDKOnionV2_Body {
1425 struct LDKTenBytes addr;
1427 } LDKNetAddress_LDKOnionV2_Body;
1429 typedef struct LDKNetAddress_LDKOnionV3_Body {
1430 struct LDKThirtyTwoBytes ed25519_pubkey;
1434 } LDKNetAddress_LDKOnionV3_Body;
1436 typedef struct MUST_USE_STRUCT LDKNetAddress {
1437 LDKNetAddress_Tag tag;
1439 LDKNetAddress_LDKIPv4_Body i_pv4;
1440 LDKNetAddress_LDKIPv6_Body i_pv6;
1441 LDKNetAddress_LDKOnionV2_Body onion_v2;
1442 LDKNetAddress_LDKOnionV3_Body onion_v3;
1446 typedef struct LDKCVec_NetAddressZ {
1447 struct LDKNetAddress *data;
1449 } LDKCVec_NetAddressZ;
1454 * Information received in the latest node_announcement from this node.
1456 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
1458 * Nearly everywhere, inner must be non-null, however in places where
1459 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1461 LDKnativeNodeAnnouncementInfo *inner;
1463 } LDKNodeAnnouncementInfo;
1465 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
1466 struct LDKNodeAnnouncementInfo *result;
1467 struct LDKDecodeError *err;
1468 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
1470 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
1471 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
1473 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
1475 typedef struct LDKCVec_u64Z {
1483 * Details about a node in the network, known from the network announcement.
1485 typedef struct MUST_USE_STRUCT LDKNodeInfo {
1487 * Nearly everywhere, inner must be non-null, however in places where
1488 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1490 LDKnativeNodeInfo *inner;
1494 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
1495 struct LDKNodeInfo *result;
1496 struct LDKDecodeError *err;
1497 } LDKCResult_NodeInfoDecodeErrorZPtr;
1499 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
1500 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
1502 } LDKCResult_NodeInfoDecodeErrorZ;
1507 * Represents the network as nodes and channels between them
1509 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
1511 * Nearly everywhere, inner must be non-null, however in places where
1512 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1514 LDKnativeNetworkGraph *inner;
1518 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
1519 struct LDKNetworkGraph *result;
1520 struct LDKDecodeError *err;
1521 } LDKCResult_NetworkGraphDecodeErrorZPtr;
1523 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
1524 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
1526 } LDKCResult_NetworkGraphDecodeErrorZ;
1528 typedef struct LDKC2Tuple_usizeTransactionZ {
1530 struct LDKTransaction b;
1531 } LDKC2Tuple_usizeTransactionZ;
1533 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
1534 struct LDKC2Tuple_usizeTransactionZ *data;
1536 } LDKCVec_C2Tuple_usizeTransactionZZ;
1538 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
1540 * Note that this value is always NULL, as there are no contents in the OK variant
1543 enum LDKChannelMonitorUpdateErr *err;
1544 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
1546 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
1547 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
1549 } LDKCResult_NoneChannelMonitorUpdateErrZ;
1554 * An event to be processed by the ChannelManager.
1556 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
1558 * Nearly everywhere, inner must be non-null, however in places where
1559 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1561 LDKnativeMonitorEvent *inner;
1565 typedef struct LDKCVec_MonitorEventZ {
1566 struct LDKMonitorEvent *data;
1568 } LDKCVec_MonitorEventZ;
1573 * A reference to a transaction output.
1575 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
1576 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
1578 typedef struct MUST_USE_STRUCT LDKOutPoint {
1580 * Nearly everywhere, inner must be non-null, however in places where
1581 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1583 LDKnativeOutPoint *inner;
1590 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
1591 * claim at any point in the future) an event is generated which you must track and be able to
1592 * spend on-chain. The information needed to do this is provided in this enum, including the
1593 * outpoint describing which txid and output index is available, the full output which exists at
1594 * that txid/index, and any keys or other information required to sign.
1596 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
1598 * Nearly everywhere, inner must be non-null, however in places where
1599 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1601 LDKnativeSpendableOutputDescriptor *inner;
1603 } LDKSpendableOutputDescriptor;
1605 typedef struct LDKCVec_SpendableOutputDescriptorZ {
1606 struct LDKSpendableOutputDescriptor *data;
1608 } LDKCVec_SpendableOutputDescriptorZ;
1611 * An Event which you should probably take some action in response to.
1613 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
1614 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
1615 * written as it makes no sense to respond to it after reconnecting to peers).
1617 typedef enum LDKEvent_Tag {
1619 * Used to indicate that the client should generate a funding transaction with the given
1620 * parameters and then call ChannelManager::funding_transaction_generated.
1621 * Generated in ChannelManager message handling.
1622 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
1623 * counterparty can steal your funds!
1625 LDKEvent_FundingGenerationReady,
1627 * Used to indicate that the client may now broadcast the funding transaction it created for a
1628 * channel. Broadcasting such a transaction prior to this event may lead to our counterparty
1629 * trivially stealing all funds in the funding transaction!
1631 LDKEvent_FundingBroadcastSafe,
1633 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
1634 * ChannelManager::claim_funds to get it....
1635 * Note that if the preimage is not known or the amount paid is incorrect, you should call
1636 * ChannelManager::fail_htlc_backwards to free up resources for this HTLC and avoid
1637 * network congestion.
1638 * The amount paid should be considered 'incorrect' when it is less than or more than twice
1639 * the amount expected.
1640 * If you fail to call either ChannelManager::claim_funds or
1641 * ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
1642 * automatically failed.
1644 LDKEvent_PaymentReceived,
1646 * Indicates an outbound payment we made succeeded (ie it made it all the way to its target
1647 * and we got back the payment preimage for it).
1648 * Note that duplicative PaymentSent Events may be generated - it is your responsibility to
1649 * deduplicate them by payment_preimage (which MUST be unique)!
1651 LDKEvent_PaymentSent,
1653 * Indicates an outbound payment we made failed. Probably some intermediary node dropped
1654 * something. You may wish to retry with a different route.
1655 * Note that duplicative PaymentFailed Events may be generated - it is your responsibility to
1656 * deduplicate them by payment_hash (which MUST be unique)!
1658 LDKEvent_PaymentFailed,
1660 * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
1661 * time in the future.
1663 LDKEvent_PendingHTLCsForwardable,
1665 * Used to indicate that an output was generated on-chain which you should know how to spend.
1666 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
1667 * counterparty spending them due to some kind of timeout. Thus, you need to store them
1668 * somewhere and spend them when you create on-chain transactions.
1670 LDKEvent_SpendableOutputs,
1672 * Must be last for serialization purposes
1677 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
1678 struct LDKThirtyTwoBytes temporary_channel_id;
1679 uint64_t channel_value_satoshis;
1680 struct LDKCVec_u8Z output_script;
1681 uint64_t user_channel_id;
1682 } LDKEvent_LDKFundingGenerationReady_Body;
1684 typedef struct LDKEvent_LDKFundingBroadcastSafe_Body {
1685 struct LDKOutPoint funding_txo;
1686 uint64_t user_channel_id;
1687 } LDKEvent_LDKFundingBroadcastSafe_Body;
1689 typedef struct LDKEvent_LDKPaymentReceived_Body {
1690 struct LDKThirtyTwoBytes payment_hash;
1691 struct LDKThirtyTwoBytes payment_secret;
1693 } LDKEvent_LDKPaymentReceived_Body;
1695 typedef struct LDKEvent_LDKPaymentSent_Body {
1696 struct LDKThirtyTwoBytes payment_preimage;
1697 } LDKEvent_LDKPaymentSent_Body;
1699 typedef struct LDKEvent_LDKPaymentFailed_Body {
1700 struct LDKThirtyTwoBytes payment_hash;
1701 bool rejected_by_dest;
1702 } LDKEvent_LDKPaymentFailed_Body;
1704 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
1705 uint64_t time_forwardable;
1706 } LDKEvent_LDKPendingHTLCsForwardable_Body;
1708 typedef struct LDKEvent_LDKSpendableOutputs_Body {
1709 struct LDKCVec_SpendableOutputDescriptorZ outputs;
1710 } LDKEvent_LDKSpendableOutputs_Body;
1712 typedef struct MUST_USE_STRUCT LDKEvent {
1715 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
1716 LDKEvent_LDKFundingBroadcastSafe_Body funding_broadcast_safe;
1717 LDKEvent_LDKPaymentReceived_Body payment_received;
1718 LDKEvent_LDKPaymentSent_Body payment_sent;
1719 LDKEvent_LDKPaymentFailed_Body payment_failed;
1720 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
1721 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
1725 typedef struct LDKCVec_EventZ {
1726 struct LDKEvent *data;
1730 typedef union LDKCResult_OutPointDecodeErrorZPtr {
1731 struct LDKOutPoint *result;
1732 struct LDKDecodeError *err;
1733 } LDKCResult_OutPointDecodeErrorZPtr;
1735 typedef struct LDKCResult_OutPointDecodeErrorZ {
1736 union LDKCResult_OutPointDecodeErrorZPtr contents;
1738 } LDKCResult_OutPointDecodeErrorZ;
1743 * An update generated by the underlying Channel itself which contains some new information the
1744 * ChannelMonitor should be made aware of.
1746 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
1748 * Nearly everywhere, inner must be non-null, however in places where
1749 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1751 LDKnativeChannelMonitorUpdate *inner;
1753 } LDKChannelMonitorUpdate;
1755 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
1756 struct LDKChannelMonitorUpdate *result;
1757 struct LDKDecodeError *err;
1758 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
1760 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
1761 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
1763 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
1768 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
1769 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
1770 * preimage claim backward will lead to loss of funds.
1772 * [`chain::Watch`]: ../trait.Watch.html
1774 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
1776 * Nearly everywhere, inner must be non-null, however in places where
1777 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1779 LDKnativeHTLCUpdate *inner;
1783 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
1784 struct LDKHTLCUpdate *result;
1785 struct LDKDecodeError *err;
1786 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
1788 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
1789 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
1791 } LDKCResult_HTLCUpdateDecodeErrorZ;
1796 * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
1797 * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
1798 * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
1800 * Contains a developer-readable error message.
1802 typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
1804 * Nearly everywhere, inner must be non-null, however in places where
1805 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1807 LDKnativeMonitorUpdateError *inner;
1809 } LDKMonitorUpdateError;
1811 typedef union LDKCResult_NoneMonitorUpdateErrorZPtr {
1813 * Note that this value is always NULL, as there are no contents in the OK variant
1816 struct LDKMonitorUpdateError *err;
1817 } LDKCResult_NoneMonitorUpdateErrorZPtr;
1819 typedef struct LDKCResult_NoneMonitorUpdateErrorZ {
1820 union LDKCResult_NoneMonitorUpdateErrorZPtr contents;
1822 } LDKCResult_NoneMonitorUpdateErrorZ;
1824 typedef struct LDKC2Tuple_OutPointScriptZ {
1825 struct LDKOutPoint a;
1826 struct LDKCVec_u8Z b;
1827 } LDKC2Tuple_OutPointScriptZ;
1829 typedef struct LDKCVec_TransactionZ {
1830 struct LDKTransaction *data;
1832 } LDKCVec_TransactionZ;
1834 typedef struct LDKC2Tuple_u32TxOutZ {
1837 } LDKC2Tuple_u32TxOutZ;
1839 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
1840 struct LDKC2Tuple_u32TxOutZ *data;
1842 } LDKCVec_C2Tuple_u32TxOutZZ;
1844 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
1845 struct LDKThirtyTwoBytes a;
1846 struct LDKCVec_C2Tuple_u32TxOutZZ b;
1847 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
1849 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ {
1850 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
1852 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ;
1854 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
1855 struct LDKSignature a;
1856 struct LDKCVec_SignatureZ b;
1857 } LDKC2Tuple_SignatureCVec_SignatureZZ;
1859 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
1860 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
1862 * Note that this value is always NULL, as there are no contents in the Err variant
1865 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
1867 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
1868 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
1870 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
1872 typedef union LDKCResult_SignatureNoneZPtr {
1873 struct LDKSignature *result;
1875 * Note that this value is always NULL, as there are no contents in the Err variant
1878 } LDKCResult_SignatureNoneZPtr;
1880 typedef struct LDKCResult_SignatureNoneZ {
1881 union LDKCResult_SignatureNoneZPtr contents;
1883 } LDKCResult_SignatureNoneZ;
1888 * The unsigned part of a channel_announcement
1890 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
1892 * Nearly everywhere, inner must be non-null, however in places where
1893 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1895 LDKnativeUnsignedChannelAnnouncement *inner;
1897 } LDKUnsignedChannelAnnouncement;
1900 * Set of lightning keys needed to operate a channel as described in BOLT 3.
1902 * Signing services could be implemented on a hardware wallet. In this case,
1903 * the current ChannelKeys would be a front-end on top of a communication
1904 * channel connected to your secure device and lightning key material wouldn't
1905 * reside on a hot server. Nevertheless, a this deployment would still need
1906 * to trust the ChannelManager to avoid loss of funds as this latest component
1907 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
1909 * A more secure iteration would be to use hashlock (or payment points) to pair
1910 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
1911 * at the price of more state and computation on the hardware wallet side. In the future,
1912 * we are looking forward to design such interface.
1914 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
1915 * to act, as liveness and breach reply correctness are always going to be hard requirements
1916 * of LN security model, orthogonal of key management issues.
1918 typedef struct LDKChannelKeys {
1921 * Gets the per-commitment point for a specific commitment number
1923 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
1925 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
1927 * Gets the commitment secret for a specific commitment number as part of the revocation process
1929 * An external signer implementation should error here if the commitment was already signed
1930 * and should refuse to sign it in the future.
1932 * May be called more than once for the same index.
1934 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
1936 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
1938 * Gets the holder's channel public keys and basepoints
1940 struct LDKChannelPublicKeys pubkeys;
1942 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
1943 * Note that this takes a pointer to this object, not the this_ptr like other methods do
1944 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
1946 void (*set_pubkeys)(const struct LDKChannelKeys*NONNULL_PTR );
1948 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
1949 * some SpendableOutputDescriptor types. This should be sufficient to identify this
1950 * ChannelKeys object uniquely and lookup or re-derive its keys.
1952 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
1954 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
1956 * Note that if signing fails or is rejected, the channel will be force-closed.
1958 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
1960 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
1961 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
1962 * latest commitment_tx when we initiate a force-close.
1963 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
1964 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
1966 * This may be called multiple times for the same transaction.
1968 * An external signer implementation should check that the commitment has not been revoked.
1970 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
1972 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
1974 * Create a signature for the given input in a transaction spending an HTLC or commitment
1975 * transaction output when our counterparty broadcasts an old state.
1977 * A justice transaction may claim multiples outputs at the same time if timelocks are
1978 * similar, but only a signature for the input at index `input` should be signed for here.
1979 * It may be called multiples time for same output(s) if a fee-bump is needed with regards
1980 * to an upcoming timelock expiration.
1982 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
1984 * per_commitment_key is revocation secret which was provided by our counterparty when they
1985 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
1986 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
1989 * htlc holds HTLC elements (hash, timelock) if the output being spent is a HTLC output, thus
1990 * changing the format of the witness script (which is committed to in the BIP 143
1993 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);
1995 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
1996 * transaction, either offered or received.
1998 * Such a transaction may claim multiples offered outputs at same time if we know the
1999 * preimage for each when we create it, but only the input at index `input` should be
2000 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
2001 * needed with regards to an upcoming timelock expiration.
2003 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
2006 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2008 * Per_commitment_point is the dynamic point corresponding to the channel state
2009 * detected onchain. It has been generated by our counterparty and is used to derive
2010 * channel state keys, which are then included in the witness script and committed to in the
2011 * BIP 143 signature.
2013 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);
2015 * Create a signature for a (proposed) closing transaction.
2017 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
2018 * chosen to forgo their output as dust.
2020 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
2022 * Signs a channel announcement message with our funding key, proving it comes from one
2023 * of the channel participants.
2025 * Note that if this fails or is rejected, the channel will not be publicly announced and
2026 * our counterparty may (though likely will not) close the channel on us for violating the
2029 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
2031 * Set the counterparty static channel data, including basepoints,
2032 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
2033 * This is done as soon as the funding outpoint is known. Since these are static channel data,
2034 * they MUST NOT be allowed to change to different values once set.
2036 * channel_parameters.is_populated() MUST be true.
2038 * We bind holder_selected_contest_delay late here for API convenience.
2040 * Will be called before any signatures are applied.
2042 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
2043 void *(*clone)(const void *this_arg);
2044 struct LDKCVec_u8Z (*write)(const void *this_arg);
2045 void (*free)(void *this_arg);
2051 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
2052 * on-chain transactions to ensure no loss of funds occurs.
2054 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
2055 * information and are actively monitoring the chain.
2057 * Pending Events or updated HTLCs which have not yet been read out by
2058 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
2059 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
2060 * gotten are fully handled before re-serializing the new state.
2062 * Note that the deserializer is only implemented for (Sha256dHash, ChannelMonitor), which
2063 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
2064 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
2065 * returned block hash and the the current chain and then reconnecting blocks to get to the
2066 * best chain) upon deserializing the object!
2068 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
2070 * Nearly everywhere, inner must be non-null, however in places where
2071 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2073 LDKnativeChannelMonitor *inner;
2075 } LDKChannelMonitor;
2077 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
2078 struct LDKThirtyTwoBytes a;
2079 struct LDKChannelMonitor b;
2080 } LDKC2Tuple_BlockHashChannelMonitorZ;
2082 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
2083 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
2084 struct LDKDecodeError *err;
2085 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
2087 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
2088 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
2090 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
2092 typedef union LDKCResult_TxOutAccessErrorZPtr {
2093 struct LDKTxOut *result;
2094 enum LDKAccessError *err;
2095 } LDKCResult_TxOutAccessErrorZPtr;
2097 typedef struct LDKCResult_TxOutAccessErrorZ {
2098 union LDKCResult_TxOutAccessErrorZPtr contents;
2100 } LDKCResult_TxOutAccessErrorZ;
2103 * A Rust str object, ie a reference to a UTF8-valid string.
2104 * This is *not* null-terminated so cannot be used directly as a C string!
2106 typedef struct LDKStr {
2107 const uint8_t *chars;
2112 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
2115 typedef enum LDKAPIError_Tag {
2117 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
2118 * are documented, but generally indicates some precondition of a function was violated.
2120 LDKAPIError_APIMisuseError,
2122 * Due to a high feerate, we were unable to complete the request.
2123 * For example, this may be returned if the feerate implies we cannot open a channel at the
2124 * requested value, but opening a larger channel would succeed.
2126 LDKAPIError_FeeRateTooHigh,
2128 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
2129 * too-many-hops, etc).
2131 LDKAPIError_RouteError,
2133 * We were unable to complete the request as the Channel required to do so is unable to
2134 * complete the request (or was not found). This can take many forms, including disconnected
2135 * peer, channel at capacity, channel shutting down, etc.
2137 LDKAPIError_ChannelUnavailable,
2139 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
2140 * attempted action to fail.
2142 LDKAPIError_MonitorUpdateFailed,
2144 * Must be last for serialization purposes
2146 LDKAPIError_Sentinel,
2149 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
2150 struct LDKCVec_u8Z err;
2151 } LDKAPIError_LDKAPIMisuseError_Body;
2153 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
2154 struct LDKCVec_u8Z err;
2156 } LDKAPIError_LDKFeeRateTooHigh_Body;
2158 typedef struct LDKAPIError_LDKRouteError_Body {
2160 } LDKAPIError_LDKRouteError_Body;
2162 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
2163 struct LDKCVec_u8Z err;
2164 } LDKAPIError_LDKChannelUnavailable_Body;
2166 typedef struct MUST_USE_STRUCT LDKAPIError {
2167 LDKAPIError_Tag tag;
2169 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
2170 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
2171 LDKAPIError_LDKRouteError_Body route_error;
2172 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
2176 typedef union LDKCResult_NoneAPIErrorZPtr {
2178 * Note that this value is always NULL, as there are no contents in the OK variant
2181 struct LDKAPIError *err;
2182 } LDKCResult_NoneAPIErrorZPtr;
2184 typedef struct LDKCResult_NoneAPIErrorZ {
2185 union LDKCResult_NoneAPIErrorZPtr contents;
2187 } LDKCResult_NoneAPIErrorZ;
2192 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
2194 typedef struct MUST_USE_STRUCT LDKChannelDetails {
2196 * Nearly everywhere, inner must be non-null, however in places where
2197 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2199 LDKnativeChannelDetails *inner;
2201 } LDKChannelDetails;
2203 typedef struct LDKCVec_ChannelDetailsZ {
2204 struct LDKChannelDetails *data;
2206 } LDKCVec_ChannelDetailsZ;
2211 * If a payment fails to send, it can be in one of several states. This enum is returned as the
2212 * Err() type describing which state the payment is in, see the description of individual enum
2215 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
2217 * Nearly everywhere, inner must be non-null, however in places where
2218 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2220 LDKnativePaymentSendFailure *inner;
2222 } LDKPaymentSendFailure;
2224 typedef union LDKCResult_NonePaymentSendFailureZPtr {
2226 * Note that this value is always NULL, as there are no contents in the OK variant
2229 struct LDKPaymentSendFailure *err;
2230 } LDKCResult_NonePaymentSendFailureZPtr;
2232 typedef struct LDKCResult_NonePaymentSendFailureZ {
2233 union LDKCResult_NonePaymentSendFailureZPtr contents;
2235 } LDKCResult_NonePaymentSendFailureZ;
2237 typedef struct LDKCVec_ChannelMonitorZ {
2238 struct LDKChannelMonitor *data;
2240 } LDKCVec_ChannelMonitorZ;
2243 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
2244 * blocks are connected and disconnected.
2246 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
2247 * responsible for maintaining a set of monitors such that they can be updated accordingly as
2248 * channel state changes and HTLCs are resolved. See method documentation for specific
2251 * Implementations **must** ensure that updates are successfully applied and persisted upon method
2252 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
2253 * without taking any further action such as persisting the current state.
2255 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
2256 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
2257 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
2258 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
2259 * multiple instances.
2261 * [`ChannelMonitor`]: channelmonitor/struct.ChannelMonitor.html
2262 * [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html
2263 * [`PermanentFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.PermanentFailure
2265 typedef struct LDKWatch {
2268 * Watches a channel identified by `funding_txo` using `monitor`.
2270 * Implementations are responsible for watching the chain for the funding transaction along
2271 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
2272 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
2274 * [`get_outputs_to_watch`]: channelmonitor/struct.ChannelMonitor.html#method.get_outputs_to_watch
2275 * [`block_connected`]: channelmonitor/struct.ChannelMonitor.html#method.block_connected
2276 * [`block_disconnected`]: channelmonitor/struct.ChannelMonitor.html#method.block_disconnected
2278 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
2280 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
2282 * Implementations must call [`update_monitor`] with the given update. See
2283 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
2285 * [`update_monitor`]: channelmonitor/struct.ChannelMonitor.html#method.update_monitor
2286 * [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html
2288 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
2290 * Returns any monitor events since the last call. Subsequent calls must only return new
2293 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
2294 void (*free)(void *this_arg);
2298 * An interface to send a transaction to the Bitcoin network.
2300 typedef struct LDKBroadcasterInterface {
2303 * Sends a transaction out to (hopefully) be mined.
2305 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
2306 void (*free)(void *this_arg);
2307 } LDKBroadcasterInterface;
2309 typedef union LDKCResult_ChannelKeysDecodeErrorZPtr {
2310 struct LDKChannelKeys *result;
2311 struct LDKDecodeError *err;
2312 } LDKCResult_ChannelKeysDecodeErrorZPtr;
2314 typedef struct LDKCResult_ChannelKeysDecodeErrorZ {
2315 union LDKCResult_ChannelKeysDecodeErrorZPtr contents;
2317 } LDKCResult_ChannelKeysDecodeErrorZ;
2319 typedef struct LDKu8slice {
2320 const uint8_t *data;
2325 * A trait to describe an object which can get user secrets and key material.
2327 typedef struct LDKKeysInterface {
2330 * Get node secret key (aka node_id or network_key).
2332 * This method must return the same value each time it is called.
2334 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
2336 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
2338 * This method should return a different value each time it is called, to avoid linking
2339 * on-chain funds across channels as controlled to the same user.
2341 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
2343 * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
2346 * This method should return a different value each time it is called, to avoid linking
2347 * on-chain funds across channels as controlled to the same user.
2349 struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
2351 * Get a new set of ChannelKeys for per-channel secrets. These MUST be unique even if you
2352 * restarted with some stale data!
2354 * This method must return a different value each time it is called.
2356 struct LDKChannelKeys (*get_channel_keys)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
2358 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
2359 * onion packets and for temporary channel IDs. There is no requirement that these be
2360 * persisted anywhere, though they must be unique across restarts.
2362 * This method must return a different value each time it is called.
2364 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
2366 * Reads a `ChanKeySigner` for this `KeysInterface` from the given input stream.
2367 * This is only called during deserialization of other objects which contain
2368 * `ChannelKeys`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
2369 * The bytes are exactly those which `<Self::ChanKeySigner as Writeable>::write()` writes, and
2370 * contain no versioning scheme. You may wish to include your own version prefix and ensure
2371 * you've read all of the provided bytes to ensure no corruption occurred.
2373 struct LDKCResult_ChannelKeysDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
2374 void (*free)(void *this_arg);
2378 * A trait which should be implemented to provide feerate information on a number of time
2381 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
2382 * called from inside the library in response to chain events, P2P events, or timer events).
2384 typedef struct LDKFeeEstimator {
2387 * Gets estimated satoshis of fee required per 1000 Weight-Units.
2389 * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
2390 * don't put us below 1 satoshi-per-byte).
2392 * This translates to:
2393 * * satoshis-per-byte * 250
2394 * * ceil(satoshis-per-kbyte / 4)
2396 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
2397 void (*free)(void *this_arg);
2401 * A trait encapsulating the operations required of a logger
2403 typedef struct LDKLogger {
2408 void (*log)(const void *this_arg, const char *record);
2409 void (*free)(void *this_arg);
2415 * Manager which keeps track of a number of channels and sends messages to the appropriate
2416 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
2418 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
2419 * to individual Channels.
2421 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
2422 * all peers during write/read (though does not modify this instance, only the instance being
2423 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
2424 * called funding_transaction_generated for outbound channels).
2426 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
2427 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
2428 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
2429 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
2430 * the serialization process). If the deserialized version is out-of-date compared to the
2431 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
2432 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
2434 * Note that the deserializer is only implemented for (Sha256dHash, ChannelManager), which
2435 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
2436 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
2437 * block_connected() to step towards your best block) upon deserialization before using the
2440 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
2441 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
2442 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
2443 * offline for a full minute. In order to track this, you must call
2444 * timer_chan_freshness_every_min roughly once per minute, though it doesn't have to be perfect.
2446 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
2447 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
2448 * essentially you should default to using a SimpleRefChannelManager, and use a
2449 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
2450 * you're using lightning-net-tokio.
2452 typedef struct MUST_USE_STRUCT LDKChannelManager {
2454 * Nearly everywhere, inner must be non-null, however in places where
2455 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2457 LDKnativeChannelManager *inner;
2459 } LDKChannelManager;
2461 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
2462 struct LDKThirtyTwoBytes a;
2463 struct LDKChannelManager b;
2464 } LDKC2Tuple_BlockHashChannelManagerZ;
2466 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
2467 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
2468 struct LDKDecodeError *err;
2469 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
2471 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
2472 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
2474 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
2476 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
2477 struct LDKSpendableOutputDescriptor *result;
2478 struct LDKDecodeError *err;
2479 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
2481 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
2482 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
2484 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
2486 typedef struct LDKCVec_CVec_u8ZZ {
2487 struct LDKCVec_u8Z *data;
2489 } LDKCVec_CVec_u8ZZ;
2491 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
2492 struct LDKCVec_CVec_u8ZZ *result;
2494 * Note that this value is always NULL, as there are no contents in the Err variant
2497 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
2499 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
2500 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
2502 } LDKCResult_CVec_CVec_u8ZZNoneZ;
2507 * A simple implementation of ChannelKeys that just keeps the private keys in memory.
2509 * This implementation performs no policy checks and is insufficient by itself as
2510 * a secure external signer.
2512 typedef struct MUST_USE_STRUCT LDKInMemoryChannelKeys {
2514 * Nearly everywhere, inner must be non-null, however in places where
2515 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2517 LDKnativeInMemoryChannelKeys *inner;
2519 } LDKInMemoryChannelKeys;
2521 typedef union LDKCResult_InMemoryChannelKeysDecodeErrorZPtr {
2522 struct LDKInMemoryChannelKeys *result;
2523 struct LDKDecodeError *err;
2524 } LDKCResult_InMemoryChannelKeysDecodeErrorZPtr;
2526 typedef struct LDKCResult_InMemoryChannelKeysDecodeErrorZ {
2527 union LDKCResult_InMemoryChannelKeysDecodeErrorZPtr contents;
2529 } LDKCResult_InMemoryChannelKeysDecodeErrorZ;
2531 typedef struct LDKCVec_TxOutZ {
2532 struct LDKTxOut *data;
2536 typedef union LDKCResult_TransactionNoneZPtr {
2537 struct LDKTransaction *result;
2539 * Note that this value is always NULL, as there are no contents in the Err variant
2542 } LDKCResult_TransactionNoneZPtr;
2544 typedef struct LDKCResult_TransactionNoneZ {
2545 union LDKCResult_TransactionNoneZPtr contents;
2547 } LDKCResult_TransactionNoneZ;
2554 typedef struct MUST_USE_STRUCT LDKRouteHop {
2556 * Nearly everywhere, inner must be non-null, however in places where
2557 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2559 LDKnativeRouteHop *inner;
2563 typedef struct LDKCVec_RouteHopZ {
2564 struct LDKRouteHop *data;
2566 } LDKCVec_RouteHopZ;
2568 typedef struct LDKCVec_CVec_RouteHopZZ {
2569 struct LDKCVec_RouteHopZ *data;
2571 } LDKCVec_CVec_RouteHopZZ;
2576 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
2577 * it can take multiple paths. Each path is composed of one or more hops through the network.
2579 typedef struct MUST_USE_STRUCT LDKRoute {
2581 * Nearly everywhere, inner must be non-null, however in places where
2582 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2584 LDKnativeRoute *inner;
2588 typedef union LDKCResult_RouteDecodeErrorZPtr {
2589 struct LDKRoute *result;
2590 struct LDKDecodeError *err;
2591 } LDKCResult_RouteDecodeErrorZPtr;
2593 typedef struct LDKCResult_RouteDecodeErrorZ {
2594 union LDKCResult_RouteDecodeErrorZPtr contents;
2596 } LDKCResult_RouteDecodeErrorZ;
2601 * A channel descriptor which provides a last-hop route to get_route
2603 typedef struct MUST_USE_STRUCT LDKRouteHint {
2605 * Nearly everywhere, inner must be non-null, however in places where
2606 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2608 LDKnativeRouteHint *inner;
2612 typedef struct LDKCVec_RouteHintZ {
2613 struct LDKRouteHint *data;
2615 } LDKCVec_RouteHintZ;
2617 typedef union LDKCResult_RouteLightningErrorZPtr {
2618 struct LDKRoute *result;
2619 struct LDKLightningError *err;
2620 } LDKCResult_RouteLightningErrorZPtr;
2622 typedef struct LDKCResult_RouteLightningErrorZ {
2623 union LDKCResult_RouteLightningErrorZPtr contents;
2625 } LDKCResult_RouteLightningErrorZ;
2627 typedef union LDKCResult_NetAddressu8ZPtr {
2628 struct LDKNetAddress *result;
2630 } LDKCResult_NetAddressu8ZPtr;
2632 typedef struct LDKCResult_NetAddressu8Z {
2633 union LDKCResult_NetAddressu8ZPtr contents;
2635 } LDKCResult_NetAddressu8Z;
2637 typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
2638 struct LDKCResult_NetAddressu8Z *result;
2639 struct LDKDecodeError *err;
2640 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
2642 typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ {
2643 union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
2645 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
2650 * An update_add_htlc message to be sent or received from a peer
2652 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
2654 * Nearly everywhere, inner must be non-null, however in places where
2655 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2657 LDKnativeUpdateAddHTLC *inner;
2661 typedef struct LDKCVec_UpdateAddHTLCZ {
2662 struct LDKUpdateAddHTLC *data;
2664 } LDKCVec_UpdateAddHTLCZ;
2669 * An update_fulfill_htlc message to be sent or received from a peer
2671 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
2673 * Nearly everywhere, inner must be non-null, however in places where
2674 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2676 LDKnativeUpdateFulfillHTLC *inner;
2678 } LDKUpdateFulfillHTLC;
2680 typedef struct LDKCVec_UpdateFulfillHTLCZ {
2681 struct LDKUpdateFulfillHTLC *data;
2683 } LDKCVec_UpdateFulfillHTLCZ;
2688 * An update_fail_htlc message to be sent or received from a peer
2690 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
2692 * Nearly everywhere, inner must be non-null, however in places where
2693 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2695 LDKnativeUpdateFailHTLC *inner;
2697 } LDKUpdateFailHTLC;
2699 typedef struct LDKCVec_UpdateFailHTLCZ {
2700 struct LDKUpdateFailHTLC *data;
2702 } LDKCVec_UpdateFailHTLCZ;
2707 * An update_fail_malformed_htlc message to be sent or received from a peer
2709 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
2711 * Nearly everywhere, inner must be non-null, however in places where
2712 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2714 LDKnativeUpdateFailMalformedHTLC *inner;
2716 } LDKUpdateFailMalformedHTLC;
2718 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
2719 struct LDKUpdateFailMalformedHTLC *data;
2721 } LDKCVec_UpdateFailMalformedHTLCZ;
2723 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
2724 struct LDKAcceptChannel *result;
2725 struct LDKDecodeError *err;
2726 } LDKCResult_AcceptChannelDecodeErrorZPtr;
2728 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
2729 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
2731 } LDKCResult_AcceptChannelDecodeErrorZ;
2733 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
2734 struct LDKAnnouncementSignatures *result;
2735 struct LDKDecodeError *err;
2736 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
2738 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
2739 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
2741 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
2743 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
2744 struct LDKChannelReestablish *result;
2745 struct LDKDecodeError *err;
2746 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
2748 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
2749 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
2751 } LDKCResult_ChannelReestablishDecodeErrorZ;
2753 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
2754 struct LDKClosingSigned *result;
2755 struct LDKDecodeError *err;
2756 } LDKCResult_ClosingSignedDecodeErrorZPtr;
2758 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
2759 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
2761 } LDKCResult_ClosingSignedDecodeErrorZ;
2766 * A commitment_signed message to be sent or received from a peer
2768 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
2770 * Nearly everywhere, inner must be non-null, however in places where
2771 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2773 LDKnativeCommitmentSigned *inner;
2775 } LDKCommitmentSigned;
2777 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
2778 struct LDKCommitmentSigned *result;
2779 struct LDKDecodeError *err;
2780 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
2782 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
2783 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
2785 } LDKCResult_CommitmentSignedDecodeErrorZ;
2787 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
2788 struct LDKFundingCreated *result;
2789 struct LDKDecodeError *err;
2790 } LDKCResult_FundingCreatedDecodeErrorZPtr;
2792 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
2793 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
2795 } LDKCResult_FundingCreatedDecodeErrorZ;
2797 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
2798 struct LDKFundingSigned *result;
2799 struct LDKDecodeError *err;
2800 } LDKCResult_FundingSignedDecodeErrorZPtr;
2802 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
2803 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
2805 } LDKCResult_FundingSignedDecodeErrorZ;
2807 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
2808 struct LDKFundingLocked *result;
2809 struct LDKDecodeError *err;
2810 } LDKCResult_FundingLockedDecodeErrorZPtr;
2812 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
2813 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
2815 } LDKCResult_FundingLockedDecodeErrorZ;
2820 * An init message to be sent or received from a peer
2822 typedef struct MUST_USE_STRUCT LDKInit {
2824 * Nearly everywhere, inner must be non-null, however in places where
2825 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2827 LDKnativeInit *inner;
2831 typedef union LDKCResult_InitDecodeErrorZPtr {
2832 struct LDKInit *result;
2833 struct LDKDecodeError *err;
2834 } LDKCResult_InitDecodeErrorZPtr;
2836 typedef struct LDKCResult_InitDecodeErrorZ {
2837 union LDKCResult_InitDecodeErrorZPtr contents;
2839 } LDKCResult_InitDecodeErrorZ;
2841 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
2842 struct LDKOpenChannel *result;
2843 struct LDKDecodeError *err;
2844 } LDKCResult_OpenChannelDecodeErrorZPtr;
2846 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
2847 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
2849 } LDKCResult_OpenChannelDecodeErrorZ;
2851 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
2852 struct LDKRevokeAndACK *result;
2853 struct LDKDecodeError *err;
2854 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
2856 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
2857 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
2859 } LDKCResult_RevokeAndACKDecodeErrorZ;
2861 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
2862 struct LDKShutdown *result;
2863 struct LDKDecodeError *err;
2864 } LDKCResult_ShutdownDecodeErrorZPtr;
2866 typedef struct LDKCResult_ShutdownDecodeErrorZ {
2867 union LDKCResult_ShutdownDecodeErrorZPtr contents;
2869 } LDKCResult_ShutdownDecodeErrorZ;
2871 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
2872 struct LDKUpdateFailHTLC *result;
2873 struct LDKDecodeError *err;
2874 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
2876 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
2877 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
2879 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
2881 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
2882 struct LDKUpdateFailMalformedHTLC *result;
2883 struct LDKDecodeError *err;
2884 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
2886 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
2887 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
2889 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
2894 * An update_fee message to be sent or received from a peer
2896 typedef struct MUST_USE_STRUCT LDKUpdateFee {
2898 * Nearly everywhere, inner must be non-null, however in places where
2899 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2901 LDKnativeUpdateFee *inner;
2905 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
2906 struct LDKUpdateFee *result;
2907 struct LDKDecodeError *err;
2908 } LDKCResult_UpdateFeeDecodeErrorZPtr;
2910 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
2911 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
2913 } LDKCResult_UpdateFeeDecodeErrorZ;
2915 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
2916 struct LDKUpdateFulfillHTLC *result;
2917 struct LDKDecodeError *err;
2918 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
2920 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
2921 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
2923 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
2925 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
2926 struct LDKUpdateAddHTLC *result;
2927 struct LDKDecodeError *err;
2928 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
2930 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
2931 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
2933 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
2938 * A ping message to be sent or received from a peer
2940 typedef struct MUST_USE_STRUCT LDKPing {
2942 * Nearly everywhere, inner must be non-null, however in places where
2943 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2945 LDKnativePing *inner;
2949 typedef union LDKCResult_PingDecodeErrorZPtr {
2950 struct LDKPing *result;
2951 struct LDKDecodeError *err;
2952 } LDKCResult_PingDecodeErrorZPtr;
2954 typedef struct LDKCResult_PingDecodeErrorZ {
2955 union LDKCResult_PingDecodeErrorZPtr contents;
2957 } LDKCResult_PingDecodeErrorZ;
2962 * A pong message to be sent or received from a peer
2964 typedef struct MUST_USE_STRUCT LDKPong {
2966 * Nearly everywhere, inner must be non-null, however in places where
2967 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2969 LDKnativePong *inner;
2973 typedef union LDKCResult_PongDecodeErrorZPtr {
2974 struct LDKPong *result;
2975 struct LDKDecodeError *err;
2976 } LDKCResult_PongDecodeErrorZPtr;
2978 typedef struct LDKCResult_PongDecodeErrorZ {
2979 union LDKCResult_PongDecodeErrorZPtr contents;
2981 } LDKCResult_PongDecodeErrorZ;
2983 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
2984 struct LDKUnsignedChannelAnnouncement *result;
2985 struct LDKDecodeError *err;
2986 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
2988 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
2989 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
2991 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
2993 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
2994 struct LDKChannelAnnouncement *result;
2995 struct LDKDecodeError *err;
2996 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
2998 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
2999 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
3001 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
3006 * The unsigned part of a channel_update
3008 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
3010 * Nearly everywhere, inner must be non-null, however in places where
3011 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3013 LDKnativeUnsignedChannelUpdate *inner;
3015 } LDKUnsignedChannelUpdate;
3017 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
3018 struct LDKUnsignedChannelUpdate *result;
3019 struct LDKDecodeError *err;
3020 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
3022 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
3023 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
3025 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
3027 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
3028 struct LDKChannelUpdate *result;
3029 struct LDKDecodeError *err;
3030 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
3032 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
3033 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
3035 } LDKCResult_ChannelUpdateDecodeErrorZ;
3037 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
3038 struct LDKErrorMessage *result;
3039 struct LDKDecodeError *err;
3040 } LDKCResult_ErrorMessageDecodeErrorZPtr;
3042 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
3043 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
3045 } LDKCResult_ErrorMessageDecodeErrorZ;
3050 * The unsigned part of a node_announcement
3052 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
3054 * Nearly everywhere, inner must be non-null, however in places where
3055 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3057 LDKnativeUnsignedNodeAnnouncement *inner;
3059 } LDKUnsignedNodeAnnouncement;
3061 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
3062 struct LDKUnsignedNodeAnnouncement *result;
3063 struct LDKDecodeError *err;
3064 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
3066 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
3067 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
3069 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
3071 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
3072 struct LDKNodeAnnouncement *result;
3073 struct LDKDecodeError *err;
3074 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
3076 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
3077 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
3079 } LDKCResult_NodeAnnouncementDecodeErrorZ;
3081 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
3082 struct LDKQueryShortChannelIds *result;
3083 struct LDKDecodeError *err;
3084 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
3086 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
3087 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
3089 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
3094 * A reply_short_channel_ids_end message is sent as a reply to a
3095 * query_short_channel_ids message. The query recipient makes a best
3096 * effort to respond based on their local network view which may not be
3097 * a perfect view of the network.
3099 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
3101 * Nearly everywhere, inner must be non-null, however in places where
3102 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3104 LDKnativeReplyShortChannelIdsEnd *inner;
3106 } LDKReplyShortChannelIdsEnd;
3108 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
3109 struct LDKReplyShortChannelIdsEnd *result;
3110 struct LDKDecodeError *err;
3111 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
3113 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
3114 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
3116 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
3118 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
3119 struct LDKQueryChannelRange *result;
3120 struct LDKDecodeError *err;
3121 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
3123 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
3124 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
3126 } LDKCResult_QueryChannelRangeDecodeErrorZ;
3131 * A reply_channel_range message is a reply to a query_channel_range
3132 * message. Multiple reply_channel_range messages can be sent in reply
3133 * to a single query_channel_range message. The query recipient makes a
3134 * best effort to respond based on their local network view which may
3135 * not be a perfect view of the network. The short_channel_ids in the
3136 * reply are encoded. We only support encoding_type=0 uncompressed
3137 * serialization and do not support encoding_type=1 zlib serialization.
3139 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
3141 * Nearly everywhere, inner must be non-null, however in places where
3142 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3144 LDKnativeReplyChannelRange *inner;
3146 } LDKReplyChannelRange;
3148 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
3149 struct LDKReplyChannelRange *result;
3150 struct LDKDecodeError *err;
3151 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
3153 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
3154 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
3156 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
3161 * A gossip_timestamp_filter message is used by a node to request
3162 * gossip relay for messages in the requested time range when the
3163 * gossip_queries feature has been negotiated.
3165 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
3167 * Nearly everywhere, inner must be non-null, however in places where
3168 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3170 LDKnativeGossipTimestampFilter *inner;
3172 } LDKGossipTimestampFilter;
3174 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
3175 struct LDKGossipTimestampFilter *result;
3176 struct LDKDecodeError *err;
3177 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
3179 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
3180 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
3182 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
3185 * A trait indicating an object may generate message send events
3187 typedef struct LDKMessageSendEventsProvider {
3190 * Gets the list of pending events which were generated by previous actions, clearing the list
3193 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
3194 void (*free)(void *this_arg);
3195 } LDKMessageSendEventsProvider;
3198 * A trait indicating an object may generate events
3200 typedef struct LDKEventsProvider {
3203 * Gets the list of pending events which were generated by previous actions, clearing the list
3206 struct LDKCVec_EventZ (*get_and_clear_pending_events)(const void *this_arg);
3207 void (*free)(void *this_arg);
3208 } LDKEventsProvider;
3213 * Configuration we set when applicable.
3215 * Default::default() provides sane defaults.
3217 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
3219 * Nearly everywhere, inner must be non-null, however in places where
3220 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3222 LDKnativeChannelHandshakeConfig *inner;
3224 } LDKChannelHandshakeConfig;
3229 * Optional channel limits which are applied during channel creation.
3231 * These limits are only applied to our counterparty's limits, not our own.
3233 * Use 0/<type>::max_value() as appropriate to skip checking.
3235 * Provides sane defaults for most configurations.
3237 * Most additional limits are disabled except those with which specify a default in individual
3238 * field documentation. Note that this may result in barely-usable channels, but since they
3239 * are applied mostly only to incoming channels that's not much of a problem.
3241 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
3243 * Nearly everywhere, inner must be non-null, however in places where
3244 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3246 LDKnativeChannelHandshakeLimits *inner;
3248 } LDKChannelHandshakeLimits;
3253 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
3255 * Default::default() provides sane defaults for most configurations
3256 * (but currently with 0 relay fees!)
3258 typedef struct MUST_USE_STRUCT LDKUserConfig {
3260 * Nearly everywhere, inner must be non-null, however in places where
3261 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3263 LDKnativeUserConfig *inner;
3268 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
3271 typedef struct LDKAccess {
3274 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
3275 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
3278 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
3280 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
3281 void (*free)(void *this_arg);
3285 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
3288 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
3289 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
3290 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
3291 * receiving full blocks from a chain source, any further filtering is unnecessary.
3293 * After an output has been registered, subsequent block retrievals from the chain source must not
3294 * exclude any transactions matching the new criteria nor any in-block descendants of such
3297 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
3298 * should not block on I/O. Implementations should instead queue the newly monitored data to be
3299 * processed later. Then, in order to block until the data has been processed, any `Watch`
3300 * invocation that has called the `Filter` must return [`TemporaryFailure`].
3302 * [`Watch`]: trait.Watch.html
3303 * [`TemporaryFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.TemporaryFailure
3304 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
3305 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
3307 typedef struct LDKFilter {
3310 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
3311 * a spending condition.
3313 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
3315 * Registers interest in spends of a transaction output identified by `outpoint` having
3316 * `script_pubkey` as the spending condition.
3318 void (*register_output)(const void *this_arg, const struct LDKOutPoint *NONNULL_PTR outpoint, struct LDKu8slice script_pubkey);
3319 void (*free)(void *this_arg);
3323 * `Persist` defines behavior for persisting channel monitors: this could mean
3324 * writing once to disk, and/or uploading to one or more backup services.
3326 * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
3327 * to disk/backups. And, on every update, you **must** persist either the
3328 * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
3329 * of situations such as revoking a transaction, then crashing before this
3330 * revocation can be persisted, then unintentionally broadcasting a revoked
3331 * transaction and losing money. This is a risk because previous channel states
3332 * are toxic, so it's important that whatever channel state is persisted is
3335 typedef struct LDKPersist {
3338 * Persist a new channel's data. The data can be stored any way you want, but
3339 * the identifier provided by Rust-Lightning is the channel's outpoint (and
3340 * it is up to you to maintain a correct mapping between the outpoint and the
3341 * stored channel data). Note that you **must** persist every new monitor to
3342 * disk. See the `Persist` trait documentation for more details.
3344 * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
3345 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
3347 * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
3348 * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
3350 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
3352 * Update one channel's data. The provided `ChannelMonitor` has already
3353 * applied the given update.
3355 * Note that on every update, you **must** persist either the
3356 * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
3357 * the `Persist` trait documentation for more details.
3359 * If an implementer chooses to persist the updates only, they need to make
3360 * sure that all the updates are applied to the `ChannelMonitors` *before*
3361 * the set of channel monitors is given to the `ChannelManager`
3362 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
3363 * applying a monitor update to a monitor. If full `ChannelMonitors` are
3364 * persisted, then there is no need to persist individual updates.
3366 * Note that there could be a performance tradeoff between persisting complete
3367 * channel monitors on every update vs. persisting only updates and applying
3368 * them in batches. The size of each monitor grows `O(number of state updates)`
3369 * whereas updates are small and `O(1)`.
3371 * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
3372 * [`ChannelMonitorUpdate::write`] for writing out an update, and
3373 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
3375 * [`ChannelMonitor::update_monitor`]: struct.ChannelMonitor.html#impl-1
3376 * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
3377 * [`ChannelMonitorUpdate::write`]: struct.ChannelMonitorUpdate.html#method.write
3378 * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
3380 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);
3381 void (*free)(void *this_arg);
3387 * An implementation of [`chain::Watch`] for monitoring channels.
3389 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
3390 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
3391 * or used independently to monitor channels remotely. See the [module-level documentation] for
3394 * [`chain::Watch`]: ../trait.Watch.html
3395 * [`ChannelManager`]: ../../ln/channelmanager/struct.ChannelManager.html
3396 * [module-level documentation]: index.html
3398 typedef struct MUST_USE_STRUCT LDKChainMonitor {
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 LDKnativeChainMonitor *inner;
3410 * Information about a spendable output to a P2WSH script. See
3411 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
3413 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
3415 * Nearly everywhere, inner must be non-null, however in places where
3416 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3418 LDKnativeDelayedPaymentOutputDescriptor *inner;
3420 } LDKDelayedPaymentOutputDescriptor;
3425 * Information about a spendable output to our \"payment key\". See
3426 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
3428 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
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 LDKnativeStaticPaymentOutputDescriptor *inner;
3435 } LDKStaticPaymentOutputDescriptor;
3440 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
3441 * and derives keys from that.
3443 * Your node_id is seed/0'
3444 * ChannelMonitor closes may use seed/1'
3445 * Cooperative closes may use seed/2'
3446 * The two close keys may be needed to claim on-chain funds!
3448 typedef struct MUST_USE_STRUCT LDKKeysManager {
3450 * Nearly everywhere, inner must be non-null, however in places where
3451 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3453 LDKnativeKeysManager *inner;
3457 typedef struct LDKThreeBytes {
3462 * A trait to describe an object which can receive channel messages.
3464 * Messages MAY be called in parallel when they originate from different their_node_ids, however
3465 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
3467 typedef struct LDKChannelMessageHandler {
3470 * Handle an incoming open_channel message from the given peer.
3472 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
3474 * Handle an incoming accept_channel message from the given peer.
3476 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
3478 * Handle an incoming funding_created message from the given peer.
3480 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
3482 * Handle an incoming funding_signed message from the given peer.
3484 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
3486 * Handle an incoming funding_locked message from the given peer.
3488 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
3490 * Handle an incoming shutdown message from the given peer.
3492 void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
3494 * Handle an incoming closing_signed message from the given peer.
3496 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
3498 * Handle an incoming update_add_htlc message from the given peer.
3500 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
3502 * Handle an incoming update_fulfill_htlc message from the given peer.
3504 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
3506 * Handle an incoming update_fail_htlc message from the given peer.
3508 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
3510 * Handle an incoming update_fail_malformed_htlc message from the given peer.
3512 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
3514 * Handle an incoming commitment_signed message from the given peer.
3516 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
3518 * Handle an incoming revoke_and_ack message from the given peer.
3520 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
3522 * Handle an incoming update_fee message from the given peer.
3524 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
3526 * Handle an incoming announcement_signatures message from the given peer.
3528 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
3530 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
3531 * is believed to be possible in the future (eg they're sending us messages we don't
3532 * understand or indicate they require unknown feature bits), no_connection_possible is set
3533 * and any outstanding channels should be failed.
3535 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
3537 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
3539 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
3541 * Handle an incoming channel_reestablish message from the given peer.
3543 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
3545 * Handle an incoming error message from the given peer.
3547 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
3548 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
3549 void (*free)(void *this_arg);
3550 } LDKChannelMessageHandler;
3555 * Arguments for the creation of a ChannelManager that are not deserialized.
3557 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
3559 * 1) Deserialize all stored ChannelMonitors.
3560 * 2) Deserialize the ChannelManager by filling in this struct and calling <(Sha256dHash,
3561 * ChannelManager)>::read(reader, args).
3562 * This may result in closing some Channels if the ChannelMonitor is newer than the stored
3563 * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
3564 * 3) Register all relevant ChannelMonitor outpoints with your chain watch mechanism using
3565 * ChannelMonitor::get_outputs_to_watch() and ChannelMonitor::get_funding_txo().
3566 * 4) Reconnect blocks on your ChannelMonitors.
3567 * 5) Move the ChannelMonitors into your local chain::Watch.
3568 * 6) Disconnect/connect blocks on the ChannelManager.
3570 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
3572 * Nearly everywhere, inner must be non-null, however in places where
3573 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3575 LDKnativeChannelManagerReadArgs *inner;
3577 } LDKChannelManagerReadArgs;
3582 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
3583 * This is used to convince the recipient that the channel is at a certain commitment
3584 * number even if they lost that data due to a local failure. Of course, the peer may lie
3585 * and even later commitments may have been revoked.
3587 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
3589 * Nearly everywhere, inner must be non-null, however in places where
3590 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3592 LDKnativeDataLossProtect *inner;
3594 } LDKDataLossProtect;
3597 * A trait to describe an object which can receive routing messages.
3599 * # Implementor DoS Warnings
3601 * For `gossip_queries` messages there are potential DoS vectors when handling
3602 * inbound queries. Implementors using an on-disk network graph should be aware of
3603 * repeated disk I/O for queries accessing different parts of the network graph.
3605 typedef struct LDKRoutingMessageHandler {
3608 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
3609 * false or returning an Err otherwise.
3611 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
3613 * Handle a channel_announcement message, returning true if it should be forwarded on, false
3614 * or returning an Err otherwise.
3616 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
3618 * Handle an incoming channel_update message, returning true if it should be forwarded on,
3619 * false or returning an Err otherwise.
3621 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
3623 * Handle some updates to the route graph that we learned due to an outbound failed payment.
3625 void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update);
3627 * Gets a subset of the channel announcements and updates required to dump our routing table
3628 * to a remote node, starting at the short_channel_id indicated by starting_point and
3629 * including the batch_amount entries immediately higher in numerical value than starting_point.
3631 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
3633 * Gets a subset of the node announcements required to dump our routing table to a remote node,
3634 * starting at the node *after* the provided publickey and including batch_amount entries
3635 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
3636 * If None is provided for starting_point, we start at the first node.
3638 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
3640 * Called when a connection is established with a peer. This can be used to
3641 * perform routing table synchronization using a strategy defined by the
3644 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
3646 * Handles the reply of a query we initiated to learn about channels
3647 * for a given range of blocks. We can expect to receive one or more
3648 * replies to a single query.
3650 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
3652 * Handles the reply of a query we initiated asking for routing gossip
3653 * messages for a list of channels. We should receive this message when
3654 * a node has completed its best effort to send us the pertaining routing
3657 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
3659 * Handles when a peer asks us to send a list of short_channel_ids
3660 * for the requested range of blocks.
3662 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
3664 * Handles when a peer asks us to send routing gossip messages for a
3665 * list of short_channel_ids.
3667 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
3668 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
3669 void (*free)(void *this_arg);
3670 } LDKRoutingMessageHandler;
3675 * Provides references to trait impls which handle different types of messages.
3677 typedef struct MUST_USE_STRUCT LDKMessageHandler {
3679 * Nearly everywhere, inner must be non-null, however in places where
3680 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3682 LDKnativeMessageHandler *inner;
3684 } LDKMessageHandler;
3687 * Provides an object which can be used to send data to and which uniquely identifies a connection
3688 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
3689 * implement Hash to meet the PeerManager API.
3691 * For efficiency, Clone should be relatively cheap for this type.
3693 * You probably want to just extend an int and put a file descriptor in a struct and implement
3694 * send_data. Note that if you are using a higher-level net library that may call close() itself,
3695 * be careful to ensure you don't have races whereby you might register a new connection with an
3696 * fd which is the same as a previous one which has yet to be removed via
3697 * PeerManager::socket_disconnected().
3699 typedef struct LDKSocketDescriptor {
3702 * Attempts to send some data from the given slice to the peer.
3704 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
3705 * Note that in the disconnected case, socket_disconnected must still fire and further write
3706 * attempts may occur until that time.
3708 * If the returned size is smaller than data.len(), a write_available event must
3709 * trigger the next time more data can be written. Additionally, until the a send_data event
3710 * completes fully, no further read_events should trigger on the same peer!
3712 * If a read_event on this descriptor had previously returned true (indicating that read
3713 * events should be paused to prevent DoS in the send buffer), resume_read may be set
3714 * indicating that read events on this descriptor should resume. A resume_read of false does
3715 * *not* imply that further read events should be paused.
3717 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
3719 * Disconnect the socket pointed to by this SocketDescriptor. Once this function returns, no
3720 * more calls to write_buffer_space_avail, read_event or socket_disconnected may be made with
3721 * this descriptor. No socket_disconnected call should be generated as a result of this call,
3722 * though races may occur whereby disconnect_socket is called after a call to
3723 * socket_disconnected but prior to socket_disconnected returning.
3725 void (*disconnect_socket)(void *this_arg);
3726 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
3727 uint64_t (*hash)(const void *this_arg);
3728 void *(*clone)(const void *this_arg);
3729 void (*free)(void *this_arg);
3730 } LDKSocketDescriptor;
3735 * A PeerManager manages a set of peers, described by their SocketDescriptor and marshalls socket
3736 * events into messages which it passes on to its MessageHandlers.
3738 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
3739 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
3740 * essentially you should default to using a SimpleRefPeerManager, and use a
3741 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
3742 * you're using lightning-net-tokio.
3744 typedef struct MUST_USE_STRUCT LDKPeerManager {
3746 * Nearly everywhere, inner must be non-null, however in places where
3747 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3749 LDKnativePeerManager *inner;
3756 * Static channel fields used to build transactions given per-commitment fields, organized by
3757 * broadcaster/countersignatory.
3759 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
3760 * as_holder_broadcastable and as_counterparty_broadcastable functions.
3762 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
3764 * Nearly everywhere, inner must be non-null, however in places where
3765 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3767 LDKnativeDirectedChannelTransactionParameters *inner;
3769 } LDKDirectedChannelTransactionParameters;
3774 * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
3775 * This exists only to make accessing a RwLock<NetworkGraph> possible from
3776 * the C bindings, as it can be done directly in Rust code.
3778 typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
3780 * Nearly everywhere, inner must be non-null, however in places where
3781 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3783 LDKnativeLockedNetworkGraph *inner;
3785 } LDKLockedNetworkGraph;
3790 * Receives and validates network updates from peers,
3791 * stores authentic and relevant data as a network graph.
3792 * This network graph is then used for routing payments.
3793 * Provides interface to help with initial routing sync by
3794 * serving historical announcements.
3796 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
3798 * Nearly everywhere, inner must be non-null, however in places where
3799 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3801 LDKnativeNetGraphMsgHandler *inner;
3803 } LDKNetGraphMsgHandler;
3805 extern const uintptr_t MAX_BUF_SIZE;
3807 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
3809 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
3811 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
3813 void Transaction_free(struct LDKTransaction _res);
3815 void TxOut_free(struct LDKTxOut _res);
3817 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
3819 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
3821 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
3823 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
3825 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
3827 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
3829 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
3831 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
3833 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
3835 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
3837 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
3839 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
3841 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
3843 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
3845 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
3847 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
3849 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
3851 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
3853 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
3855 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
3857 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
3859 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
3861 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
3863 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
3865 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
3867 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
3869 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
3871 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
3873 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
3875 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
3877 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
3879 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
3881 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
3883 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
3885 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
3887 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
3889 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
3891 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
3893 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
3895 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
3897 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
3899 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
3901 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
3903 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
3905 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
3907 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
3909 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
3911 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
3913 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
3915 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
3917 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
3919 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
3921 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
3923 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
3925 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
3927 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
3929 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
3931 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
3933 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
3935 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
3937 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
3939 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
3941 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
3943 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
3945 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
3947 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
3949 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
3951 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
3953 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
3955 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
3957 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
3959 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
3961 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
3963 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
3965 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
3967 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
3969 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
3971 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
3973 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
3975 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
3977 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
3979 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
3981 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
3983 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
3985 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
3987 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
3989 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
3991 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
3993 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
3995 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
3997 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
3999 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
4001 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
4003 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
4005 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
4007 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
4009 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
4011 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
4013 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
4015 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
4017 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
4019 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
4021 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
4023 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
4025 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
4027 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
4029 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
4031 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
4033 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
4035 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
4037 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
4039 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
4041 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
4043 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
4045 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
4047 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
4049 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
4051 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
4053 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
4055 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
4057 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
4059 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
4061 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
4063 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
4065 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
4067 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
4069 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
4071 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
4073 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
4075 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
4077 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
4079 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
4081 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
4083 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
4085 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
4087 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
4089 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
4091 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
4093 void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
4095 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
4097 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
4099 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
4101 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
4103 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
4105 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
4107 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
4109 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
4111 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
4113 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
4115 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
4117 void CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res);
4119 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
4121 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
4123 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
4125 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
4127 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
4129 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
4131 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
4133 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
4135 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
4137 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
4139 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
4141 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
4143 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
4145 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
4147 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
4149 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
4151 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
4153 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
4155 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
4157 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
4159 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
4161 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
4163 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
4165 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
4167 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
4169 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
4171 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
4173 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
4175 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
4177 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
4179 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
4181 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
4183 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
4185 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
4187 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
4189 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
4191 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
4193 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
4195 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
4197 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
4199 struct LDKCResult_ChannelKeysDecodeErrorZ CResult_ChannelKeysDecodeErrorZ_ok(struct LDKChannelKeys o);
4201 struct LDKCResult_ChannelKeysDecodeErrorZ CResult_ChannelKeysDecodeErrorZ_err(struct LDKDecodeError e);
4203 void CResult_ChannelKeysDecodeErrorZ_free(struct LDKCResult_ChannelKeysDecodeErrorZ _res);
4205 struct LDKCResult_ChannelKeysDecodeErrorZ CResult_ChannelKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelKeysDecodeErrorZ *NONNULL_PTR orig);
4207 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
4209 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
4211 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
4213 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
4215 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
4217 struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_ok(struct LDKInMemoryChannelKeys o);
4219 struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_err(struct LDKDecodeError e);
4221 void CResult_InMemoryChannelKeysDecodeErrorZ_free(struct LDKCResult_InMemoryChannelKeysDecodeErrorZ _res);
4223 struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_clone(const struct LDKCResult_InMemoryChannelKeysDecodeErrorZ *NONNULL_PTR orig);
4225 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
4227 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
4229 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
4231 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
4233 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
4235 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
4237 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
4239 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
4241 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
4243 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
4245 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
4247 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
4249 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
4251 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
4253 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
4255 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
4257 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
4259 void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
4261 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
4263 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
4265 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
4267 void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
4269 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
4271 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
4273 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
4275 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
4277 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
4279 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
4281 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
4283 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
4285 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
4287 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
4289 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
4291 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
4293 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
4295 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
4297 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
4299 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
4301 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
4303 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
4305 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
4307 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
4309 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
4311 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
4313 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
4315 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
4317 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
4319 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
4321 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
4323 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
4325 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
4327 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
4329 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
4331 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
4333 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
4335 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
4337 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
4339 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
4341 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
4343 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
4345 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
4347 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
4349 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
4351 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
4353 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
4355 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
4357 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
4359 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
4361 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
4363 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
4365 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
4367 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
4369 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
4371 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
4373 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
4375 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
4377 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
4379 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
4381 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
4383 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
4385 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
4387 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
4389 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
4391 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
4393 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
4395 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
4397 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
4399 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
4401 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
4403 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
4405 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
4407 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
4409 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
4411 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
4413 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
4415 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
4417 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
4419 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
4421 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
4423 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
4425 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
4427 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
4429 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
4431 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
4433 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
4435 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
4437 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
4439 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
4441 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
4443 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
4445 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
4447 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
4449 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
4451 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
4453 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
4455 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
4457 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
4459 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
4461 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
4463 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
4465 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
4467 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
4469 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
4471 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
4473 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
4475 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
4477 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
4479 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
4481 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
4483 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
4485 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
4487 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
4489 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
4491 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
4493 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
4495 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
4497 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
4499 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
4501 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
4503 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
4505 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
4507 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
4509 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
4511 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
4513 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
4515 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
4517 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
4519 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
4521 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
4523 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
4525 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
4527 void Event_free(struct LDKEvent this_ptr);
4529 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
4531 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
4533 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
4535 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
4538 * Calls the free function if one is set
4540 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
4543 * Calls the free function if one is set
4545 void EventsProvider_free(struct LDKEventsProvider this_ptr);
4547 void APIError_free(struct LDKAPIError this_ptr);
4549 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
4551 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
4554 * Returns the most verbose logging level.
4556 MUST_USE_RES enum LDKLevel Level_max(void);
4559 * Calls the free function if one is set
4561 void Logger_free(struct LDKLogger this_ptr);
4563 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_ptr);
4566 * Confirmations we will wait for before considering the channel locked in.
4567 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
4568 * equivalent limit applied to outbound channels).
4572 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
4575 * Confirmations we will wait for before considering the channel locked in.
4576 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
4577 * equivalent limit applied to outbound channels).
4581 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
4584 * Set to the amount of time we require our counterparty to wait to claim their money.
4586 * It's one of the main parameter of our security model. We (or one of our watchtowers) MUST
4587 * be online to check for peer having broadcast a revoked transaction to steal our funds
4588 * at least once every our_to_self_delay blocks.
4590 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
4591 * case of an honest unilateral channel close, which implicitly decrease the economic value of
4594 * Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel
4595 * opening so you can tweak config to ask for more security, not less.
4597 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
4600 * Set to the amount of time we require our counterparty to wait to claim their money.
4602 * It's one of the main parameter of our security model. We (or one of our watchtowers) MUST
4603 * be online to check for peer having broadcast a revoked transaction to steal our funds
4604 * at least once every our_to_self_delay blocks.
4606 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
4607 * case of an honest unilateral channel close, which implicitly decrease the economic value of
4610 * Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel
4611 * opening so you can tweak config to ask for more security, not less.
4613 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
4616 * Set to the smallest value HTLC we will accept to process.
4618 * This value is sent to our counterparty on channel-open and we close the channel any time
4619 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
4621 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
4624 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
4627 * Set to the smallest value HTLC we will accept to process.
4629 * This value is sent to our counterparty on channel-open and we close the channel any time
4630 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
4632 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
4635 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
4637 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);
4639 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
4641 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
4643 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_ptr);
4646 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
4647 * only applies to inbound channels.
4651 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
4654 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
4655 * only applies to inbound channels.
4659 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
4662 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
4663 * you to limit the maximum minimum-size they can require.
4665 * Default value: u64::max_value.
4667 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
4670 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
4671 * you to limit the maximum minimum-size they can require.
4673 * Default value: u64::max_value.
4675 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
4678 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
4679 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
4683 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
4686 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
4687 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
4691 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
4694 * The remote node will require we keep a certain amount in direct payment to ourselves at all
4695 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
4696 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
4698 * Default value: u64::max_value.
4700 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
4703 * The remote node will require we keep a certain amount in direct payment to ourselves at all
4704 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
4705 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
4707 * Default value: u64::max_value.
4709 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
4712 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
4713 * time. This allows you to set a minimum such value.
4717 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
4720 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
4721 * time. This allows you to set a minimum such value.
4725 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
4728 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
4729 * required to always be higher than this value so this only applies to HTLC outputs (and
4730 * potentially to-self outputs before any payments have been made).
4731 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
4732 * This setting allows you to set a minimum dust limit for their commitment transactions,
4733 * reflecting the reality that tiny outputs are not considered standard transactions and will
4734 * not propagate through the Bitcoin network.
4736 * Default value: 546, the current dust limit on the Bitcoin network.
4738 uint64_t ChannelHandshakeLimits_get_min_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
4741 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
4742 * required to always be higher than this value so this only applies to HTLC outputs (and
4743 * potentially to-self outputs before any payments have been made).
4744 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
4745 * This setting allows you to set a minimum dust limit for their commitment transactions,
4746 * reflecting the reality that tiny outputs are not considered standard transactions and will
4747 * not propagate through the Bitcoin network.
4749 * Default value: 546, the current dust limit on the Bitcoin network.
4751 void ChannelHandshakeLimits_set_min_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
4754 * Maximum allowed threshold above which outputs will not be generated in their commitment
4756 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
4758 * Default value: u64::max_value.
4760 uint64_t ChannelHandshakeLimits_get_max_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
4763 * Maximum allowed threshold above which outputs will not be generated in their commitment
4765 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
4767 * Default value: u64::max_value.
4769 void ChannelHandshakeLimits_set_max_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
4772 * Before a channel is usable the funding transaction will need to be confirmed by at least a
4773 * certain number of blocks, specified by the node which is not the funder (as the funder can
4774 * assume they aren't going to double-spend themselves).
4775 * This config allows you to set a limit on the maximum amount of time to wait.
4777 * Default value: 144, or roughly one day and only applies to outbound channels.
4779 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
4782 * Before a channel is usable the funding transaction will need to be confirmed by at least a
4783 * certain number of blocks, specified by the node which is not the funder (as the funder can
4784 * assume they aren't going to double-spend themselves).
4785 * This config allows you to set a limit on the maximum amount of time to wait.
4787 * Default value: 144, or roughly one day and only applies to outbound channels.
4789 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
4792 * Set to force the incoming channel to match our announced channel preference in
4795 * Default value: true, to make the default that no announced channels are possible (which is
4796 * appropriate for any nodes which are not online very reliably).
4798 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
4801 * Set to force the incoming channel to match our announced channel preference in
4804 * Default value: true, to make the default that no announced channels are possible (which is
4805 * appropriate for any nodes which are not online very reliably).
4807 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
4810 * Set to the amount of time we're willing to wait to claim money back to us.
4812 * Not checking this value would be a security issue, as our peer would be able to set it to
4813 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
4815 * Default value: MAX_LOCAL_BREAKDOWN_TIMEOUT (1008), which we also enforce as a maximum value
4816 * so you can tweak config to reduce the loss of having useless locked funds (if your peer accepts)
4818 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
4821 * Set to the amount of time we're willing to wait to claim money back to us.
4823 * Not checking this value would be a security issue, as our peer would be able to set it to
4824 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
4826 * Default value: MAX_LOCAL_BREAKDOWN_TIMEOUT (1008), which we also enforce as a maximum value
4827 * so you can tweak config to reduce the loss of having useless locked funds (if your peer accepts)
4829 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
4831 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);
4833 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
4835 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
4837 void ChannelConfig_free(struct LDKChannelConfig this_ptr);
4840 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
4841 * This may be allowed to change at runtime in a later update, however doing so must result in
4842 * update messages sent to notify all nodes of our updated relay fee.
4846 uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
4849 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
4850 * This may be allowed to change at runtime in a later update, however doing so must result in
4851 * update messages sent to notify all nodes of our updated relay fee.
4855 void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
4858 * Set to announce the channel publicly and notify all nodes that they can route via this
4861 * This should only be set to true for nodes which expect to be online reliably.
4863 * As the node which funds a channel picks this value this will only apply for new outbound
4864 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
4866 * This cannot be changed after the initial channel handshake.
4868 * Default value: false.
4870 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
4873 * Set to announce the channel publicly and notify all nodes that they can route via this
4876 * This should only be set to true for nodes which expect to be online reliably.
4878 * As the node which funds a channel picks this value this will only apply for new outbound
4879 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
4881 * This cannot be changed after the initial channel handshake.
4883 * Default value: false.
4885 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
4888 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
4889 * supports it, they will then enforce the mutual-close output to us matches what we provided
4890 * at intialization, preventing us from closing to an alternate pubkey.
4892 * This is set to true by default to provide a slight increase in security, though ultimately
4893 * any attacker who is able to take control of a channel can just as easily send the funds via
4894 * lightning payments, so we never require that our counterparties support this option.
4896 * This cannot be changed after a channel has been initialized.
4898 * Default value: true.
4900 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
4903 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
4904 * supports it, they will then enforce the mutual-close output to us matches what we provided
4905 * at intialization, preventing us from closing to an alternate pubkey.
4907 * This is set to true by default to provide a slight increase in security, though ultimately
4908 * any attacker who is able to take control of a channel can just as easily send the funds via
4909 * lightning payments, so we never require that our counterparties support this option.
4911 * This cannot be changed after a channel has been initialized.
4913 * Default value: true.
4915 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
4917 MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
4919 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
4921 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
4923 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
4925 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
4927 void UserConfig_free(struct LDKUserConfig this_ptr);
4930 * Channel config that we propose to our counterparty.
4932 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
4935 * Channel config that we propose to our counterparty.
4937 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
4940 * Limits applied to our counterparty's proposed channel config settings.
4942 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
4945 * Limits applied to our counterparty's proposed channel config settings.
4947 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
4950 * Channel config which affects behavior during channel lifetime.
4952 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
4955 * Channel config which affects behavior during channel lifetime.
4957 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
4959 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);
4961 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
4963 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
4965 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
4968 * Calls the free function if one is set
4970 void Access_free(struct LDKAccess this_ptr);
4973 * Calls the free function if one is set
4975 void Watch_free(struct LDKWatch this_ptr);
4978 * Calls the free function if one is set
4980 void Filter_free(struct LDKFilter this_ptr);
4983 * Calls the free function if one is set
4985 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
4987 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
4990 * Calls the free function if one is set
4992 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
4994 void ChainMonitor_free(struct LDKChainMonitor this_ptr);
4997 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
4998 * of a channel and reacting accordingly based on transactions in the connected block. See
4999 * [`ChannelMonitor::block_connected`] for details. Any HTLCs that were resolved on chain will
5000 * be returned by [`chain::Watch::release_pending_monitor_events`].
5002 * Calls back to [`chain::Filter`] if any monitor indicated new outputs to watch. Subsequent
5003 * calls must not exclude any transactions matching the new outputs nor any in-block
5004 * descendants of such transactions. It is not necessary to re-fetch the block to obtain
5007 * [`ChannelMonitor::block_connected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_connected
5008 * [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
5009 * [`chain::Filter`]: ../trait.Filter.html
5011 void ChainMonitor_block_connected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
5014 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
5015 * of a channel based on the disconnected block. See [`ChannelMonitor::block_disconnected`] for
5018 * [`ChannelMonitor::block_disconnected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_disconnected
5020 void ChainMonitor_block_disconnected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t disconnected_height);
5023 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
5025 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
5026 * will call back to it indicating transactions and outputs of interest. This allows clients to
5027 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
5028 * always need to fetch full blocks absent another means for determining which blocks contain
5029 * transactions relevant to the watched channels.
5031 * [`chain::Filter`]: ../trait.Filter.html
5033 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
5035 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
5037 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
5039 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_ptr);
5042 * The sequence number of this update. Updates *must* be replayed in-order according to this
5043 * sequence number (and updates may panic if they are not). The update_id values are strictly
5044 * increasing and increase by one for each new update, with one exception specified below.
5046 * This sequence number is also used to track up to which points updates which returned
5047 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
5048 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
5050 * The only instance where update_id values are not strictly increasing is the case where we
5051 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
5052 * its docs for more details.
5054 * [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
5056 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
5059 * The sequence number of this update. Updates *must* be replayed in-order according to this
5060 * sequence number (and updates may panic if they are not). The update_id values are strictly
5061 * increasing and increase by one for each new update, with one exception specified below.
5063 * This sequence number is also used to track up to which points updates which returned
5064 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
5065 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
5067 * The only instance where update_id values are not strictly increasing is the case where we
5068 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
5069 * its docs for more details.
5071 * [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
5073 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
5075 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
5077 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
5079 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
5081 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
5083 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_ptr);
5085 struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
5087 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
5089 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
5091 void HTLCUpdate_free(struct LDKHTLCUpdate this_ptr);
5093 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
5095 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
5097 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
5099 void ChannelMonitor_free(struct LDKChannelMonitor this_ptr);
5101 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
5104 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
5107 * panics if the given update is not the next update by update_id.
5109 MUST_USE_RES struct LDKCResult_NoneMonitorUpdateErrorZ ChannelMonitor_update_monitor(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);
5112 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
5115 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
5118 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
5120 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
5123 * Get the list of HTLCs who's status has been updated on chain. This should be called by
5124 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
5126 * [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
5128 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(struct LDKChannelMonitor *NONNULL_PTR this_arg);
5131 * Gets the list of pending events which were generated by previous actions, clearing the list
5134 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
5135 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
5136 * no internal locking in ChannelMonitors.
5138 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(struct LDKChannelMonitor *NONNULL_PTR this_arg);
5141 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
5142 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
5143 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
5144 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
5145 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
5146 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
5147 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
5148 * out-of-band the other node operator to coordinate with him if option is available to you.
5149 * In any-case, choice is up to the user.
5151 MUST_USE_RES struct LDKCVec_TransactionZ ChannelMonitor_get_latest_holder_commitment_txn(struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger);
5154 * Processes transactions in a newly connected block, which may result in any of the following:
5155 * - update the monitor's state against resolved HTLCs
5156 * - punish the counterparty in the case of seeing a revoked commitment transaction
5157 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
5158 * - detect settled outputs for later spending
5159 * - schedule and bump any in-flight claims
5161 * Returns any new outputs to watch from `txdata`; after called, these are also included in
5162 * [`get_outputs_to_watch`].
5164 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
5166 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ChannelMonitor_block_connected(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);
5169 * Determines if the disconnected block contained any transactions of interest and updates
5172 void ChannelMonitor_block_disconnected(struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
5175 * Calls the free function if one is set
5177 void Persist_free(struct LDKPersist this_ptr);
5179 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
5181 void OutPoint_free(struct LDKOutPoint this_ptr);
5184 * The referenced transaction's txid.
5186 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
5189 * The referenced transaction's txid.
5191 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
5194 * The index of the referenced output in its transaction's vout.
5196 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
5199 * The index of the referenced output in its transaction's vout.
5201 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
5203 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
5205 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
5208 * Convert an `OutPoint` to a lightning channel id.
5210 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
5212 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
5214 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
5216 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_ptr);
5219 * The outpoint which is spendable
5221 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
5224 * The outpoint which is spendable
5226 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
5229 * Per commitment point to derive delayed_payment_key by key holder
5231 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
5234 * Per commitment point to derive delayed_payment_key by key holder
5236 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
5239 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
5240 * the witness_script.
5242 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
5245 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
5246 * the witness_script.
5248 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
5251 * The output which is referenced by the given outpoint
5253 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
5256 * The revocation point specific to the commitment transaction which was broadcast. Used to
5257 * derive the witnessScript for this output.
5259 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
5262 * The revocation point specific to the commitment transaction which was broadcast. Used to
5263 * derive the witnessScript for this output.
5265 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
5268 * Arbitrary identification information returned by a call to
5269 * `ChannelKeys::channel_keys_id()`. This may be useful in re-deriving keys used in
5270 * the channel to spend the output.
5272 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
5275 * Arbitrary identification information returned by a call to
5276 * `ChannelKeys::channel_keys_id()`. This may be useful in re-deriving keys used in
5277 * the channel to spend the output.
5279 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
5282 * The value of the channel which this output originated from, possibly indirectly.
5284 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
5287 * The value of the channel which this output originated from, possibly indirectly.
5289 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
5291 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);
5293 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
5295 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_ptr);
5298 * The outpoint which is spendable
5300 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
5303 * The outpoint which is spendable
5305 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
5308 * The output which is referenced by the given outpoint
5310 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
5313 * Arbitrary identification information returned by a call to
5314 * `ChannelKeys::channel_keys_id()`. This may be useful in re-deriving keys used in
5315 * the channel to spend the output.
5317 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
5320 * Arbitrary identification information returned by a call to
5321 * `ChannelKeys::channel_keys_id()`. This may be useful in re-deriving keys used in
5322 * the channel to spend the output.
5324 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
5327 * The value of the channel which this transactions spends.
5329 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
5332 * The value of the channel which this transactions spends.
5334 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
5336 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);
5338 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
5340 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
5342 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
5344 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
5346 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
5348 struct LDKChannelKeys ChannelKeys_clone(const struct LDKChannelKeys *NONNULL_PTR orig);
5351 * Calls the free function if one is set
5353 void ChannelKeys_free(struct LDKChannelKeys this_ptr);
5356 * Calls the free function if one is set
5358 void KeysInterface_free(struct LDKKeysInterface this_ptr);
5360 void InMemoryChannelKeys_free(struct LDKInMemoryChannelKeys this_ptr);
5363 * Private key of anchor tx
5365 const uint8_t (*InMemoryChannelKeys_get_funding_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
5368 * Private key of anchor tx
5370 void InMemoryChannelKeys_set_funding_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
5373 * Holder secret key for blinded revocation pubkey
5375 const uint8_t (*InMemoryChannelKeys_get_revocation_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
5378 * Holder secret key for blinded revocation pubkey
5380 void InMemoryChannelKeys_set_revocation_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
5383 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
5385 const uint8_t (*InMemoryChannelKeys_get_payment_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
5388 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
5390 void InMemoryChannelKeys_set_payment_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
5393 * Holder secret key used in HTLC tx
5395 const uint8_t (*InMemoryChannelKeys_get_delayed_payment_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
5398 * Holder secret key used in HTLC tx
5400 void InMemoryChannelKeys_set_delayed_payment_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
5403 * Holder htlc secret key used in commitment tx htlc outputs
5405 const uint8_t (*InMemoryChannelKeys_get_htlc_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
5408 * Holder htlc secret key used in commitment tx htlc outputs
5410 void InMemoryChannelKeys_set_htlc_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
5415 const uint8_t (*InMemoryChannelKeys_get_commitment_seed(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
5420 void InMemoryChannelKeys_set_commitment_seed(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
5422 struct LDKInMemoryChannelKeys InMemoryChannelKeys_clone(const struct LDKInMemoryChannelKeys *NONNULL_PTR orig);
5425 * Create a new InMemoryChannelKeys
5427 MUST_USE_RES struct LDKInMemoryChannelKeys InMemoryChannelKeys_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);
5430 * Counterparty pubkeys.
5431 * Will panic if ready_channel wasn't called.
5433 MUST_USE_RES struct LDKChannelPublicKeys InMemoryChannelKeys_counterparty_pubkeys(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
5436 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
5437 * transactions, ie the amount of time that we have to wait to recover our funds if we
5438 * broadcast a transaction.
5439 * Will panic if ready_channel wasn't called.
5441 MUST_USE_RES uint16_t InMemoryChannelKeys_counterparty_selected_contest_delay(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
5444 * The contest_delay value specified by us and applied on transactions broadcastable
5445 * by our counterparty, ie the amount of time that they have to wait to recover their funds
5446 * if they broadcast a transaction.
5447 * Will panic if ready_channel wasn't called.
5449 MUST_USE_RES uint16_t InMemoryChannelKeys_holder_selected_contest_delay(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
5452 * Whether the holder is the initiator
5453 * Will panic if ready_channel wasn't called.
5455 MUST_USE_RES bool InMemoryChannelKeys_is_outbound(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
5459 * Will panic if ready_channel wasn't called.
5461 MUST_USE_RES struct LDKOutPoint InMemoryChannelKeys_funding_outpoint(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
5464 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
5465 * building transactions.
5467 * Will panic if ready_channel wasn't called.
5469 MUST_USE_RES struct LDKChannelTransactionParameters InMemoryChannelKeys_get_channel_parameters(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
5472 * Sign the single input of spend_tx at index `input_idx` which spends the output
5473 * described by descriptor, returning the witness stack for the input.
5475 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
5476 * or is not spending the outpoint described by `descriptor.outpoint`.
5478 MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemoryChannelKeys_sign_counterparty_payment_input(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR descriptor);
5481 * Sign the single input of spend_tx at index `input_idx` which spends the output
5482 * described by descriptor, returning the witness stack for the input.
5484 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
5485 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
5486 * sequence set to `descriptor.to_self_delay`.
5488 MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemoryChannelKeys_sign_dynamic_p2wsh_input(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR descriptor);
5490 struct LDKChannelKeys InMemoryChannelKeys_as_ChannelKeys(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
5492 struct LDKCVec_u8Z InMemoryChannelKeys_write(const struct LDKInMemoryChannelKeys *NONNULL_PTR obj);
5494 struct LDKCResult_InMemoryChannelKeysDecodeErrorZ InMemoryChannelKeys_read(struct LDKu8slice ser);
5496 void KeysManager_free(struct LDKKeysManager this_ptr);
5499 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
5500 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
5501 * starting_time isn't strictly required to actually be a time, but it must absolutely,
5502 * without a doubt, be unique to this instance. ie if you start multiple times with the same
5503 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
5504 * simply use the current time (with very high precision).
5506 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
5507 * obviously, starting_time should be unique every time you reload the library - it is only
5508 * used to generate new ephemeral key data (which will be stored by the individual channel if
5511 * Note that the seed is required to recover certain on-chain funds independent of
5512 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
5513 * channel, and some on-chain during-closing funds.
5515 * Note that until the 0.1 release there is no guarantee of backward compatibility between
5516 * versions. Once the library is more fully supported, the docs will be updated to include a
5517 * detailed description of the guarantee.
5519 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
5522 * Derive an old set of ChannelKeys for per-channel secrets based on a key derivation
5524 * Key derivation parameters are accessible through a per-channel secrets
5525 * ChannelKeys::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
5526 * onchain output detection for which a corresponding delayed_payment_key must be derived.
5528 MUST_USE_RES struct LDKInMemoryChannelKeys KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]);
5531 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
5532 * output to the given change destination (if sufficient change value remains). The
5533 * transaction will have a feerate, at least, of the given value.
5535 * Returns `Err(())` if the output value is greater than the input value minus required fee or
5536 * if a descriptor was duplicated.
5538 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
5540 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
5541 * this KeysManager or one of the `InMemoryChannelKeys` created by this KeysManager.
5543 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);
5545 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
5547 void ChannelManager_free(struct LDKChannelManager this_ptr);
5549 void ChannelDetails_free(struct LDKChannelDetails this_ptr);
5552 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
5553 * thereafter this is the txid of the funding transaction xor the funding transaction output).
5554 * Note that this means this value is *not* persistent - it can change once during the
5555 * lifetime of the channel.
5557 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
5560 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
5561 * thereafter this is the txid of the funding transaction xor the funding transaction output).
5562 * Note that this means this value is *not* persistent - it can change once during the
5563 * lifetime of the channel.
5565 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
5568 * The node_id of our counterparty
5570 struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
5573 * The node_id of our counterparty
5575 void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
5578 * The Features the channel counterparty provided upon last connection.
5579 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
5580 * many routing-relevant features are present in the init context.
5582 struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
5585 * The Features the channel counterparty provided upon last connection.
5586 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
5587 * many routing-relevant features are present in the init context.
5589 void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
5592 * The value, in satoshis, of this channel as appears in the funding output
5594 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
5597 * The value, in satoshis, of this channel as appears in the funding output
5599 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
5602 * The user_id passed in to create_channel, or 0 if the channel was inbound.
5604 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
5607 * The user_id passed in to create_channel, or 0 if the channel was inbound.
5609 void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
5612 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
5613 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
5614 * available for inclusion in new outbound HTLCs). This further does not include any pending
5615 * outgoing HTLCs which are awaiting some other resolution to be sent.
5617 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
5620 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
5621 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
5622 * available for inclusion in new outbound HTLCs). This further does not include any pending
5623 * outgoing HTLCs which are awaiting some other resolution to be sent.
5625 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
5628 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
5629 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
5630 * available for inclusion in new inbound HTLCs).
5631 * Note that there are some corner cases not fully handled here, so the actual available
5632 * inbound capacity may be slightly higher than this.
5634 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
5637 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
5638 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
5639 * available for inclusion in new inbound HTLCs).
5640 * Note that there are some corner cases not fully handled here, so the actual available
5641 * inbound capacity may be slightly higher than this.
5643 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
5646 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
5647 * the peer is connected, and (c) no monitor update failure is pending resolution.
5649 bool ChannelDetails_get_is_live(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
5652 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
5653 * the peer is connected, and (c) no monitor update failure is pending resolution.
5655 void ChannelDetails_set_is_live(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
5657 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
5659 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
5661 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
5664 * Constructs a new ChannelManager to hold several channels and route between them.
5666 * This is the main \"logic hub\" for all channel-related actions, and implements
5667 * ChannelMessageHandler.
5669 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
5671 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
5673 * Users must provide the current blockchain height from which to track onchain channel
5674 * funding outpoints and send payments with reliable timelocks.
5676 * Users need to notify the new ChannelManager when a new block is connected or
5677 * disconnected using its `block_connected` and `block_disconnected` methods.
5679 MUST_USE_RES struct LDKChannelManager ChannelManager_new(enum LDKNetwork network, struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKKeysInterface keys_manager, struct LDKUserConfig config, uintptr_t current_blockchain_height);
5682 * Creates a new outbound channel to the given remote node and with the given value.
5684 * user_id will be provided back as user_channel_id in FundingGenerationReady and
5685 * FundingBroadcastSafe events to allow tracking of which events correspond with which
5686 * create_channel call. Note that user_channel_id defaults to 0 for inbound channels, so you
5687 * may wish to avoid using 0 for user_id here.
5689 * If successful, will generate a SendOpenChannel message event, so you should probably poll
5690 * PeerManager::process_events afterwards.
5692 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
5693 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
5695 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);
5698 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
5701 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
5704 * Gets the list of usable channels, in random order. Useful as an argument to
5705 * get_route to ensure non-announced channels are used.
5707 * These are guaranteed to have their is_live value set to true, see the documentation for
5708 * ChannelDetails::is_live for more info on exactly what the criteria are.
5710 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
5713 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
5714 * will be accepted on the given channel, and after additional timeout/the closing of all
5715 * pending HTLCs, the channel will be closed on chain.
5717 * May generate a SendShutdown message event on success, which should be relayed.
5719 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
5722 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
5723 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
5725 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
5728 * Force close all channels, immediately broadcasting the latest local commitment transaction
5729 * for each to the chain and rejecting new HTLCs on each.
5731 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
5734 * Sends a payment along a given route.
5736 * Value parameters are provided via the last hop in route, see documentation for RouteHop
5737 * fields for more info.
5739 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
5740 * payment), we don't do anything to stop you! We always try to ensure that if the provided
5741 * next hop knows the preimage to payment_hash they can claim an additional amount as
5742 * specified in the last hop in the route! Thus, you should probably do your own
5743 * payment_preimage tracking (which you should already be doing as they represent \"proof of
5744 * payment\") and prevent double-sends yourself.
5746 * May generate SendHTLCs message(s) event on success, which should be relayed.
5748 * Each path may have a different return value, and PaymentSendValue may return a Vec with
5749 * each entry matching the corresponding-index entry in the route paths, see
5750 * PaymentSendFailure for more info.
5752 * In general, a path may raise:
5753 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
5754 * node public key) is specified.
5755 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
5756 * (including due to previous monitor update failure or new permanent monitor update
5758 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
5761 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
5762 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
5763 * different route unless you intend to pay twice!
5765 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
5766 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
5767 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
5768 * must not contain multiple paths as multi-path payments require a recipient-provided
5770 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
5771 * bit set (either as required or as available). If multiple paths are present in the Route,
5772 * we assume the invoice had the basic_mpp feature set.
5774 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);
5777 * Call this upon creation of a funding transaction for the given channel.
5779 * Note that ALL inputs in the transaction pointed to by funding_txo MUST spend SegWit outputs
5780 * or your counterparty can steal your funds!
5782 * Panics if a funding transaction has already been provided for this channel.
5784 * May panic if the funding_txo is duplicative with some other channel (note that this should
5785 * be trivially prevented by using unique funding transaction keys per-channel).
5787 void ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKOutPoint funding_txo);
5790 * Generates a signed node_announcement from the given arguments and creates a
5791 * BroadcastNodeAnnouncement event. Note that such messages will be ignored unless peers have
5792 * seen a channel_announcement from us (ie unless we have public channels open).
5794 * RGB is a node \"color\" and alias is a printable human-readable string to describe this node
5795 * to humans. They carry no in-protocol meaning.
5797 * addresses represent the set (possibly empty) of socket addresses on which this node accepts
5798 * incoming connections. These will be broadcast to the network, publicly tying these
5799 * addresses together. If you wish to preserve user privacy, addresses should likely contain
5800 * only Tor Onion addresses.
5802 * Panics if addresses is absurdly large (more than 500).
5804 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
5807 * Processes HTLCs which are pending waiting on random forward delay.
5809 * Should only really ever be called in response to a PendingHTLCsForwardable event.
5810 * Will likely generate further events.
5812 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
5815 * If a peer is disconnected we mark any channels with that peer as 'disabled'.
5816 * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
5817 * to inform the network about the uselessness of these channels.
5819 * This method handles all the details, and must be called roughly once per minute.
5821 void ChannelManager_timer_chan_freshness_every_min(const struct LDKChannelManager *NONNULL_PTR this_arg);
5824 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
5825 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
5826 * along the path (including in our own channel on which we received it).
5827 * Returns false if no payment was found to fail backwards, true if the process of failing the
5828 * HTLC backwards has been started.
5830 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);
5833 * Provides a payment preimage in response to a PaymentReceived event, returning true and
5834 * generating message events for the net layer to claim the payment, if possible. Thus, you
5835 * should probably kick the net layer to go send messages if this returns true!
5837 * You must specify the expected amounts for this HTLC, and we will only claim HTLCs
5838 * available within a few percent of the expected amount. This is critical for several
5839 * reasons : a) it avoids providing senders with `proof-of-payment` (in the form of the
5840 * payment_preimage without having provided the full value and b) it avoids certain
5841 * privacy-breaking recipient-probing attacks which may reveal payment activity to
5842 * motivated attackers.
5844 * Note that the privacy concerns in (b) are not relevant in payments with a payment_secret
5845 * set. Thus, for such payments we will claim any payments which do not under-pay.
5847 * May panic if called except in response to a PaymentReceived event.
5849 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);
5852 * Gets the node_id held by this ChannelManager
5854 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
5857 * Restores a single, given channel to normal operation after a
5858 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
5861 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
5862 * fully committed in every copy of the given channels' ChannelMonitors.
5864 * Note that there is no effect to calling with a highest_applied_update_id other than the
5865 * current latest ChannelMonitorUpdate and one call to this function after multiple
5866 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
5867 * exists largely only to prevent races between this and concurrent update_monitor calls.
5869 * Thus, the anticipated use is, at a high level:
5870 * 1) You register a chain::Watch with this ChannelManager,
5871 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
5872 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
5873 * any time it cannot do so instantly,
5874 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
5875 * 4) once all remote copies are updated, you call this function with the update_id that
5876 * completed, and once it is the latest the Channel will be re-enabled.
5878 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);
5880 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
5882 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
5885 * Updates channel state based on transactions seen in a connected block.
5887 void ChannelManager_block_connected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
5890 * Updates channel state based on a disconnected block.
5892 * If necessary, the channel may be force-closed without letting the counterparty participate
5895 void ChannelManager_block_disconnected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80]);
5897 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
5899 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
5901 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_ptr);
5904 * The keys provider which will give us relevant keys. Some keys will be loaded during
5905 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
5908 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
5911 * The keys provider which will give us relevant keys. Some keys will be loaded during
5912 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
5915 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
5918 * The fee_estimator for use in the ChannelManager in the future.
5920 * No calls to the FeeEstimator will be made during deserialization.
5922 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
5925 * The fee_estimator for use in the ChannelManager in the future.
5927 * No calls to the FeeEstimator will be made during deserialization.
5929 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
5932 * The chain::Watch for use in the ChannelManager in the future.
5934 * No calls to the chain::Watch will be made during deserialization. It is assumed that
5935 * you have deserialized ChannelMonitors separately and will add them to your
5936 * chain::Watch after deserializing this ChannelManager.
5938 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
5941 * The chain::Watch for use in the ChannelManager in the future.
5943 * No calls to the chain::Watch will be made during deserialization. It is assumed that
5944 * you have deserialized ChannelMonitors separately and will add them to your
5945 * chain::Watch after deserializing this ChannelManager.
5947 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
5950 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
5951 * used to broadcast the latest local commitment transactions of channels which must be
5952 * force-closed during deserialization.
5954 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
5957 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
5958 * used to broadcast the latest local commitment transactions of channels which must be
5959 * force-closed during deserialization.
5961 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
5964 * The Logger for use in the ChannelManager and which may be used to log information during
5967 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
5970 * The Logger for use in the ChannelManager and which may be used to log information during
5973 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
5976 * Default settings used for new channels. Any existing channels will continue to use the
5977 * runtime settings which were stored when the ChannelManager was serialized.
5979 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
5982 * Default settings used for new channels. Any existing channels will continue to use the
5983 * runtime settings which were stored when the ChannelManager was serialized.
5985 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
5988 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
5989 * HashMap for you. This is primarily useful for C bindings where it is not practical to
5990 * populate a HashMap directly from C.
5992 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);
5994 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
5996 void DecodeError_free(struct LDKDecodeError this_ptr);
5998 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
6000 void Init_free(struct LDKInit this_ptr);
6002 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
6004 void ErrorMessage_free(struct LDKErrorMessage this_ptr);
6007 * The channel ID involved in the error
6009 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
6012 * The channel ID involved in the error
6014 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6017 * A possibly human-readable error description.
6018 * The string should be sanitized before it is used (e.g. emitted to logs
6019 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
6020 * vulnerability in the terminal emulator or the logging subsystem.
6022 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
6025 * A possibly human-readable error description.
6026 * The string should be sanitized before it is used (e.g. emitted to logs
6027 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
6028 * vulnerability in the terminal emulator or the logging subsystem.
6030 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
6032 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
6034 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
6036 void Ping_free(struct LDKPing this_ptr);
6039 * The desired response length
6041 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
6044 * The desired response length
6046 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
6049 * The ping packet size.
6050 * This field is not sent on the wire. byteslen zeros are sent.
6052 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
6055 * The ping packet size.
6056 * This field is not sent on the wire. byteslen zeros are sent.
6058 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
6060 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
6062 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
6064 void Pong_free(struct LDKPong this_ptr);
6067 * The pong packet size.
6068 * This field is not sent on the wire. byteslen zeros are sent.
6070 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
6073 * The pong packet size.
6074 * This field is not sent on the wire. byteslen zeros are sent.
6076 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
6078 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
6080 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
6082 void OpenChannel_free(struct LDKOpenChannel this_ptr);
6085 * The genesis hash of the blockchain where the channel is to be opened
6087 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
6090 * The genesis hash of the blockchain where the channel is to be opened
6092 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6095 * A temporary channel ID, until the funding outpoint is announced
6097 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
6100 * A temporary channel ID, until the funding outpoint is announced
6102 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6107 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
6112 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
6115 * The amount to push to the counterparty as part of the open, in milli-satoshi
6117 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
6120 * The amount to push to the counterparty as part of the open, in milli-satoshi
6122 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
6125 * The threshold below which outputs on transactions broadcast by sender will be omitted
6127 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
6130 * The threshold below which outputs on transactions broadcast by sender will be omitted
6132 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
6135 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
6137 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
6140 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
6142 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
6145 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
6147 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
6150 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
6152 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
6155 * The minimum HTLC size incoming to sender, in milli-satoshi
6157 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
6160 * The minimum HTLC size incoming to sender, in milli-satoshi
6162 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
6165 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
6167 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
6170 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
6172 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
6175 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
6177 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
6180 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
6182 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
6185 * The maximum number of inbound HTLCs towards sender
6187 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
6190 * The maximum number of inbound HTLCs towards sender
6192 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
6195 * The sender's key controlling the funding transaction
6197 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
6200 * The sender's key controlling the funding transaction
6202 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6205 * Used to derive a revocation key for transactions broadcast by counterparty
6207 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
6210 * Used to derive a revocation key for transactions broadcast by counterparty
6212 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6215 * A payment key to sender for transactions broadcast by counterparty
6217 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
6220 * A payment key to sender for transactions broadcast by counterparty
6222 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6225 * Used to derive a payment key to sender for transactions broadcast by sender
6227 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
6230 * Used to derive a payment key to sender for transactions broadcast by sender
6232 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6235 * Used to derive an HTLC payment key to sender
6237 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
6240 * Used to derive an HTLC payment key to sender
6242 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6245 * The first to-be-broadcast-by-sender transaction's per commitment point
6247 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
6250 * The first to-be-broadcast-by-sender transaction's per commitment point
6252 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6257 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
6262 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
6264 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
6266 void AcceptChannel_free(struct LDKAcceptChannel this_ptr);
6269 * A temporary channel ID, until the funding outpoint is announced
6271 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
6274 * A temporary channel ID, until the funding outpoint is announced
6276 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6279 * The threshold below which outputs on transactions broadcast by sender will be omitted
6281 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
6284 * The threshold below which outputs on transactions broadcast by sender will be omitted
6286 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
6289 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
6291 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
6294 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
6296 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
6299 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
6301 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
6304 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
6306 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
6309 * The minimum HTLC size incoming to sender, in milli-satoshi
6311 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
6314 * The minimum HTLC size incoming to sender, in milli-satoshi
6316 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
6319 * Minimum depth of the funding transaction before the channel is considered open
6321 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
6324 * Minimum depth of the funding transaction before the channel is considered open
6326 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
6329 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
6331 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
6334 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
6336 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
6339 * The maximum number of inbound HTLCs towards sender
6341 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
6344 * The maximum number of inbound HTLCs towards sender
6346 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
6349 * The sender's key controlling the funding transaction
6351 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
6354 * The sender's key controlling the funding transaction
6356 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6359 * Used to derive a revocation key for transactions broadcast by counterparty
6361 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
6364 * Used to derive a revocation key for transactions broadcast by counterparty
6366 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6369 * A payment key to sender for transactions broadcast by counterparty
6371 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
6374 * A payment key to sender for transactions broadcast by counterparty
6376 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6379 * Used to derive a payment key to sender for transactions broadcast by sender
6381 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
6384 * Used to derive a payment key to sender for transactions broadcast by sender
6386 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6389 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
6391 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
6394 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
6396 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6399 * The first to-be-broadcast-by-sender transaction's per commitment point
6401 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
6404 * The first to-be-broadcast-by-sender transaction's per commitment point
6406 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6408 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
6410 void FundingCreated_free(struct LDKFundingCreated this_ptr);
6413 * A temporary channel ID, until the funding is established
6415 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
6418 * A temporary channel ID, until the funding is established
6420 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6423 * The funding transaction ID
6425 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
6428 * The funding transaction ID
6430 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6433 * The specific output index funding this channel
6435 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
6438 * The specific output index funding this channel
6440 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
6443 * The signature of the channel initiator (funder) on the funding transaction
6445 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
6448 * The signature of the channel initiator (funder) on the funding transaction
6450 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
6452 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);
6454 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
6456 void FundingSigned_free(struct LDKFundingSigned this_ptr);
6461 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
6466 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6469 * The signature of the channel acceptor (fundee) on the funding transaction
6471 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
6474 * The signature of the channel acceptor (fundee) on the funding transaction
6476 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
6478 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
6480 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
6482 void FundingLocked_free(struct LDKFundingLocked this_ptr);
6487 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
6492 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6495 * The per-commitment point of the second commitment transaction
6497 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
6500 * The per-commitment point of the second commitment transaction
6502 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6504 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
6506 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
6508 void Shutdown_free(struct LDKShutdown this_ptr);
6513 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
6518 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6521 * The destination of this peer's funds on closing.
6522 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
6524 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
6527 * The destination of this peer's funds on closing.
6528 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
6530 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
6532 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
6534 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
6536 void ClosingSigned_free(struct LDKClosingSigned this_ptr);
6541 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
6546 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6549 * The proposed total fee for the closing transaction
6551 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
6554 * The proposed total fee for the closing transaction
6556 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
6559 * A signature on the closing transaction
6561 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
6564 * A signature on the closing transaction
6566 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
6568 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
6570 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
6572 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_ptr);
6577 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
6582 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6587 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
6592 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
6595 * The HTLC value in milli-satoshi
6597 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
6600 * The HTLC value in milli-satoshi
6602 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
6605 * The payment hash, the pre-image of which controls HTLC redemption
6607 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
6610 * The payment hash, the pre-image of which controls HTLC redemption
6612 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6615 * The expiry height of the HTLC
6617 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
6620 * The expiry height of the HTLC
6622 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
6624 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
6626 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_ptr);
6631 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
6636 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6641 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
6646 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
6649 * The pre-image of the payment hash, allowing HTLC redemption
6651 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
6654 * The pre-image of the payment hash, allowing HTLC redemption
6656 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6658 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
6660 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
6662 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_ptr);
6667 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
6672 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6677 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
6682 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
6684 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
6686 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_ptr);
6691 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
6696 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6701 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
6706 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
6711 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
6716 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
6718 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
6720 void CommitmentSigned_free(struct LDKCommitmentSigned this_ptr);
6725 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
6730 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6733 * A signature on the commitment transaction
6735 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
6738 * A signature on the commitment transaction
6740 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
6743 * Signatures on the HTLC transactions
6745 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
6747 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
6749 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
6751 void RevokeAndACK_free(struct LDKRevokeAndACK this_ptr);
6756 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
6761 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6764 * The secret corresponding to the per-commitment point
6766 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
6769 * The secret corresponding to the per-commitment point
6771 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6774 * The next sender-broadcast commitment transaction's per-commitment point
6776 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
6779 * The next sender-broadcast commitment transaction's per-commitment point
6781 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6783 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);
6785 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
6787 void UpdateFee_free(struct LDKUpdateFee this_ptr);
6792 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
6797 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6800 * Fee rate per 1000-weight of the transaction
6802 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
6805 * Fee rate per 1000-weight of the transaction
6807 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
6809 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
6811 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
6813 void DataLossProtect_free(struct LDKDataLossProtect this_ptr);
6816 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
6817 * belonging to the recipient
6819 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
6822 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
6823 * belonging to the recipient
6825 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6828 * The sender's per-commitment point for their current commitment transaction
6830 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
6833 * The sender's per-commitment point for their current commitment transaction
6835 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6837 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
6839 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
6841 void ChannelReestablish_free(struct LDKChannelReestablish this_ptr);
6846 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
6851 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6854 * The next commitment number for the sender
6856 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
6859 * The next commitment number for the sender
6861 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
6864 * The next commitment number for the recipient
6866 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
6869 * The next commitment number for the recipient
6871 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
6873 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
6875 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_ptr);
6880 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
6885 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6888 * The short channel ID
6890 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
6893 * The short channel ID
6895 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
6898 * A signature by the node key
6900 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
6903 * A signature by the node key
6905 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
6908 * A signature by the funding key
6910 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
6913 * A signature by the funding key
6915 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
6917 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);
6919 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
6921 void NetAddress_free(struct LDKNetAddress this_ptr);
6923 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
6925 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
6927 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
6929 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_ptr);
6932 * The advertised features
6934 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
6937 * The advertised features
6939 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
6942 * A strictly monotonic announcement counter, with gaps allowed
6944 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
6947 * A strictly monotonic announcement counter, with gaps allowed
6949 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
6952 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
6955 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
6958 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
6961 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6964 * An RGB color for UI purposes
6966 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
6969 * An RGB color for UI purposes
6971 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
6974 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
6977 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
6980 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
6983 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6986 * List of addresses on which this node is reachable
6988 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
6990 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
6992 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_ptr);
6995 * The signature by the node key
6997 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
7000 * The signature by the node key
7002 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
7005 * The actual content of the announcement
7007 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
7010 * The actual content of the announcement
7012 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
7014 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
7016 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
7018 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_ptr);
7021 * The advertised channel features
7023 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
7026 * The advertised channel features
7028 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
7031 * The genesis hash of the blockchain where the channel is to be opened
7033 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
7036 * The genesis hash of the blockchain where the channel is to be opened
7038 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7041 * The short channel ID
7043 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
7046 * The short channel ID
7048 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
7051 * One of the two node_ids which are endpoints of this channel
7053 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
7056 * One of the two node_ids which are endpoints of this channel
7058 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7061 * The other of the two node_ids which are endpoints of this channel
7063 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
7066 * The other of the two node_ids which are endpoints of this channel
7068 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7071 * The funding key for the first node
7073 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
7076 * The funding key for the first node
7078 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7081 * The funding key for the second node
7083 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
7086 * The funding key for the second node
7088 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7090 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
7092 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_ptr);
7095 * Authentication of the announcement by the first public node
7097 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
7100 * Authentication of the announcement by the first public node
7102 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
7105 * Authentication of the announcement by the second public node
7107 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
7110 * Authentication of the announcement by the second public node
7112 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
7115 * Proof of funding UTXO ownership by the first public node
7117 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
7120 * Proof of funding UTXO ownership by the first public node
7122 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
7125 * Proof of funding UTXO ownership by the second public node
7127 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
7130 * Proof of funding UTXO ownership by the second public node
7132 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
7135 * The actual announcement
7137 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
7140 * The actual announcement
7142 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
7144 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);
7146 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
7148 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_ptr);
7151 * The genesis hash of the blockchain where the channel is to be opened
7153 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
7156 * The genesis hash of the blockchain where the channel is to be opened
7158 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7161 * The short channel ID
7163 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
7166 * The short channel ID
7168 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
7171 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
7173 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
7176 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
7178 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
7183 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
7188 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
7191 * The number of blocks to subtract from incoming HTLC cltv_expiry values
7193 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
7196 * The number of blocks to subtract from incoming HTLC cltv_expiry values
7198 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
7201 * The minimum HTLC size incoming to sender, in milli-satoshi
7203 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
7206 * The minimum HTLC size incoming to sender, in milli-satoshi
7208 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
7211 * The base HTLC fee charged by sender, in milli-satoshi
7213 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
7216 * The base HTLC fee charged by sender, in milli-satoshi
7218 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
7221 * The amount to fee multiplier, in micro-satoshi
7223 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
7226 * The amount to fee multiplier, in micro-satoshi
7228 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
7230 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
7232 void ChannelUpdate_free(struct LDKChannelUpdate this_ptr);
7235 * A signature of the channel update
7237 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
7240 * A signature of the channel update
7242 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
7245 * The actual channel update
7247 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
7250 * The actual channel update
7252 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
7254 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
7256 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
7258 void QueryChannelRange_free(struct LDKQueryChannelRange this_ptr);
7261 * The genesis hash of the blockchain being queried
7263 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
7266 * The genesis hash of the blockchain being queried
7268 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7271 * The height of the first block for the channel UTXOs being queried
7273 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
7276 * The height of the first block for the channel UTXOs being queried
7278 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
7281 * The number of blocks to include in the query results
7283 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
7286 * The number of blocks to include in the query results
7288 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
7290 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
7292 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
7294 void ReplyChannelRange_free(struct LDKReplyChannelRange this_ptr);
7297 * The genesis hash of the blockchain being queried
7299 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
7302 * The genesis hash of the blockchain being queried
7304 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7307 * The height of the first block in the range of the reply
7309 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
7312 * The height of the first block in the range of the reply
7314 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
7317 * The number of blocks included in the range of the reply
7319 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
7322 * The number of blocks included in the range of the reply
7324 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
7327 * True when this is the final reply for a query
7329 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
7332 * True when this is the final reply for a query
7334 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
7337 * The short_channel_ids in the channel range
7339 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
7341 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);
7343 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
7345 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_ptr);
7348 * The genesis hash of the blockchain being queried
7350 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
7353 * The genesis hash of the blockchain being queried
7355 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7358 * The short_channel_ids that are being queried
7360 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
7362 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
7364 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
7366 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_ptr);
7369 * The genesis hash of the blockchain that was queried
7371 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
7374 * The genesis hash of the blockchain that was queried
7376 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7379 * Indicates if the query recipient maintains up-to-date channel
7380 * information for the chain_hash
7382 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
7385 * Indicates if the query recipient maintains up-to-date channel
7386 * information for the chain_hash
7388 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
7390 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
7392 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
7394 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_ptr);
7397 * The genesis hash of the blockchain for channel and node information
7399 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
7402 * The genesis hash of the blockchain for channel and node information
7404 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7407 * The starting unix timestamp
7409 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
7412 * The starting unix timestamp
7414 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
7417 * The range of information in seconds
7419 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
7422 * The range of information in seconds
7424 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
7426 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
7428 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
7430 void ErrorAction_free(struct LDKErrorAction this_ptr);
7432 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
7434 void LightningError_free(struct LDKLightningError this_ptr);
7437 * A human-readable message describing the error
7439 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
7442 * A human-readable message describing the error
7444 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
7447 * The action which should be taken against the offending peer.
7449 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
7452 * The action which should be taken against the offending peer.
7454 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
7456 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKCVec_u8Z err_arg, struct LDKErrorAction action_arg);
7458 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
7460 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_ptr);
7463 * update_add_htlc messages which should be sent
7465 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
7468 * update_fulfill_htlc messages which should be sent
7470 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
7473 * update_fail_htlc messages which should be sent
7475 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
7478 * update_fail_malformed_htlc messages which should be sent
7480 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
7483 * An update_fee message which should be sent
7485 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
7488 * An update_fee message which should be sent
7490 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
7493 * Finally, the commitment_signed message which should be sent
7495 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
7498 * Finally, the commitment_signed message which should be sent
7500 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
7502 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);
7504 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
7506 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
7508 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
7511 * Calls the free function if one is set
7513 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
7516 * Calls the free function if one is set
7518 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
7520 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
7522 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
7524 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
7526 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
7528 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
7530 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
7532 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
7534 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
7536 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
7538 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
7540 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
7542 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
7544 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
7546 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
7548 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
7550 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
7552 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
7554 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
7556 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
7558 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
7560 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
7562 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
7564 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
7566 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
7568 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
7570 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
7572 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
7574 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
7576 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
7578 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
7580 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
7582 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
7584 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
7586 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
7588 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
7590 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
7592 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
7594 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
7596 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
7598 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
7600 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
7602 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
7604 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
7606 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
7608 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
7610 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
7612 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
7614 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
7616 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
7618 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
7620 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
7622 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
7624 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
7626 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
7628 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
7630 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
7632 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
7634 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
7636 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
7638 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
7640 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
7642 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
7644 void MessageHandler_free(struct LDKMessageHandler this_ptr);
7647 * A message handler which handles messages specific to channels. Usually this is just a
7648 * ChannelManager object.
7650 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
7653 * A message handler which handles messages specific to channels. Usually this is just a
7654 * ChannelManager object.
7656 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
7659 * A message handler which handles messages updating our knowledge of the network channel
7660 * graph. Usually this is just a NetGraphMsgHandlerMonitor object.
7662 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
7665 * A message handler which handles messages updating our knowledge of the network channel
7666 * graph. Usually this is just a NetGraphMsgHandlerMonitor object.
7668 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
7670 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
7672 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
7675 * Calls the free function if one is set
7677 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
7679 void PeerHandleError_free(struct LDKPeerHandleError this_ptr);
7682 * Used to indicate that we probably can't make any future connections to this peer, implying
7683 * we should go ahead and force-close any channels we have with it.
7685 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
7688 * Used to indicate that we probably can't make any future connections to this peer, implying
7689 * we should go ahead and force-close any channels we have with it.
7691 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
7693 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
7695 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
7697 void PeerManager_free(struct LDKPeerManager this_ptr);
7700 * Constructs a new PeerManager with the given message handlers and node_id secret key
7701 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
7702 * cryptographically secure random bytes.
7704 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);
7707 * Get the list of node ids for peers which have completed the initial handshake.
7709 * For outbound connections, this will be the same as the their_node_id parameter passed in to
7710 * new_outbound_connection, however entries will only appear once the initial handshake has
7711 * completed and we are sure the remote peer has the private key for the given node_id.
7713 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
7716 * Indicates a new outbound connection has been established to a node with the given node_id.
7717 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
7718 * descriptor but must disconnect the connection immediately.
7720 * Returns a small number of bytes to send to the remote node (currently always 50).
7722 * Panics if descriptor is duplicative with some other descriptor which has not yet had a
7723 * socket_disconnected().
7725 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);
7728 * Indicates a new inbound connection has been established.
7730 * May refuse the connection by returning an Err, but will never write bytes to the remote end
7731 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
7732 * call socket_disconnected for the new descriptor but must disconnect the connection
7735 * Panics if descriptor is duplicative with some other descriptor which has not yet had
7736 * socket_disconnected called.
7738 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
7741 * Indicates that there is room to write data to the given socket descriptor.
7743 * May return an Err to indicate that the connection should be closed.
7745 * Will most likely call send_data on the descriptor passed in (or the descriptor handed into
7746 * new_*\\_connection) before returning. Thus, be very careful with reentrancy issues! The
7747 * invariants around calling write_buffer_space_avail in case a write did not fully complete
7748 * must still hold - be ready to call write_buffer_space_avail again if a write call generated
7749 * here isn't sufficient! Panics if the descriptor was not previously registered in a
7750 * new_\\*_connection event.
7752 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
7755 * Indicates that data was read from the given socket descriptor.
7757 * May return an Err to indicate that the connection should be closed.
7759 * Will *not* call back into send_data on any descriptors to avoid reentrancy complexity.
7760 * Thus, however, you almost certainly want to call process_events() after any read_event to
7761 * generate send_data calls to handle responses.
7763 * If Ok(true) is returned, further read_events should not be triggered until a send_data call
7764 * on this file descriptor has resume_read set (preventing DoS issues in the send buffer).
7766 * Panics if the descriptor was not previously registered in a new_*_connection event.
7768 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);
7771 * Checks for any events generated by our handlers and processes them. Includes sending most
7772 * response messages as well as messages generated by calls to handler functions directly (eg
7773 * functions like ChannelManager::process_pending_htlc_forward or send_payment).
7775 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
7778 * Indicates that the given socket descriptor's connection is now closed.
7780 * This must only be called if the socket has been disconnected by the peer or your own
7781 * decision to disconnect it and must NOT be called in any case where other parts of this
7782 * library (eg PeerHandleError, explicit disconnect_socket calls) instruct you to disconnect
7785 * Panics if the descriptor was not previously registered in a successful new_*_connection event.
7787 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
7790 * Disconnect a peer given its node id.
7792 * Set no_connection_possible to true to prevent any further connection with this peer,
7793 * force-closing any channels we have with it.
7795 * If a peer is connected, this will call `disconnect_socket` on the descriptor for the peer,
7796 * so be careful about reentrancy issues.
7798 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
7801 * This function should be called roughly once every 30 seconds.
7802 * It will send pings to each peer and disconnect those which did not respond to the last round of pings.
7803 * Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues!
7805 void PeerManager_timer_tick_occured(const struct LDKPeerManager *NONNULL_PTR this_arg);
7808 * Build the commitment secret from the seed and the commitment number
7810 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
7813 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
7814 * from the base secret and the per_commitment_point.
7816 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
7817 * generated (ie our own).
7819 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
7822 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
7823 * from the base point and the per_commitment_key. This is the public equivalent of
7824 * derive_private_key - using only public keys to derive a public key instead of private keys.
7826 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
7827 * generated (ie our own).
7829 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
7832 * Derives a per-commitment-transaction revocation key from its constituent parts.
7834 * Only the cheating participant owns a valid witness to propagate a revoked
7835 * commitment transaction, thus per_commitment_secret always come from cheater
7836 * and revocation_base_secret always come from punisher, which is the broadcaster
7837 * of the transaction spending with this key knowledge.
7839 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
7840 * generated (ie our own).
7842 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
7845 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
7846 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
7847 * public key instead of private keys.
7849 * Only the cheating participant owns a valid witness to propagate a revoked
7850 * commitment transaction, thus per_commitment_point always come from cheater
7851 * and revocation_base_point always come from punisher, which is the broadcaster
7852 * of the transaction spending with this key knowledge.
7854 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
7855 * generated (ie our own).
7857 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
7859 void TxCreationKeys_free(struct LDKTxCreationKeys this_ptr);
7862 * The broadcaster's per-commitment public key which was used to derive the other keys.
7864 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
7867 * The broadcaster's per-commitment public key which was used to derive the other keys.
7869 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7872 * The revocation key which is used to allow the broadcaster of the commitment
7873 * transaction to provide their counterparty the ability to punish them if they broadcast
7876 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
7879 * The revocation key which is used to allow the broadcaster of the commitment
7880 * transaction to provide their counterparty the ability to punish them if they broadcast
7883 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7886 * Broadcaster's HTLC Key
7888 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
7891 * Broadcaster's HTLC Key
7893 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7896 * Countersignatory's HTLC Key
7898 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
7901 * Countersignatory's HTLC Key
7903 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7906 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
7908 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
7911 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
7913 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7915 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);
7917 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
7919 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
7921 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
7923 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_ptr);
7926 * The public key which is used to sign all commitment transactions, as it appears in the
7927 * on-chain channel lock-in 2-of-2 multisig output.
7929 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
7932 * The public key which is used to sign all commitment transactions, as it appears in the
7933 * on-chain channel lock-in 2-of-2 multisig output.
7935 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7938 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
7939 * revocation keys. This is combined with the per-commitment-secret generated by the
7940 * counterparty to create a secret which the counterparty can reveal to revoke previous
7943 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
7946 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
7947 * revocation keys. This is combined with the per-commitment-secret generated by the
7948 * counterparty to create a secret which the counterparty can reveal to revoke previous
7951 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7954 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
7955 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
7956 * static across every commitment transaction.
7958 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
7961 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
7962 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
7963 * static across every commitment transaction.
7965 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7968 * The base point which is used (with derive_public_key) to derive a per-commitment payment
7969 * public key which receives non-HTLC-encumbered funds which are only available for spending
7970 * after some delay (or can be claimed via the revocation path).
7972 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
7975 * The base point which is used (with derive_public_key) to derive a per-commitment payment
7976 * public key which receives non-HTLC-encumbered funds which are only available for spending
7977 * after some delay (or can be claimed via the revocation path).
7979 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7982 * The base point which is used (with derive_public_key) to derive a per-commitment public key
7983 * which is used to encumber HTLC-in-flight outputs.
7985 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
7988 * The base point which is used (with derive_public_key) to derive a per-commitment public key
7989 * which is used to encumber HTLC-in-flight outputs.
7991 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7993 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);
7995 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
7997 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
7999 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
8002 * Create per-state keys from channel base points and the per-commitment point.
8003 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
8005 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);
8008 * Generate per-state keys from channel static keys.
8009 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
8011 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);
8014 * A script either spendable by the revocation
8015 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
8016 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
8018 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
8020 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_ptr);
8023 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
8024 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
8025 * need to compare this value to whether the commitment transaction in question is that of
8026 * the counterparty or our own.
8028 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
8031 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
8032 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
8033 * need to compare this value to whether the commitment transaction in question is that of
8034 * the counterparty or our own.
8036 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
8039 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
8040 * this divided by 1000.
8042 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
8045 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
8046 * this divided by 1000.
8048 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
8051 * The CLTV lock-time at which this HTLC expires.
8053 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
8056 * The CLTV lock-time at which this HTLC expires.
8058 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
8061 * The hash of the preimage which unlocks this HTLC.
8063 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
8066 * The hash of the preimage which unlocks this HTLC.
8068 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8070 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
8072 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
8074 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
8077 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
8078 * does not need to have its previous_output_index filled.
8080 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
8083 * Gets the redeemscript for a funding output from the two funding public keys.
8084 * Note that the order of funding public keys does not matter.
8086 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
8089 * panics if htlc.transaction_output_index.is_none()!
8091 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);
8093 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_ptr);
8096 * Holder public keys
8098 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
8101 * Holder public keys
8103 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
8106 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
8108 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
8111 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
8113 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
8116 * Whether the holder is the initiator of this channel.
8117 * This is an input to the commitment number obscure factor computation.
8119 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
8122 * Whether the holder is the initiator of this channel.
8123 * This is an input to the commitment number obscure factor computation.
8125 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
8128 * The late-bound counterparty channel transaction parameters.
8129 * These parameters are populated at the point in the protocol where the counterparty provides them.
8131 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
8134 * The late-bound counterparty channel transaction parameters.
8135 * These parameters are populated at the point in the protocol where the counterparty provides them.
8137 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
8140 * The late-bound funding outpoint
8142 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
8145 * The late-bound funding outpoint
8147 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
8149 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);
8151 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
8153 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_ptr);
8156 * Counter-party public keys
8158 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
8161 * Counter-party public keys
8163 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
8166 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
8168 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
8171 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
8173 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
8175 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
8177 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
8180 * Whether the late bound parameters are populated.
8182 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
8185 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
8186 * given that the holder is the broadcaster.
8188 * self.is_populated() must be true before calling this function.
8190 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
8193 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
8194 * given that the counterparty is the broadcaster.
8196 * self.is_populated() must be true before calling this function.
8198 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
8200 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
8202 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
8204 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
8206 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
8208 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_ptr);
8211 * Get the channel pubkeys for the broadcaster
8213 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
8216 * Get the channel pubkeys for the countersignatory
8218 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
8221 * Get the contest delay applicable to the transactions.
8222 * Note that the contest delay was selected by the countersignatory.
8224 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
8227 * Whether the channel is outbound from the broadcaster.
8229 * The boolean representing the side that initiated the channel is
8230 * an input to the commitment number obscure factor computation.
8232 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
8235 * The funding outpoint
8237 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
8239 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_ptr);
8242 * Our counterparty's signature for the transaction
8244 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
8247 * Our counterparty's signature for the transaction
8249 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
8252 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
8254 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
8256 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
8258 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
8260 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
8263 * Create a new holder transaction with the given counterparty signatures.
8264 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
8266 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);
8268 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_ptr);
8271 * The commitment transaction
8273 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
8276 * The commitment transaction
8278 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
8281 * The txid for the commitment transaction.
8283 * This is provided as a performance optimization, instead of calling transaction.txid()
8286 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
8289 * The txid for the commitment transaction.
8291 * This is provided as a performance optimization, instead of calling transaction.txid()
8294 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8296 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
8298 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
8300 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
8302 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
8305 * Get the SIGHASH_ALL sighash value of the transaction.
8307 * This can be used to verify a signature.
8309 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);
8312 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
8313 * because we are about to broadcast a holder transaction.
8315 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);
8317 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_ptr);
8319 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
8321 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
8323 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
8326 * The backwards-counting commitment number
8328 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
8331 * The value to be sent to the broadcaster
8333 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
8336 * The value to be sent to the counterparty
8338 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
8341 * The feerate paid per 1000-weight-unit in this commitment transaction.
8343 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
8346 * Trust our pre-built transaction and derived transaction creation public keys.
8348 * Applies a wrapper which allows access to these fields.
8350 * This should only be used if you fully trust the builder of this object. It should not
8351 *\tbe used by an external signer - instead use the verify function.
8353 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
8356 * Verify our pre-built transaction and derived transaction creation public keys.
8358 * Applies a wrapper which allows access to these fields.
8360 * An external validating signer must call this method before signing
8361 * or using the built transaction.
8363 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);
8365 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_ptr);
8368 * The transaction ID of the built Bitcoin transaction
8370 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
8373 * The pre-built Bitcoin commitment transaction
8375 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
8378 * The pre-calculated transaction creation public keys.
8380 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
8383 * Get a signature for each HTLC which was included in the commitment transaction (ie for
8384 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
8386 * The returned Vec has one entry for each HTLC, and in the same order.
8388 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);
8391 * Get the transaction number obscure factor
8393 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
8395 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
8397 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
8399 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
8401 void InitFeatures_free(struct LDKInitFeatures this_ptr);
8403 void NodeFeatures_free(struct LDKNodeFeatures this_ptr);
8405 void ChannelFeatures_free(struct LDKChannelFeatures this_ptr);
8408 * Create a blank Features with no features set
8410 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
8413 * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
8415 * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
8417 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
8420 * Create a blank Features with no features set
8422 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
8425 * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
8427 * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
8429 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
8432 * Create a blank Features with no features set
8434 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
8437 * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
8439 * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
8441 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
8443 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
8445 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
8447 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
8449 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
8451 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
8453 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
8455 void RouteHop_free(struct LDKRouteHop this_ptr);
8458 * The node_id of the node at this hop.
8460 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
8463 * The node_id of the node at this hop.
8465 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8468 * The node_announcement features of the node at this hop. For the last hop, these may be
8469 * amended to match the features present in the invoice this node generated.
8471 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
8474 * The node_announcement features of the node at this hop. For the last hop, these may be
8475 * amended to match the features present in the invoice this node generated.
8477 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
8480 * The channel that should be used from the previous hop to reach this node.
8482 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
8485 * The channel that should be used from the previous hop to reach this node.
8487 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
8490 * The channel_announcement features of the channel that should be used from the previous hop
8491 * to reach this node.
8493 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
8496 * The channel_announcement features of the channel that should be used from the previous hop
8497 * to reach this node.
8499 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
8502 * The fee taken on this hop. For the last hop, this should be the full value of the payment.
8504 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
8507 * The fee taken on this hop. For the last hop, this should be the full value of the payment.
8509 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
8512 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
8513 * expected at the destination, in excess of the current block height.
8515 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
8518 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
8519 * expected at the destination, in excess of the current block height.
8521 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
8523 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);
8525 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
8527 void Route_free(struct LDKRoute this_ptr);
8530 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
8531 * last RouteHop in each path must be the same.
8532 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
8533 * destination. Thus, this must always be at least length one. While the maximum length of any
8534 * given path is variable, keeping the length of any path to less than 20 should currently
8535 * ensure it is viable.
8537 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
8539 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
8541 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
8543 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
8545 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
8547 void RouteHint_free(struct LDKRouteHint this_ptr);
8550 * The node_id of the non-target end of the route
8552 struct LDKPublicKey RouteHint_get_src_node_id(const struct LDKRouteHint *NONNULL_PTR this_ptr);
8555 * The node_id of the non-target end of the route
8557 void RouteHint_set_src_node_id(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8560 * The short_channel_id of this channel
8562 uint64_t RouteHint_get_short_channel_id(const struct LDKRouteHint *NONNULL_PTR this_ptr);
8565 * The short_channel_id of this channel
8567 void RouteHint_set_short_channel_id(struct LDKRouteHint *NONNULL_PTR this_ptr, uint64_t val);
8570 * The fees which must be paid to use this channel
8572 struct LDKRoutingFees RouteHint_get_fees(const struct LDKRouteHint *NONNULL_PTR this_ptr);
8575 * The fees which must be paid to use this channel
8577 void RouteHint_set_fees(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
8580 * The difference in CLTV values between this node and the next node.
8582 uint16_t RouteHint_get_cltv_expiry_delta(const struct LDKRouteHint *NONNULL_PTR this_ptr);
8585 * The difference in CLTV values between this node and the next node.
8587 void RouteHint_set_cltv_expiry_delta(struct LDKRouteHint *NONNULL_PTR this_ptr, uint16_t val);
8590 * The minimum value, in msat, which must be relayed to the next hop.
8592 uint64_t RouteHint_get_htlc_minimum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr);
8595 * The minimum value, in msat, which must be relayed to the next hop.
8597 void RouteHint_set_htlc_minimum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, uint64_t val);
8599 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg);
8601 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
8604 * Gets a route from us to the given target node.
8606 * Extra routing hops between known nodes and the target will be used if they are included in
8609 * If some channels aren't announced, it may be useful to fill in a first_hops with the
8610 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
8611 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those in first_hops
8614 * Panics if first_hops contains channels without short_channel_ids
8615 * (ChannelManager::list_usable_channels will never include such channels).
8617 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
8618 * equal), however the enabled/disabled bit on such channels as well as the htlc_minimum_msat
8619 * *is* checked as they may change based on the receiving node.
8621 struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey target, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
8623 void NetworkGraph_free(struct LDKNetworkGraph this_ptr);
8625 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_ptr);
8627 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_ptr);
8630 * Creates a new tracker of the actual state of the network of channels and nodes,
8631 * assuming a fresh network graph.
8632 * Chain monitor is used to make sure announced channels exist on-chain,
8633 * channel data is correct, and that the announcement is signed with
8634 * channel owners' keys.
8636 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
8639 * Creates a new tracker of the actual state of the network of channels and nodes,
8640 * assuming an existing Network Graph.
8642 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
8645 * Take a read lock on the network_graph and return it in the C-bindings
8646 * newtype helper. This is likely only useful when called via the C
8647 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
8650 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
8653 * Get a reference to the NetworkGraph which this read-lock contains.
8655 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
8657 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
8659 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
8661 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_ptr);
8664 * When the last update to the channel direction was issued.
8665 * Value is opaque, as set in the announcement.
8667 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
8670 * When the last update to the channel direction was issued.
8671 * Value is opaque, as set in the announcement.
8673 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
8676 * Whether the channel can be currently used for payments (in this one direction).
8678 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
8681 * Whether the channel can be currently used for payments (in this one direction).
8683 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
8686 * The difference in CLTV values that you must have when routing through this channel.
8688 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
8691 * The difference in CLTV values that you must have when routing through this channel.
8693 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
8696 * The minimum value, which must be relayed to the next hop via the channel
8698 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
8701 * The minimum value, which must be relayed to the next hop via the channel
8703 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
8706 * Fees charged when the channel is used for routing
8708 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
8711 * Fees charged when the channel is used for routing
8713 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
8716 * Most recent update for the channel received from the network
8717 * Mostly redundant with the data we store in fields explicitly.
8718 * Everything else is useful only for sending out for initial routing sync.
8719 * Not stored if contains excess data to prevent DoS.
8721 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
8724 * Most recent update for the channel received from the network
8725 * Mostly redundant with the data we store in fields explicitly.
8726 * Everything else is useful only for sending out for initial routing sync.
8727 * Not stored if contains excess data to prevent DoS.
8729 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
8731 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
8733 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
8735 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
8737 void ChannelInfo_free(struct LDKChannelInfo this_ptr);
8740 * Protocol features of a channel communicated during its announcement
8742 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
8745 * Protocol features of a channel communicated during its announcement
8747 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
8750 * Source node of the first direction of a channel
8752 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
8755 * Source node of the first direction of a channel
8757 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8760 * Details about the first direction of a channel
8762 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
8765 * Details about the first direction of a channel
8767 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
8770 * Source node of the second direction of a channel
8772 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
8775 * Source node of the second direction of a channel
8777 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8780 * Details about the second direction of a channel
8782 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
8785 * Details about the second direction of a channel
8787 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
8790 * An initial announcement of the channel
8791 * Mostly redundant with the data we store in fields explicitly.
8792 * Everything else is useful only for sending out for initial routing sync.
8793 * Not stored if contains excess data to prevent DoS.
8795 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
8798 * An initial announcement of the channel
8799 * Mostly redundant with the data we store in fields explicitly.
8800 * Everything else is useful only for sending out for initial routing sync.
8801 * Not stored if contains excess data to prevent DoS.
8803 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
8805 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
8807 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
8809 void RoutingFees_free(struct LDKRoutingFees this_ptr);
8812 * Flat routing fee in satoshis
8814 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
8817 * Flat routing fee in satoshis
8819 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
8822 * Liquidity-based routing fee in millionths of a routed amount.
8823 * In other words, 10000 is 1%.
8825 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
8828 * Liquidity-based routing fee in millionths of a routed amount.
8829 * In other words, 10000 is 1%.
8831 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
8833 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
8835 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
8837 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
8839 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
8841 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_ptr);
8844 * Protocol features the node announced support for
8846 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
8849 * Protocol features the node announced support for
8851 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
8854 * When the last known update to the node state was issued.
8855 * Value is opaque, as set in the announcement.
8857 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
8860 * When the last known update to the node state was issued.
8861 * Value is opaque, as set in the announcement.
8863 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
8866 * Color assigned to the node
8868 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
8871 * Color assigned to the node
8873 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
8876 * Moniker assigned to the node.
8877 * May be invalid or malicious (eg control chars),
8878 * should not be exposed to the user.
8880 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
8883 * Moniker assigned to the node.
8884 * May be invalid or malicious (eg control chars),
8885 * should not be exposed to the user.
8887 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8890 * Internet-level addresses via which one can connect to the node
8892 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
8895 * An initial announcement of the node
8896 * Mostly redundant with the data we store in fields explicitly.
8897 * Everything else is useful only for sending out for initial routing sync.
8898 * Not stored if contains excess data to prevent DoS.
8900 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
8903 * An initial announcement of the node
8904 * Mostly redundant with the data we store in fields explicitly.
8905 * Everything else is useful only for sending out for initial routing sync.
8906 * Not stored if contains excess data to prevent DoS.
8908 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
8910 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);
8912 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
8914 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
8916 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
8918 void NodeInfo_free(struct LDKNodeInfo this_ptr);
8921 * All valid channels a node has announced
8923 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
8926 * Lowest fees enabling routing via any of the enabled, known channels to a node.
8927 * The two fields (flat and proportional fee) are independent,
8928 * meaning they don't have to refer to the same channel.
8930 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
8933 * Lowest fees enabling routing via any of the enabled, known channels to a node.
8934 * The two fields (flat and proportional fee) are independent,
8935 * meaning they don't have to refer to the same channel.
8937 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
8940 * More information about a node from node_announcement.
8941 * Optional because we store a Node entry after learning about it from
8942 * a channel announcement, but before receiving a node announcement.
8944 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
8947 * More information about a node from node_announcement.
8948 * Optional because we store a Node entry after learning about it from
8949 * a channel announcement, but before receiving a node announcement.
8951 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
8953 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
8955 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
8957 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
8959 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
8961 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
8963 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
8966 * Creates a new, empty, network graph.
8968 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
8971 * For an already known node (from channel announcements), update its stored properties from a
8972 * given node announcement.
8974 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
8975 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
8976 * routing messages from a source using a protocol other than the lightning P2P protocol.
8978 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
8981 * For an already known node (from channel announcements), update its stored properties from a
8982 * given node announcement without verifying the associated signatures. Because we aren't
8983 * given the associated signatures here we cannot relay the node announcement to any of our
8986 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
8989 * Store or update channel info from a channel announcement.
8991 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
8992 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
8993 * routing messages from a source using a protocol other than the lightning P2P protocol.
8995 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
8996 * the corresponding UTXO exists on chain and is correctly-formatted.
8998 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);
9001 * Store or update channel info from a channel announcement without verifying the associated
9002 * signatures. Because we aren't given the associated signatures here we cannot relay the
9003 * channel announcement to any of our peers.
9005 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
9006 * the corresponding UTXO exists on chain and is correctly-formatted.
9008 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);
9011 * Close a channel if a corresponding HTLC fail was sent.
9012 * If permanent, removes a channel from the local storage.
9013 * May cause the removal of nodes too, if this was their last channel.
9014 * If not permanent, makes channels unavailable for routing.
9016 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
9019 * For an already known (from announcement) channel, update info about one of the directions
9022 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
9023 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
9024 * routing messages from a source using a protocol other than the lightning P2P protocol.
9026 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
9029 * For an already known (from announcement) channel, update info about one of the directions
9030 * of the channel without verifying the associated signatures. Because we aren't given the
9031 * associated signatures here we cannot relay the channel update to any of our peers.
9033 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
9035 /* Text to put at the end of the generated file */