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 LDKCVecTempl_u8 {
214 typedef struct LDKCVecTempl_u8 LDKCVec_u8Z;
217 * A transaction output including a scriptPubKey and value.
218 * This type *does* own its own memory, so must be free'd appropriately.
220 typedef struct LDKTxOut {
221 LDKCVec_u8Z script_pubkey;
225 typedef struct LDKC2TupleTempl_usize__Transaction {
227 struct LDKTransaction b;
228 } LDKC2TupleTempl_usize__Transaction;
230 typedef struct LDKC2TupleTempl_usize__Transaction LDKC2Tuple_usizeTransactionZ;
232 typedef union LDKCResultPtr_u8__ChannelMonitorUpdateErr {
234 enum LDKChannelMonitorUpdateErr *err;
235 } LDKCResultPtr_u8__ChannelMonitorUpdateErr;
237 typedef struct LDKCResultTempl_u8__ChannelMonitorUpdateErr {
238 union LDKCResultPtr_u8__ChannelMonitorUpdateErr contents;
240 } LDKCResultTempl_u8__ChannelMonitorUpdateErr;
242 typedef struct LDKCResultTempl_u8__ChannelMonitorUpdateErr LDKCResult_NoneChannelMonitorUpdateErrZ;
247 * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
248 * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
249 * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
251 * Contains a developer-readable error message.
253 typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
255 * Nearly everywhere, inner must be non-null, however in places where
256 * the Rust equivalent takes an Option, it may be set to null to indicate None.
258 LDKnativeMonitorUpdateError *inner;
260 } LDKMonitorUpdateError;
262 typedef union LDKCResultPtr_u8__MonitorUpdateError {
264 struct LDKMonitorUpdateError *err;
265 } LDKCResultPtr_u8__MonitorUpdateError;
267 typedef struct LDKCResultTempl_u8__MonitorUpdateError {
268 union LDKCResultPtr_u8__MonitorUpdateError contents;
270 } LDKCResultTempl_u8__MonitorUpdateError;
272 typedef struct LDKCResultTempl_u8__MonitorUpdateError LDKCResult_NoneMonitorUpdateErrorZ;
277 * A reference to a transaction output.
279 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
280 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
282 typedef struct MUST_USE_STRUCT LDKOutPoint {
284 * Nearly everywhere, inner must be non-null, however in places where
285 * the Rust equivalent takes an Option, it may be set to null to indicate None.
287 LDKnativeOutPoint *inner;
291 typedef struct LDKC2TupleTempl_OutPoint__CVec_u8Z {
292 struct LDKOutPoint a;
294 } LDKC2TupleTempl_OutPoint__CVec_u8Z;
296 typedef struct LDKC2TupleTempl_OutPoint__CVec_u8Z LDKC2Tuple_OutPointScriptZ;
298 typedef struct LDKC2TupleTempl_u32__TxOut {
301 } LDKC2TupleTempl_u32__TxOut;
303 typedef struct LDKC2TupleTempl_u32__TxOut LDKC2Tuple_u32TxOutZ;
306 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
307 * look up the corresponding function in rust-lightning's docs.
309 typedef struct LDKThirtyTwoBytes {
313 typedef struct LDKCVecTempl_C2TupleTempl_u32__TxOut {
314 struct LDKC2TupleTempl_u32__TxOut *data;
316 } LDKCVecTempl_C2TupleTempl_u32__TxOut;
318 typedef struct LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut {
319 struct LDKThirtyTwoBytes a;
320 struct LDKCVecTempl_C2TupleTempl_u32__TxOut b;
321 } LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut;
323 typedef struct LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
325 typedef struct LDKCVecTempl_C2TupleTempl_u32__TxOut LDKCVec_C2Tuple_u32TxOutZZ;
327 typedef struct LDKC2TupleTempl_u64__u64 {
330 } LDKC2TupleTempl_u64__u64;
332 typedef struct LDKC2TupleTempl_u64__u64 LDKC2Tuple_u64u64Z;
334 typedef struct LDKSignature {
335 uint8_t compact_form[64];
338 typedef struct LDKCVecTempl_Signature {
339 struct LDKSignature *data;
341 } LDKCVecTempl_Signature;
343 typedef struct LDKC2TupleTempl_Signature__CVecTempl_Signature {
344 struct LDKSignature a;
345 struct LDKCVecTempl_Signature b;
346 } LDKC2TupleTempl_Signature__CVecTempl_Signature;
348 typedef struct LDKC2TupleTempl_Signature__CVecTempl_Signature LDKC2Tuple_SignatureCVec_SignatureZZ;
350 typedef struct LDKCVecTempl_Signature LDKCVec_SignatureZ;
352 typedef union LDKCResultPtr_C2TupleTempl_Signature__CVecTempl_Signature________u8 {
353 struct LDKC2TupleTempl_Signature__CVecTempl_Signature *result;
355 } LDKCResultPtr_C2TupleTempl_Signature__CVecTempl_Signature________u8;
357 typedef struct LDKCResultTempl_C2TupleTempl_Signature__CVecTempl_Signature________u8 {
358 union LDKCResultPtr_C2TupleTempl_Signature__CVecTempl_Signature________u8 contents;
360 } LDKCResultTempl_C2TupleTempl_Signature__CVecTempl_Signature________u8;
362 typedef struct LDKCResultTempl_C2TupleTempl_Signature__CVecTempl_Signature________u8 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
364 typedef union LDKCResultPtr_Signature__u8 {
365 struct LDKSignature *result;
367 } LDKCResultPtr_Signature__u8;
369 typedef struct LDKCResultTempl_Signature__u8 {
370 union LDKCResultPtr_Signature__u8 contents;
372 } LDKCResultTempl_Signature__u8;
374 typedef struct LDKCResultTempl_Signature__u8 LDKCResult_SignatureNoneZ;
376 typedef union LDKCResultPtr_CVecTempl_Signature_____u8 {
377 struct LDKCVecTempl_Signature *result;
379 } LDKCResultPtr_CVecTempl_Signature_____u8;
381 typedef struct LDKCResultTempl_CVecTempl_Signature_____u8 {
382 union LDKCResultPtr_CVecTempl_Signature_____u8 contents;
384 } LDKCResultTempl_CVecTempl_Signature_____u8;
386 typedef struct LDKCResultTempl_CVecTempl_Signature_____u8 LDKCResult_CVec_SignatureZNoneZ;
389 * A Rust str object, ie a reference to a UTF8-valid string.
390 * This is *not* null-terminated so cannot be used directly as a C string!
392 typedef struct LDKStr {
393 const uint8_t *chars;
398 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
401 typedef enum LDKAPIError_Tag {
403 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
404 * are documented, but generally indicates some precondition of a function was violated.
406 LDKAPIError_APIMisuseError,
408 * Due to a high feerate, we were unable to complete the request.
409 * For example, this may be returned if the feerate implies we cannot open a channel at the
410 * requested value, but opening a larger channel would succeed.
412 LDKAPIError_FeeRateTooHigh,
414 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
415 * too-many-hops, etc).
417 LDKAPIError_RouteError,
419 * We were unable to complete the request as the Channel required to do so is unable to
420 * complete the request (or was not found). This can take many forms, including disconnected
421 * peer, channel at capacity, channel shutting down, etc.
423 LDKAPIError_ChannelUnavailable,
425 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
426 * attempted action to fail.
428 LDKAPIError_MonitorUpdateFailed,
430 * Must be last for serialization purposes
432 LDKAPIError_Sentinel,
435 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
437 } LDKAPIError_LDKAPIMisuseError_Body;
439 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
442 } LDKAPIError_LDKFeeRateTooHigh_Body;
444 typedef struct LDKAPIError_LDKRouteError_Body {
446 } LDKAPIError_LDKRouteError_Body;
448 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
450 } LDKAPIError_LDKChannelUnavailable_Body;
452 typedef struct MUST_USE_STRUCT LDKAPIError {
455 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
456 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
457 LDKAPIError_LDKRouteError_Body route_error;
458 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
462 typedef union LDKCResultPtr_u8__APIError {
464 struct LDKAPIError *err;
465 } LDKCResultPtr_u8__APIError;
467 typedef struct LDKCResultTempl_u8__APIError {
468 union LDKCResultPtr_u8__APIError contents;
470 } LDKCResultTempl_u8__APIError;
472 typedef struct LDKCResultTempl_u8__APIError LDKCResult_NoneAPIErrorZ;
477 * If a payment fails to send, it can be in one of several states. This enum is returned as the
478 * Err() type describing which state the payment is in, see the description of individual enum
481 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
483 * Nearly everywhere, inner must be non-null, however in places where
484 * the Rust equivalent takes an Option, it may be set to null to indicate None.
486 LDKnativePaymentSendFailure *inner;
488 } LDKPaymentSendFailure;
490 typedef union LDKCResultPtr_u8__PaymentSendFailure {
492 struct LDKPaymentSendFailure *err;
493 } LDKCResultPtr_u8__PaymentSendFailure;
495 typedef struct LDKCResultTempl_u8__PaymentSendFailure {
496 union LDKCResultPtr_u8__PaymentSendFailure contents;
498 } LDKCResultTempl_u8__PaymentSendFailure;
500 typedef struct LDKCResultTempl_u8__PaymentSendFailure LDKCResult_NonePaymentSendFailureZ;
505 * A channel_announcement message to be sent or received from a peer
507 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
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 LDKnativeChannelAnnouncement *inner;
514 } LDKChannelAnnouncement;
519 * A channel_update message to be sent or received from a peer
521 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
523 * Nearly everywhere, inner must be non-null, however in places where
524 * the Rust equivalent takes an Option, it may be set to null to indicate None.
526 LDKnativeChannelUpdate *inner;
530 typedef struct LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate {
531 struct LDKChannelAnnouncement a;
532 struct LDKChannelUpdate b;
533 struct LDKChannelUpdate c;
534 } LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate;
536 typedef struct LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
541 * An Err type for failure to process messages.
543 typedef struct MUST_USE_STRUCT LDKLightningError {
545 * Nearly everywhere, inner must be non-null, however in places where
546 * the Rust equivalent takes an Option, it may be set to null to indicate None.
548 LDKnativeLightningError *inner;
552 typedef union LDKCResultPtr_u8__LightningError {
554 struct LDKLightningError *err;
555 } LDKCResultPtr_u8__LightningError;
557 typedef struct LDKCResultTempl_u8__LightningError {
558 union LDKCResultPtr_u8__LightningError contents;
560 } LDKCResultTempl_u8__LightningError;
562 typedef struct LDKCResultTempl_u8__LightningError LDKCResult_NoneLightningErrorZ;
567 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
568 * generate no further read_event/write_buffer_space_avail calls for the descriptor, only
569 * triggering a single socket_disconnected call (unless it was provided in response to a
570 * new_*_connection event, in which case no such socket_disconnected() must be called and the
571 * socket silently disconencted).
573 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
575 * Nearly everywhere, inner must be non-null, however in places where
576 * the Rust equivalent takes an Option, it may be set to null to indicate None.
578 LDKnativePeerHandleError *inner;
580 } LDKPeerHandleError;
582 typedef union LDKCResultPtr_u8__PeerHandleError {
584 struct LDKPeerHandleError *err;
585 } LDKCResultPtr_u8__PeerHandleError;
587 typedef struct LDKCResultTempl_u8__PeerHandleError {
588 union LDKCResultPtr_u8__PeerHandleError contents;
590 } LDKCResultTempl_u8__PeerHandleError;
592 typedef struct LDKCResultTempl_u8__PeerHandleError LDKCResult_NonePeerHandleErrorZ;
597 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
598 * transaction and the transaction creation keys) are trusted.
600 * See trust() and verify() functions on CommitmentTransaction.
602 * This structure implements Deref.
604 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
606 * Nearly everywhere, inner must be non-null, however in places where
607 * the Rust equivalent takes an Option, it may be set to null to indicate None.
609 LDKnativeTrustedCommitmentTransaction *inner;
611 } LDKTrustedCommitmentTransaction;
613 typedef union LDKCResultPtr_TrustedCommitmentTransaction__u8 {
614 struct LDKTrustedCommitmentTransaction *result;
616 } LDKCResultPtr_TrustedCommitmentTransaction__u8;
618 typedef struct LDKCResultTempl_TrustedCommitmentTransaction__u8 {
619 union LDKCResultPtr_TrustedCommitmentTransaction__u8 contents;
621 } LDKCResultTempl_TrustedCommitmentTransaction__u8;
623 typedef struct LDKCResultTempl_TrustedCommitmentTransaction__u8 LDKCResult_TrustedCommitmentTransactionNoneZ;
625 typedef struct LDKPublicKey {
626 uint8_t compressed_form[33];
630 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
631 * claim at any point in the future) an event is generated which you must track and be able to
632 * spend on-chain. The information needed to do this is provided in this enum, including the
633 * outpoint describing which txid and output index is available, the full output which exists at
634 * that txid/index, and any keys or other information required to sign.
636 typedef enum LDKSpendableOutputDescriptor_Tag {
638 * An output to a script which was provided via KeysInterface, thus you should already know
639 * how to spend it. No keys are provided as rust-lightning was never given any keys - only the
640 * script_pubkey as it appears in the output.
641 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
642 * on-chain using the payment preimage or after it has timed out.
644 LDKSpendableOutputDescriptor_StaticOutput,
646 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
648 * The witness in the spending input should be:
649 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
651 * Note that the nSequence field in the spending input must be set to to_self_delay
652 * (which means the transaction is not broadcastable until at least to_self_delay
653 * blocks after the outpoint confirms).
655 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
656 * it is an output from an old state which we broadcast (which should never happen).
658 * To derive the delayed_payment key which is used to sign for this input, you must pass the
659 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
660 * ChannelKeys::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
661 * chan_utils::derive_private_key. The public key can be generated without the secret key
662 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
663 * ChannelKeys::pubkeys().
665 * To derive the revocation_pubkey provided here (which is used in the witness
666 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
667 * call to ChannelKeys::ready_channel) and the provided per_commitment point
668 * to chan_utils::derive_public_revocation_key.
670 * The witness script which is hashed and included in the output script_pubkey may be
671 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
672 * (derived as above), and the to_self_delay contained here to
673 * chan_utils::get_revokeable_redeemscript.
675 LDKSpendableOutputDescriptor_DynamicOutputP2WSH,
677 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
678 * corresponds to the public key in ChannelKeys::pubkeys().payment_point).
679 * The witness in the spending input, is, thus, simply:
680 * <BIP 143 signature> <payment key>
682 * These are generally the result of our counterparty having broadcast the current state,
683 * allowing us to claim the non-HTLC-encumbered outputs immediately.
685 LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment,
687 * Must be last for serialization purposes
689 LDKSpendableOutputDescriptor_Sentinel,
690 } LDKSpendableOutputDescriptor_Tag;
692 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
693 struct LDKOutPoint outpoint;
694 struct LDKTxOut output;
695 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
697 typedef struct LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body {
698 struct LDKOutPoint outpoint;
699 struct LDKPublicKey per_commitment_point;
700 uint16_t to_self_delay;
701 struct LDKTxOut output;
702 LDKC2Tuple_u64u64Z key_derivation_params;
703 struct LDKPublicKey revocation_pubkey;
704 } LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body;
706 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body {
707 struct LDKOutPoint outpoint;
708 struct LDKTxOut output;
709 LDKC2Tuple_u64u64Z key_derivation_params;
710 } LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body;
712 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
713 LDKSpendableOutputDescriptor_Tag tag;
715 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
716 LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body dynamic_output_p2wsh;
717 LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body static_output_counterparty_payment;
719 } LDKSpendableOutputDescriptor;
721 typedef struct LDKCVecTempl_SpendableOutputDescriptor {
722 struct LDKSpendableOutputDescriptor *data;
724 } LDKCVecTempl_SpendableOutputDescriptor;
726 typedef struct LDKCVecTempl_SpendableOutputDescriptor LDKCVec_SpendableOutputDescriptorZ;
729 * An Event which you should probably take some action in response to.
731 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
732 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
733 * written as it makes no sense to respond to it after reconnecting to peers).
735 typedef enum LDKEvent_Tag {
737 * Used to indicate that the client should generate a funding transaction with the given
738 * parameters and then call ChannelManager::funding_transaction_generated.
739 * Generated in ChannelManager message handling.
740 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
741 * counterparty can steal your funds!
743 LDKEvent_FundingGenerationReady,
745 * Used to indicate that the client may now broadcast the funding transaction it created for a
746 * channel. Broadcasting such a transaction prior to this event may lead to our counterparty
747 * trivially stealing all funds in the funding transaction!
749 LDKEvent_FundingBroadcastSafe,
751 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
752 * ChannelManager::claim_funds to get it....
753 * Note that if the preimage is not known or the amount paid is incorrect, you should call
754 * ChannelManager::fail_htlc_backwards to free up resources for this HTLC and avoid
755 * network congestion.
756 * The amount paid should be considered 'incorrect' when it is less than or more than twice
757 * the amount expected.
758 * If you fail to call either ChannelManager::claim_funds or
759 * ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
760 * automatically failed.
762 LDKEvent_PaymentReceived,
764 * Indicates an outbound payment we made succeeded (ie it made it all the way to its target
765 * and we got back the payment preimage for it).
766 * Note that duplicative PaymentSent Events may be generated - it is your responsibility to
767 * deduplicate them by payment_preimage (which MUST be unique)!
769 LDKEvent_PaymentSent,
771 * Indicates an outbound payment we made failed. Probably some intermediary node dropped
772 * something. You may wish to retry with a different route.
773 * Note that duplicative PaymentFailed Events may be generated - it is your responsibility to
774 * deduplicate them by payment_hash (which MUST be unique)!
776 LDKEvent_PaymentFailed,
778 * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
779 * time in the future.
781 LDKEvent_PendingHTLCsForwardable,
783 * Used to indicate that an output was generated on-chain which you should know how to spend.
784 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
785 * counterparty spending them due to some kind of timeout. Thus, you need to store them
786 * somewhere and spend them when you create on-chain transactions.
788 LDKEvent_SpendableOutputs,
790 * Must be last for serialization purposes
795 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
796 struct LDKThirtyTwoBytes temporary_channel_id;
797 uint64_t channel_value_satoshis;
798 LDKCVec_u8Z output_script;
799 uint64_t user_channel_id;
800 } LDKEvent_LDKFundingGenerationReady_Body;
802 typedef struct LDKEvent_LDKFundingBroadcastSafe_Body {
803 struct LDKOutPoint funding_txo;
804 uint64_t user_channel_id;
805 } LDKEvent_LDKFundingBroadcastSafe_Body;
807 typedef struct LDKEvent_LDKPaymentReceived_Body {
808 struct LDKThirtyTwoBytes payment_hash;
809 struct LDKThirtyTwoBytes payment_secret;
811 } LDKEvent_LDKPaymentReceived_Body;
813 typedef struct LDKEvent_LDKPaymentSent_Body {
814 struct LDKThirtyTwoBytes payment_preimage;
815 } LDKEvent_LDKPaymentSent_Body;
817 typedef struct LDKEvent_LDKPaymentFailed_Body {
818 struct LDKThirtyTwoBytes payment_hash;
819 bool rejected_by_dest;
820 } LDKEvent_LDKPaymentFailed_Body;
822 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
823 uint64_t time_forwardable;
824 } LDKEvent_LDKPendingHTLCsForwardable_Body;
826 typedef struct LDKEvent_LDKSpendableOutputs_Body {
827 LDKCVec_SpendableOutputDescriptorZ outputs;
828 } LDKEvent_LDKSpendableOutputs_Body;
830 typedef struct MUST_USE_STRUCT LDKEvent {
833 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
834 LDKEvent_LDKFundingBroadcastSafe_Body funding_broadcast_safe;
835 LDKEvent_LDKPaymentReceived_Body payment_received;
836 LDKEvent_LDKPaymentSent_Body payment_sent;
837 LDKEvent_LDKPaymentFailed_Body payment_failed;
838 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
839 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
846 * An accept_channel message to be sent or received from a peer
848 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
850 * Nearly everywhere, inner must be non-null, however in places where
851 * the Rust equivalent takes an Option, it may be set to null to indicate None.
853 LDKnativeAcceptChannel *inner;
860 * An open_channel message to be sent or received from a peer
862 typedef struct MUST_USE_STRUCT LDKOpenChannel {
864 * Nearly everywhere, inner must be non-null, however in places where
865 * the Rust equivalent takes an Option, it may be set to null to indicate None.
867 LDKnativeOpenChannel *inner;
874 * A funding_created message to be sent or received from a peer
876 typedef struct MUST_USE_STRUCT LDKFundingCreated {
878 * Nearly everywhere, inner must be non-null, however in places where
879 * the Rust equivalent takes an Option, it may be set to null to indicate None.
881 LDKnativeFundingCreated *inner;
888 * A funding_signed message to be sent or received from a peer
890 typedef struct MUST_USE_STRUCT LDKFundingSigned {
892 * Nearly everywhere, inner must be non-null, however in places where
893 * the Rust equivalent takes an Option, it may be set to null to indicate None.
895 LDKnativeFundingSigned *inner;
902 * A funding_locked message to be sent or received from a peer
904 typedef struct MUST_USE_STRUCT LDKFundingLocked {
906 * Nearly everywhere, inner must be non-null, however in places where
907 * the Rust equivalent takes an Option, it may be set to null to indicate None.
909 LDKnativeFundingLocked *inner;
916 * An announcement_signatures message to be sent or received from a peer
918 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
920 * Nearly everywhere, inner must be non-null, however in places where
921 * the Rust equivalent takes an Option, it may be set to null to indicate None.
923 LDKnativeAnnouncementSignatures *inner;
925 } LDKAnnouncementSignatures;
930 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
931 * transaction updates if they were pending.
933 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
935 * Nearly everywhere, inner must be non-null, however in places where
936 * the Rust equivalent takes an Option, it may be set to null to indicate None.
938 LDKnativeCommitmentUpdate *inner;
940 } LDKCommitmentUpdate;
945 * A revoke_and_ack message to be sent or received from a peer
947 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
949 * Nearly everywhere, inner must be non-null, however in places where
950 * the Rust equivalent takes an Option, it may be set to null to indicate None.
952 LDKnativeRevokeAndACK *inner;
959 * A closing_signed message to be sent or received from a peer
961 typedef struct MUST_USE_STRUCT LDKClosingSigned {
963 * Nearly everywhere, inner must be non-null, however in places where
964 * the Rust equivalent takes an Option, it may be set to null to indicate None.
966 LDKnativeClosingSigned *inner;
973 * A shutdown message to be sent or received from a peer
975 typedef struct MUST_USE_STRUCT LDKShutdown {
977 * Nearly everywhere, inner must be non-null, however in places where
978 * the Rust equivalent takes an Option, it may be set to null to indicate None.
980 LDKnativeShutdown *inner;
987 * A channel_reestablish message to be sent or received from a peer
989 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
991 * Nearly everywhere, inner must be non-null, however in places where
992 * the Rust equivalent takes an Option, it may be set to null to indicate None.
994 LDKnativeChannelReestablish *inner;
996 } LDKChannelReestablish;
1001 * A node_announcement message to be sent or received from a peer
1003 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
1005 * Nearly everywhere, inner must be non-null, however in places where
1006 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1008 LDKnativeNodeAnnouncement *inner;
1010 } LDKNodeAnnouncement;
1015 * An error message to be sent or received from a peer
1017 typedef struct MUST_USE_STRUCT LDKErrorMessage {
1019 * Nearly everywhere, inner must be non-null, however in places where
1020 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1022 LDKnativeErrorMessage *inner;
1027 * Used to put an error message in a LightningError
1029 typedef enum LDKErrorAction_Tag {
1031 * The peer took some action which made us think they were useless. Disconnect them.
1033 LDKErrorAction_DisconnectPeer,
1035 * The peer did something harmless that we weren't able to process, just log and ignore
1037 LDKErrorAction_IgnoreError,
1039 * The peer did something incorrect. Tell them.
1041 LDKErrorAction_SendErrorMessage,
1043 * Must be last for serialization purposes
1045 LDKErrorAction_Sentinel,
1046 } LDKErrorAction_Tag;
1048 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
1049 struct LDKErrorMessage msg;
1050 } LDKErrorAction_LDKDisconnectPeer_Body;
1052 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
1053 struct LDKErrorMessage msg;
1054 } LDKErrorAction_LDKSendErrorMessage_Body;
1056 typedef struct MUST_USE_STRUCT LDKErrorAction {
1057 LDKErrorAction_Tag tag;
1059 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
1060 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
1065 * The information we received from a peer along the route of a payment we originated. This is
1066 * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
1067 * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
1069 typedef enum LDKHTLCFailChannelUpdate_Tag {
1071 * We received an error which included a full ChannelUpdate message.
1073 LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
1075 * We received an error which indicated only that a channel has been closed
1077 LDKHTLCFailChannelUpdate_ChannelClosed,
1079 * We received an error which indicated only that a node has failed
1081 LDKHTLCFailChannelUpdate_NodeFailure,
1083 * Must be last for serialization purposes
1085 LDKHTLCFailChannelUpdate_Sentinel,
1086 } LDKHTLCFailChannelUpdate_Tag;
1088 typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
1089 struct LDKChannelUpdate msg;
1090 } LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
1092 typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
1093 uint64_t short_channel_id;
1095 } LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
1097 typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
1098 struct LDKPublicKey node_id;
1100 } LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
1102 typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
1103 LDKHTLCFailChannelUpdate_Tag tag;
1105 LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
1106 LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
1107 LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
1109 } LDKHTLCFailChannelUpdate;
1114 * A query_channel_range message is used to query a peer for channel
1115 * UTXOs in a range of blocks. The recipient of a query makes a best
1116 * effort to reply to the query using one or more reply_channel_range
1119 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
1121 * Nearly everywhere, inner must be non-null, however in places where
1122 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1124 LDKnativeQueryChannelRange *inner;
1126 } LDKQueryChannelRange;
1131 * A query_short_channel_ids message is used to query a peer for
1132 * routing gossip messages related to one or more short_channel_ids.
1133 * The query recipient will reply with the latest, if available,
1134 * channel_announcement, channel_update and node_announcement messages
1135 * it maintains for the requested short_channel_ids followed by a
1136 * reply_short_channel_ids_end message. The short_channel_ids sent in
1137 * this query are encoded. We only support encoding_type=0 uncompressed
1138 * serialization and do not support encoding_type=1 zlib serialization.
1140 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
1142 * Nearly everywhere, inner must be non-null, however in places where
1143 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1145 LDKnativeQueryShortChannelIds *inner;
1147 } LDKQueryShortChannelIds;
1150 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
1151 * broadcast to most peers).
1152 * These events are handled by PeerManager::process_events if you are using a PeerManager.
1154 typedef enum LDKMessageSendEvent_Tag {
1156 * Used to indicate that we've accepted a channel open and should send the accept_channel
1157 * message provided to the given peer.
1159 LDKMessageSendEvent_SendAcceptChannel,
1161 * Used to indicate that we've initiated a channel open and should send the open_channel
1162 * message provided to the given peer.
1164 LDKMessageSendEvent_SendOpenChannel,
1166 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
1168 LDKMessageSendEvent_SendFundingCreated,
1170 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
1172 LDKMessageSendEvent_SendFundingSigned,
1174 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
1176 LDKMessageSendEvent_SendFundingLocked,
1178 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
1180 LDKMessageSendEvent_SendAnnouncementSignatures,
1182 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
1183 * message should be sent to the peer with the given node_id.
1185 LDKMessageSendEvent_UpdateHTLCs,
1187 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
1189 LDKMessageSendEvent_SendRevokeAndACK,
1191 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
1193 LDKMessageSendEvent_SendClosingSigned,
1195 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
1197 LDKMessageSendEvent_SendShutdown,
1199 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
1201 LDKMessageSendEvent_SendChannelReestablish,
1203 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
1204 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
1206 * Note that after doing so, you very likely (unless you did so very recently) want to call
1207 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
1208 * This ensures that any nodes which see our channel_announcement also have a relevant
1209 * node_announcement, including relevant feature flags which may be important for routing
1212 LDKMessageSendEvent_BroadcastChannelAnnouncement,
1214 * Used to indicate that a node_announcement should be broadcast to all peers.
1216 LDKMessageSendEvent_BroadcastNodeAnnouncement,
1218 * Used to indicate that a channel_update should be broadcast to all peers.
1220 LDKMessageSendEvent_BroadcastChannelUpdate,
1222 * Broadcast an error downstream to be handled
1224 LDKMessageSendEvent_HandleError,
1226 * When a payment fails we may receive updates back from the hop where it failed. In such
1227 * cases this event is generated so that we can inform the network graph of this information.
1229 LDKMessageSendEvent_PaymentFailureNetworkUpdate,
1231 * Query a peer for channels with funding transaction UTXOs in a block range.
1233 LDKMessageSendEvent_SendChannelRangeQuery,
1235 * Request routing gossip messages from a peer for a list of channels identified by
1236 * their short_channel_ids.
1238 LDKMessageSendEvent_SendShortIdsQuery,
1240 * Must be last for serialization purposes
1242 LDKMessageSendEvent_Sentinel,
1243 } LDKMessageSendEvent_Tag;
1245 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
1246 struct LDKPublicKey node_id;
1247 struct LDKAcceptChannel msg;
1248 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
1250 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
1251 struct LDKPublicKey node_id;
1252 struct LDKOpenChannel msg;
1253 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
1255 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
1256 struct LDKPublicKey node_id;
1257 struct LDKFundingCreated msg;
1258 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
1260 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
1261 struct LDKPublicKey node_id;
1262 struct LDKFundingSigned msg;
1263 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
1265 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
1266 struct LDKPublicKey node_id;
1267 struct LDKFundingLocked msg;
1268 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
1270 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
1271 struct LDKPublicKey node_id;
1272 struct LDKAnnouncementSignatures msg;
1273 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
1275 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
1276 struct LDKPublicKey node_id;
1277 struct LDKCommitmentUpdate updates;
1278 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
1280 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
1281 struct LDKPublicKey node_id;
1282 struct LDKRevokeAndACK msg;
1283 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
1285 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
1286 struct LDKPublicKey node_id;
1287 struct LDKClosingSigned msg;
1288 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
1290 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
1291 struct LDKPublicKey node_id;
1292 struct LDKShutdown msg;
1293 } LDKMessageSendEvent_LDKSendShutdown_Body;
1295 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
1296 struct LDKPublicKey node_id;
1297 struct LDKChannelReestablish msg;
1298 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
1300 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
1301 struct LDKChannelAnnouncement msg;
1302 struct LDKChannelUpdate update_msg;
1303 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
1305 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
1306 struct LDKNodeAnnouncement msg;
1307 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
1309 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
1310 struct LDKChannelUpdate msg;
1311 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
1313 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
1314 struct LDKPublicKey node_id;
1315 struct LDKErrorAction action;
1316 } LDKMessageSendEvent_LDKHandleError_Body;
1318 typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
1319 struct LDKHTLCFailChannelUpdate update;
1320 } LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
1322 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
1323 struct LDKPublicKey node_id;
1324 struct LDKQueryChannelRange msg;
1325 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
1327 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
1328 struct LDKPublicKey node_id;
1329 struct LDKQueryShortChannelIds msg;
1330 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
1332 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
1333 LDKMessageSendEvent_Tag tag;
1335 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
1336 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
1337 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
1338 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
1339 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
1340 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
1341 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
1342 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
1343 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
1344 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
1345 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
1346 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
1347 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
1348 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
1349 LDKMessageSendEvent_LDKHandleError_Body handle_error;
1350 LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
1351 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
1352 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
1354 } LDKMessageSendEvent;
1356 typedef struct LDKCVecTempl_MessageSendEvent {
1357 struct LDKMessageSendEvent *data;
1359 } LDKCVecTempl_MessageSendEvent;
1361 typedef struct LDKCVecTempl_MessageSendEvent LDKCVec_MessageSendEventZ;
1364 * A trait indicating an object may generate message send events
1366 typedef struct LDKMessageSendEventsProvider {
1369 * Gets the list of pending events which were generated by previous actions, clearing the list
1372 LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
1373 void (*free)(void *this_arg);
1374 } LDKMessageSendEventsProvider;
1376 typedef struct LDKCVecTempl_Event {
1377 struct LDKEvent *data;
1379 } LDKCVecTempl_Event;
1381 typedef struct LDKCVecTempl_Event LDKCVec_EventZ;
1384 * A trait indicating an object may generate events
1386 typedef struct LDKEventsProvider {
1389 * Gets the list of pending events which were generated by previous actions, clearing the list
1392 LDKCVec_EventZ (*get_and_clear_pending_events)(const void *this_arg);
1393 void (*free)(void *this_arg);
1394 } LDKEventsProvider;
1397 * A trait encapsulating the operations required of a logger
1399 typedef struct LDKLogger {
1404 void (*log)(const void *this_arg, const char *record);
1405 void (*free)(void *this_arg);
1411 * Configuration we set when applicable.
1413 * Default::default() provides sane defaults.
1415 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
1417 * Nearly everywhere, inner must be non-null, however in places where
1418 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1420 LDKnativeChannelHandshakeConfig *inner;
1422 } LDKChannelHandshakeConfig;
1427 * Optional channel limits which are applied during channel creation.
1429 * These limits are only applied to our counterparty's limits, not our own.
1431 * Use 0/<type>::max_value() as appropriate to skip checking.
1433 * Provides sane defaults for most configurations.
1435 * Most additional limits are disabled except those with which specify a default in individual
1436 * field documentation. Note that this may result in barely-usable channels, but since they
1437 * are applied mostly only to incoming channels that's not much of a problem.
1439 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
1441 * Nearly everywhere, inner must be non-null, however in places where
1442 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1444 LDKnativeChannelHandshakeLimits *inner;
1446 } LDKChannelHandshakeLimits;
1451 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
1452 * with our counterparty.
1454 typedef struct MUST_USE_STRUCT LDKChannelConfig {
1456 * Nearly everywhere, inner must be non-null, however in places where
1457 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1459 LDKnativeChannelConfig *inner;
1463 typedef struct LDKu8slice {
1464 const uint8_t *data;
1471 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
1473 * Default::default() provides sane defaults for most configurations
1474 * (but currently with 0 relay fees!)
1476 typedef struct MUST_USE_STRUCT LDKUserConfig {
1478 * Nearly everywhere, inner must be non-null, however in places where
1479 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1481 LDKnativeUserConfig *inner;
1485 typedef union LDKCResultPtr_TxOut__AccessError {
1486 struct LDKTxOut *result;
1487 enum LDKAccessError *err;
1488 } LDKCResultPtr_TxOut__AccessError;
1490 typedef struct LDKCResultTempl_TxOut__AccessError {
1491 union LDKCResultPtr_TxOut__AccessError contents;
1493 } LDKCResultTempl_TxOut__AccessError;
1495 typedef struct LDKCResultTempl_TxOut__AccessError LDKCResult_TxOutAccessErrorZ;
1498 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
1501 typedef struct LDKAccess {
1504 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
1505 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
1508 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
1510 LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
1511 void (*free)(void *this_arg);
1517 * One counterparty's public keys which do not change over the life of a channel.
1519 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
1521 * Nearly everywhere, inner must be non-null, however in places where
1522 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1524 LDKnativeChannelPublicKeys *inner;
1526 } LDKChannelPublicKeys;
1531 * This class tracks the per-transaction information needed to build a commitment transaction and to
1532 * actually build it and sign. It is used for holder transactions that we sign only when needed
1533 * and for transactions we sign for the counterparty.
1535 * This class can be used inside a signer implementation to generate a signature given the relevant
1538 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1540 * Nearly everywhere, inner must be non-null, however in places where
1541 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1543 LDKnativeCommitmentTransaction *inner;
1545 } LDKCommitmentTransaction;
1550 * Information needed to build and sign a holder's commitment transaction.
1552 * The transaction is only signed once we are ready to broadcast.
1554 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
1556 * Nearly everywhere, inner must be non-null, however in places where
1557 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1559 LDKnativeHolderCommitmentTransaction *inner;
1561 } LDKHolderCommitmentTransaction;
1566 * Information about an HTLC as it appears in a commitment transaction
1568 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
1570 * Nearly everywhere, inner must be non-null, however in places where
1571 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1573 LDKnativeHTLCOutputInCommitment *inner;
1575 } LDKHTLCOutputInCommitment;
1580 * The unsigned part of a channel_announcement
1582 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
1584 * Nearly everywhere, inner must be non-null, however in places where
1585 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1587 LDKnativeUnsignedChannelAnnouncement *inner;
1589 } LDKUnsignedChannelAnnouncement;
1594 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
1595 * The fields are organized by holder/counterparty.
1597 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
1598 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
1600 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
1602 * Nearly everywhere, inner must be non-null, however in places where
1603 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1605 LDKnativeChannelTransactionParameters *inner;
1607 } LDKChannelTransactionParameters;
1610 * Set of lightning keys needed to operate a channel as described in BOLT 3.
1612 * Signing services could be implemented on a hardware wallet. In this case,
1613 * the current ChannelKeys would be a front-end on top of a communication
1614 * channel connected to your secure device and lightning key material wouldn't
1615 * reside on a hot server. Nevertheless, a this deployment would still need
1616 * to trust the ChannelManager to avoid loss of funds as this latest component
1617 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
1619 * A more secure iteration would be to use hashlock (or payment points) to pair
1620 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
1621 * at the price of more state and computation on the hardware wallet side. In the future,
1622 * we are looking forward to design such interface.
1624 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
1625 * to act, as liveness and breach reply correctness are always going to be hard requirements
1626 * of LN security model, orthogonal of key management issues.
1628 * If you're implementing a custom signer, you almost certainly want to implement
1629 * Readable/Writable to serialize out a unique reference to this set of keys so
1630 * that you can serialize the full ChannelManager object.
1633 typedef struct LDKChannelKeys {
1636 * Gets the per-commitment point for a specific commitment number
1638 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
1640 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
1642 * Gets the commitment secret for a specific commitment number as part of the revocation process
1644 * An external signer implementation should error here if the commitment was already signed
1645 * and should refuse to sign it in the future.
1647 * May be called more than once for the same index.
1649 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
1650 * TODO: return a Result so we can signal a validation error
1652 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
1654 * Gets the holder's channel public keys and basepoints
1656 struct LDKChannelPublicKeys pubkeys;
1658 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
1659 * Note that this takes a pointer to this object, not the this_ptr like other methods do
1660 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
1662 void (*set_pubkeys)(const struct LDKChannelKeys*);
1664 * Gets arbitrary identifiers describing the set of keys which are provided back to you in
1665 * some SpendableOutputDescriptor types. These should be sufficient to identify this
1666 * ChannelKeys object uniquely and lookup or re-derive its keys.
1668 LDKC2Tuple_u64u64Z (*key_derivation_params)(const void *this_arg);
1670 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
1672 * Note that if signing fails or is rejected, the channel will be force-closed.
1674 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *commitment_tx);
1676 * Create a signature for a holder's commitment transaction. This will only ever be called with
1677 * the same commitment_tx (or a copy thereof), though there are currently no guarantees
1678 * that it will not be called multiple times.
1679 * An external signer implementation should check that the commitment has not been revoked.
1681 LDKCResult_SignatureNoneZ (*sign_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *commitment_tx);
1683 * Create a signature for each HTLC transaction spending a holder's commitment transaction.
1685 * Unlike sign_holder_commitment, this may be called multiple times with *different*
1686 * commitment_tx values. While this will never be called with a revoked
1687 * commitment_tx, it is possible that it is called with the second-latest
1688 * commitment_tx (only if we haven't yet revoked it) if some watchtower/secondary
1689 * ChannelMonitor decided to broadcast before it had been updated to the latest.
1691 * Either an Err should be returned, or a Vec with one entry for each HTLC which exists in
1694 LDKCResult_CVec_SignatureZNoneZ (*sign_holder_commitment_htlc_transactions)(const void *this_arg, const struct LDKHolderCommitmentTransaction *commitment_tx);
1696 * Create a signature for the given input in a transaction spending an HTLC or commitment
1697 * transaction output when our counterparty broadcasts an old state.
1699 * A justice transaction may claim multiples outputs at the same time if timelocks are
1700 * similar, but only a signature for the input at index `input` should be signed for here.
1701 * It may be called multiples time for same output(s) if a fee-bump is needed with regards
1702 * to an upcoming timelock expiration.
1704 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
1706 * per_commitment_key is revocation secret which was provided by our counterparty when they
1707 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
1708 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
1711 * htlc holds HTLC elements (hash, timelock) if the output being spent is a HTLC output, thus
1712 * changing the format of the witness script (which is committed to in the BIP 143
1715 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 *htlc);
1717 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
1718 * transaction, either offered or received.
1720 * Such a transaction may claim multiples offered outputs at same time if we know the
1721 * preimage for each when we create it, but only the input at index `input` should be
1722 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
1723 * needed with regards to an upcoming timelock expiration.
1725 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
1728 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
1730 * Per_commitment_point is the dynamic point corresponding to the channel state
1731 * detected onchain. It has been generated by our counterparty and is used to derive
1732 * channel state keys, which are then included in the witness script and committed to in the
1733 * BIP 143 signature.
1735 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 *htlc);
1737 * Create a signature for a (proposed) closing transaction.
1739 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
1740 * chosen to forgo their output as dust.
1742 LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
1744 * Signs a channel announcement message with our funding key, proving it comes from one
1745 * of the channel participants.
1747 * Note that if this fails or is rejected, the channel will not be publicly announced and
1748 * our counterparty may (though likely will not) close the channel on us for violating the
1751 LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *msg);
1753 * Set the counterparty static channel data, including basepoints,
1754 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
1755 * This is done as soon as the funding outpoint is known. Since these are static channel data,
1756 * they MUST NOT be allowed to change to different values once set.
1758 * channel_parameters.is_populated() MUST be true.
1760 * We bind holder_selected_contest_delay late here for API convenience.
1762 * Will be called before any signatures are applied.
1764 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *channel_parameters);
1765 void *(*clone)(const void *this_arg);
1766 LDKCVec_u8Z (*write)(const void *this_arg);
1767 void (*free)(void *this_arg);
1773 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
1774 * on-chain transactions to ensure no loss of funds occurs.
1776 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
1777 * information and are actively monitoring the chain.
1779 * Pending Events or updated HTLCs which have not yet been read out by
1780 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
1781 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
1782 * gotten are fully handled before re-serializing the new state.
1784 * Note that the deserializer is only implemented for (Sha256dHash, ChannelMonitor), which
1785 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
1786 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
1787 * returned block hash and the the current chain and then reconnecting blocks to get to the
1788 * best chain) upon deserializing the object!
1790 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
1792 * Nearly everywhere, inner must be non-null, however in places where
1793 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1795 LDKnativeChannelMonitor *inner;
1797 } LDKChannelMonitor;
1802 * An update generated by the underlying Channel itself which contains some new information the
1803 * ChannelMonitor should be made aware of.
1805 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
1807 * Nearly everywhere, inner must be non-null, however in places where
1808 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1810 LDKnativeChannelMonitorUpdate *inner;
1812 } LDKChannelMonitorUpdate;
1817 * An event to be processed by the ChannelManager.
1819 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
1821 * Nearly everywhere, inner must be non-null, however in places where
1822 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1824 LDKnativeMonitorEvent *inner;
1828 typedef struct LDKCVecTempl_MonitorEvent {
1829 struct LDKMonitorEvent *data;
1831 } LDKCVecTempl_MonitorEvent;
1833 typedef struct LDKCVecTempl_MonitorEvent LDKCVec_MonitorEventZ;
1836 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
1837 * blocks are connected and disconnected.
1839 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
1840 * responsible for maintaining a set of monitors such that they can be updated accordingly as
1841 * channel state changes and HTLCs are resolved. See method documentation for specific
1844 * Implementations **must** ensure that updates are successfully applied and persisted upon method
1845 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
1846 * without taking any further action such as persisting the current state.
1848 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
1849 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
1850 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
1851 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
1852 * multiple instances.
1854 * [`ChannelMonitor`]: channelmonitor/struct.ChannelMonitor.html
1855 * [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html
1856 * [`PermanentFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.PermanentFailure
1858 typedef struct LDKWatch {
1861 * Watches a channel identified by `funding_txo` using `monitor`.
1863 * Implementations are responsible for watching the chain for the funding transaction along
1864 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
1865 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
1867 * [`get_outputs_to_watch`]: channelmonitor/struct.ChannelMonitor.html#method.get_outputs_to_watch
1868 * [`block_connected`]: channelmonitor/struct.ChannelMonitor.html#method.block_connected
1869 * [`block_disconnected`]: channelmonitor/struct.ChannelMonitor.html#method.block_disconnected
1871 LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
1873 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
1875 * Implementations must call [`update_monitor`] with the given update. See
1876 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
1878 * [`update_monitor`]: channelmonitor/struct.ChannelMonitor.html#method.update_monitor
1879 * [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html
1881 LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
1883 * Returns any monitor events since the last call. Subsequent calls must only return new
1886 LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
1887 void (*free)(void *this_arg);
1891 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
1894 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
1895 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
1896 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
1897 * receiving full blocks from a chain source, any further filtering is unnecessary.
1899 * After an output has been registered, subsequent block retrievals from the chain source must not
1900 * exclude any transactions matching the new criteria nor any in-block descendants of such
1903 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
1904 * should not block on I/O. Implementations should instead queue the newly monitored data to be
1905 * processed later. Then, in order to block until the data has been processed, any `Watch`
1906 * invocation that has called the `Filter` must return [`TemporaryFailure`].
1908 * [`Watch`]: trait.Watch.html
1909 * [`TemporaryFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.TemporaryFailure
1910 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
1911 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
1913 typedef struct LDKFilter {
1916 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
1917 * a spending condition.
1919 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
1921 * Registers interest in spends of a transaction output identified by `outpoint` having
1922 * `script_pubkey` as the spending condition.
1924 void (*register_output)(const void *this_arg, const struct LDKOutPoint *outpoint, struct LDKu8slice script_pubkey);
1925 void (*free)(void *this_arg);
1929 * An interface to send a transaction to the Bitcoin network.
1931 typedef struct LDKBroadcasterInterface {
1934 * Sends a transaction out to (hopefully) be mined.
1936 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
1937 void (*free)(void *this_arg);
1938 } LDKBroadcasterInterface;
1941 * A trait which should be implemented to provide feerate information on a number of time
1944 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
1945 * called from inside the library in response to chain events, P2P events, or timer events).
1947 typedef struct LDKFeeEstimator {
1950 * Gets estimated satoshis of fee required per 1000 Weight-Units.
1952 * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
1953 * don't put us below 1 satoshi-per-byte).
1955 * This translates to:
1956 * * satoshis-per-byte * 250
1957 * * ceil(satoshis-per-kbyte / 4)
1959 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
1960 void (*free)(void *this_arg);
1964 * `Persist` defines behavior for persisting channel monitors: this could mean
1965 * writing once to disk, and/or uploading to one or more backup services.
1967 * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
1968 * to disk/backups. And, on every update, you **must** persist either the
1969 * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
1970 * of situations such as revoking a transaction, then crashing before this
1971 * revocation can be persisted, then unintentionally broadcasting a revoked
1972 * transaction and losing money. This is a risk because previous channel states
1973 * are toxic, so it's important that whatever channel state is persisted is
1976 typedef struct LDKPersist {
1979 * Persist a new channel's data. The data can be stored any way you want, but
1980 * the identifier provided by Rust-Lightning is the channel's outpoint (and
1981 * it is up to you to maintain a correct mapping between the outpoint and the
1982 * stored channel data). Note that you **must** persist every new monitor to
1983 * disk. See the `Persist` trait documentation for more details.
1985 * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
1986 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
1988 * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
1989 * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
1991 LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *data);
1993 * Update one channel's data. The provided `ChannelMonitor` has already
1994 * applied the given update.
1996 * Note that on every update, you **must** persist either the
1997 * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
1998 * the `Persist` trait documentation for more details.
2000 * If an implementer chooses to persist the updates only, they need to make
2001 * sure that all the updates are applied to the `ChannelMonitors` *before*
2002 * the set of channel monitors is given to the `ChannelManager`
2003 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
2004 * applying a monitor update to a monitor. If full `ChannelMonitors` are
2005 * persisted, then there is no need to persist individual updates.
2007 * Note that there could be a performance tradeoff between persisting complete
2008 * channel monitors on every update vs. persisting only updates and applying
2009 * them in batches. The size of each monitor grows `O(number of state updates)`
2010 * whereas updates are small and `O(1)`.
2012 * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
2013 * [`ChannelMonitorUpdate::write`] for writing out an update, and
2014 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
2016 * [`ChannelMonitor::update_monitor`]: struct.ChannelMonitor.html#impl-1
2017 * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
2018 * [`ChannelMonitorUpdate::write`]: struct.ChannelMonitorUpdate.html#method.write
2019 * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
2021 LDKCResult_NoneChannelMonitorUpdateErrZ (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitorUpdate *update, const struct LDKChannelMonitor *data);
2022 void (*free)(void *this_arg);
2028 * An implementation of [`chain::Watch`] for monitoring channels.
2030 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
2031 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
2032 * or used independently to monitor channels remotely. See the [module-level documentation] for
2035 * [`chain::Watch`]: ../trait.Watch.html
2036 * [`ChannelManager`]: ../../ln/channelmanager/struct.ChannelManager.html
2037 * [module-level documentation]: index.html
2039 typedef struct MUST_USE_STRUCT LDKChainMonitor {
2041 * Nearly everywhere, inner must be non-null, however in places where
2042 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2044 LDKnativeChainMonitor *inner;
2048 typedef struct LDKCVecTempl_C2TupleTempl_usize__Transaction {
2049 struct LDKC2TupleTempl_usize__Transaction *data;
2051 } LDKCVecTempl_C2TupleTempl_usize__Transaction;
2053 typedef struct LDKCVecTempl_C2TupleTempl_usize__Transaction LDKCVec_C2Tuple_usizeTransactionZZ;
2058 * An error in decoding a message or struct.
2060 typedef struct MUST_USE_STRUCT LDKDecodeError {
2062 * Nearly everywhere, inner must be non-null, however in places where
2063 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2065 LDKnativeDecodeError *inner;
2069 typedef union LDKCResultPtr_ChannelMonitorUpdate__DecodeError {
2070 struct LDKChannelMonitorUpdate *result;
2071 struct LDKDecodeError *err;
2072 } LDKCResultPtr_ChannelMonitorUpdate__DecodeError;
2074 typedef struct LDKCResultTempl_ChannelMonitorUpdate__DecodeError {
2075 union LDKCResultPtr_ChannelMonitorUpdate__DecodeError contents;
2077 } LDKCResultTempl_ChannelMonitorUpdate__DecodeError;
2079 typedef struct LDKCResultTempl_ChannelMonitorUpdate__DecodeError LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
2084 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
2085 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
2086 * preimage claim backward will lead to loss of funds.
2088 * [`chain::Watch`]: ../trait.Watch.html
2090 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
2092 * Nearly everywhere, inner must be non-null, however in places where
2093 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2095 LDKnativeHTLCUpdate *inner;
2099 typedef struct LDKCVecTempl_Transaction {
2100 struct LDKTransaction *data;
2102 } LDKCVecTempl_Transaction;
2104 typedef struct LDKCVecTempl_Transaction LDKCVec_TransactionZ;
2106 typedef struct LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut {
2107 struct LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut *data;
2109 } LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut;
2111 typedef struct LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ;
2113 typedef struct LDKSecretKey {
2117 typedef union LDKCResultPtr_ChannelKeys__DecodeError {
2118 struct LDKChannelKeys *result;
2119 struct LDKDecodeError *err;
2120 } LDKCResultPtr_ChannelKeys__DecodeError;
2122 typedef struct LDKCResultTempl_ChannelKeys__DecodeError {
2123 union LDKCResultPtr_ChannelKeys__DecodeError contents;
2125 } LDKCResultTempl_ChannelKeys__DecodeError;
2127 typedef struct LDKCResultTempl_ChannelKeys__DecodeError LDKCResult_ChanKeySignerDecodeErrorZ;
2130 * A trait to describe an object which can get user secrets and key material.
2132 typedef struct LDKKeysInterface {
2135 * Get node secret key (aka node_id or network_key)
2137 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
2139 * Get destination redeemScript to encumber static protocol exit points.
2141 LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
2143 * Get shutdown_pubkey to use as PublicKey at channel closure
2145 struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
2147 * Get a new set of ChannelKeys for per-channel secrets. These MUST be unique even if you
2148 * restarted with some stale data!
2150 struct LDKChannelKeys (*get_channel_keys)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
2152 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
2153 * onion packets and for temporary channel IDs. There is no requirement that these be
2154 * persisted anywhere, though they must be unique across restarts.
2156 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
2158 * Reads a `ChanKeySigner` for this `KeysInterface` from the given input stream.
2159 * This is only called during deserialization of other objects which contain
2160 * `ChannelKeys`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
2161 * The bytes are exactly those which `<Self::ChanKeySigner as Writeable>::write()` writes, and
2162 * contain no versioning scheme. You may wish to include your own version prefix and ensure
2163 * you've read all of the provided bytes to ensure no corruption occurred.
2165 LDKCResult_ChanKeySignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
2166 void (*free)(void *this_arg);
2172 * A simple implementation of ChannelKeys that just keeps the private keys in memory.
2174 * This implementation performs no policy checks and is insufficient by itself as
2175 * a secure external signer.
2177 typedef struct MUST_USE_STRUCT LDKInMemoryChannelKeys {
2179 * Nearly everywhere, inner must be non-null, however in places where
2180 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2182 LDKnativeInMemoryChannelKeys *inner;
2184 } LDKInMemoryChannelKeys;
2186 typedef union LDKCResultPtr_InMemoryChannelKeys__DecodeError {
2187 struct LDKInMemoryChannelKeys *result;
2188 struct LDKDecodeError *err;
2189 } LDKCResultPtr_InMemoryChannelKeys__DecodeError;
2191 typedef struct LDKCResultTempl_InMemoryChannelKeys__DecodeError {
2192 union LDKCResultPtr_InMemoryChannelKeys__DecodeError contents;
2194 } LDKCResultTempl_InMemoryChannelKeys__DecodeError;
2196 typedef struct LDKCResultTempl_InMemoryChannelKeys__DecodeError LDKCResult_InMemoryChannelKeysDecodeErrorZ;
2201 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
2202 * and derives keys from that.
2204 * Your node_id is seed/0'
2205 * ChannelMonitor closes may use seed/1'
2206 * Cooperative closes may use seed/2'
2207 * The two close keys may be needed to claim on-chain funds!
2209 typedef struct MUST_USE_STRUCT LDKKeysManager {
2211 * Nearly everywhere, inner must be non-null, however in places where
2212 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2214 LDKnativeKeysManager *inner;
2221 * Manager which keeps track of a number of channels and sends messages to the appropriate
2222 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
2224 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
2225 * to individual Channels.
2227 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
2228 * all peers during write/read (though does not modify this instance, only the instance being
2229 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
2230 * called funding_transaction_generated for outbound channels).
2232 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
2233 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
2234 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
2235 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
2236 * the serialization process). If the deserialized version is out-of-date compared to the
2237 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
2238 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
2240 * Note that the deserializer is only implemented for (Sha256dHash, ChannelManager), which
2241 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
2242 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
2243 * block_connected() to step towards your best block) upon deserialization before using the
2246 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
2247 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
2248 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
2249 * offline for a full minute. In order to track this, you must call
2250 * timer_chan_freshness_every_min roughly once per minute, though it doesn't have to be perfect.
2252 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
2253 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
2254 * essentially you should default to using a SimpleRefChannelManager, and use a
2255 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
2256 * you're using lightning-net-tokio.
2258 typedef struct MUST_USE_STRUCT LDKChannelManager {
2260 * Nearly everywhere, inner must be non-null, however in places where
2261 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2263 LDKnativeChannelManager *inner;
2265 } LDKChannelManager;
2270 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
2272 typedef struct MUST_USE_STRUCT LDKChannelDetails {
2274 * Nearly everywhere, inner must be non-null, however in places where
2275 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2277 LDKnativeChannelDetails *inner;
2279 } LDKChannelDetails;
2284 * Features used within an `init` message.
2286 typedef struct MUST_USE_STRUCT LDKInitFeatures {
2288 * Nearly everywhere, inner must be non-null, however in places where
2289 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2291 LDKnativeInitFeatures *inner;
2295 typedef struct LDKCVecTempl_ChannelDetails {
2296 struct LDKChannelDetails *data;
2298 } LDKCVecTempl_ChannelDetails;
2300 typedef struct LDKCVecTempl_ChannelDetails LDKCVec_ChannelDetailsZ;
2305 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
2306 * it can take multiple paths. Each path is composed of one or more hops through the network.
2308 typedef struct MUST_USE_STRUCT LDKRoute {
2310 * Nearly everywhere, inner must be non-null, however in places where
2311 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2313 LDKnativeRoute *inner;
2317 typedef struct LDKThreeBytes {
2321 typedef struct LDKFourBytes {
2325 typedef struct LDKSixteenBytes {
2329 typedef struct LDKTenBytes {
2334 * An address which can be used to connect to a remote peer
2336 typedef enum LDKNetAddress_Tag {
2338 * An IPv4 address/port on which the peer is listening.
2342 * An IPv6 address/port on which the peer is listening.
2346 * An old-style Tor onion address/port on which the peer is listening.
2348 LDKNetAddress_OnionV2,
2350 * A new-style Tor onion address/port on which the peer is listening.
2351 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
2352 * wrap as base32 and append \".onion\".
2354 LDKNetAddress_OnionV3,
2356 * Must be last for serialization purposes
2358 LDKNetAddress_Sentinel,
2359 } LDKNetAddress_Tag;
2361 typedef struct LDKNetAddress_LDKIPv4_Body {
2362 struct LDKFourBytes addr;
2364 } LDKNetAddress_LDKIPv4_Body;
2366 typedef struct LDKNetAddress_LDKIPv6_Body {
2367 struct LDKSixteenBytes addr;
2369 } LDKNetAddress_LDKIPv6_Body;
2371 typedef struct LDKNetAddress_LDKOnionV2_Body {
2372 struct LDKTenBytes addr;
2374 } LDKNetAddress_LDKOnionV2_Body;
2376 typedef struct LDKNetAddress_LDKOnionV3_Body {
2377 struct LDKThirtyTwoBytes ed25519_pubkey;
2381 } LDKNetAddress_LDKOnionV3_Body;
2383 typedef struct MUST_USE_STRUCT LDKNetAddress {
2384 LDKNetAddress_Tag tag;
2386 LDKNetAddress_LDKIPv4_Body i_pv4;
2387 LDKNetAddress_LDKIPv6_Body i_pv6;
2388 LDKNetAddress_LDKOnionV2_Body onion_v2;
2389 LDKNetAddress_LDKOnionV3_Body onion_v3;
2393 typedef struct LDKCVecTempl_NetAddress {
2394 struct LDKNetAddress *data;
2396 } LDKCVecTempl_NetAddress;
2398 typedef struct LDKCVecTempl_NetAddress LDKCVec_NetAddressZ;
2403 * An update_add_htlc message to be sent or received from a peer
2405 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
2407 * Nearly everywhere, inner must be non-null, however in places where
2408 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2410 LDKnativeUpdateAddHTLC *inner;
2417 * An update_fulfill_htlc message to be sent or received from a peer
2419 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
2421 * Nearly everywhere, inner must be non-null, however in places where
2422 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2424 LDKnativeUpdateFulfillHTLC *inner;
2426 } LDKUpdateFulfillHTLC;
2431 * An update_fail_htlc message to be sent or received from a peer
2433 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
2435 * Nearly everywhere, inner must be non-null, however in places where
2436 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2438 LDKnativeUpdateFailHTLC *inner;
2440 } LDKUpdateFailHTLC;
2445 * An update_fail_malformed_htlc message to be sent or received from a peer
2447 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
2449 * Nearly everywhere, inner must be non-null, however in places where
2450 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2452 LDKnativeUpdateFailMalformedHTLC *inner;
2454 } LDKUpdateFailMalformedHTLC;
2459 * A commitment_signed message to be sent or received from a peer
2461 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
2463 * Nearly everywhere, inner must be non-null, however in places where
2464 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2466 LDKnativeCommitmentSigned *inner;
2468 } LDKCommitmentSigned;
2473 * An update_fee message to be sent or received from a peer
2475 typedef struct MUST_USE_STRUCT LDKUpdateFee {
2477 * Nearly everywhere, inner must be non-null, however in places where
2478 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2480 LDKnativeUpdateFee *inner;
2487 * An init message to be sent or received from a peer
2489 typedef struct MUST_USE_STRUCT LDKInit {
2491 * Nearly everywhere, inner must be non-null, however in places where
2492 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2494 LDKnativeInit *inner;
2499 * A trait to describe an object which can receive channel messages.
2501 * Messages MAY be called in parallel when they originate from different their_node_ids, however
2502 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
2504 typedef struct LDKChannelMessageHandler {
2507 * Handle an incoming open_channel message from the given peer.
2509 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *msg);
2511 * Handle an incoming accept_channel message from the given peer.
2513 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *msg);
2515 * Handle an incoming funding_created message from the given peer.
2517 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *msg);
2519 * Handle an incoming funding_signed message from the given peer.
2521 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *msg);
2523 * Handle an incoming funding_locked message from the given peer.
2525 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *msg);
2527 * Handle an incoming shutdown message from the given peer.
2529 void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *msg);
2531 * Handle an incoming closing_signed message from the given peer.
2533 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *msg);
2535 * Handle an incoming update_add_htlc message from the given peer.
2537 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *msg);
2539 * Handle an incoming update_fulfill_htlc message from the given peer.
2541 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *msg);
2543 * Handle an incoming update_fail_htlc message from the given peer.
2545 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *msg);
2547 * Handle an incoming update_fail_malformed_htlc message from the given peer.
2549 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *msg);
2551 * Handle an incoming commitment_signed message from the given peer.
2553 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *msg);
2555 * Handle an incoming revoke_and_ack message from the given peer.
2557 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *msg);
2559 * Handle an incoming update_fee message from the given peer.
2561 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *msg);
2563 * Handle an incoming announcement_signatures message from the given peer.
2565 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *msg);
2567 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
2568 * is believed to be possible in the future (eg they're sending us messages we don't
2569 * understand or indicate they require unknown feature bits), no_connection_possible is set
2570 * and any outstanding channels should be failed.
2572 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
2574 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
2576 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *msg);
2578 * Handle an incoming channel_reestablish message from the given peer.
2580 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *msg);
2582 * Handle an incoming error message from the given peer.
2584 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *msg);
2585 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
2586 void (*free)(void *this_arg);
2587 } LDKChannelMessageHandler;
2592 * Arguments for the creation of a ChannelManager that are not deserialized.
2594 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
2596 * 1) Deserialize all stored ChannelMonitors.
2597 * 2) Deserialize the ChannelManager by filling in this struct and calling <(Sha256dHash,
2598 * ChannelManager)>::read(reader, args).
2599 * This may result in closing some Channels if the ChannelMonitor is newer than the stored
2600 * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
2601 * 3) Register all relevant ChannelMonitor outpoints with your chain watch mechanism using
2602 * ChannelMonitor::get_outputs_to_watch() and ChannelMonitor::get_funding_txo().
2603 * 4) Reconnect blocks on your ChannelMonitors.
2604 * 5) Move the ChannelMonitors into your local chain::Watch.
2605 * 6) Disconnect/connect blocks on the ChannelManager.
2607 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
2609 * Nearly everywhere, inner must be non-null, however in places where
2610 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2612 LDKnativeChannelManagerReadArgs *inner;
2614 } LDKChannelManagerReadArgs;
2616 typedef struct LDKCVecTempl_ChannelMonitor {
2617 struct LDKChannelMonitor *data;
2619 } LDKCVecTempl_ChannelMonitor;
2621 typedef struct LDKCVecTempl_ChannelMonitor LDKCVec_ChannelMonitorZ;
2626 * A ping message to be sent or received from a peer
2628 typedef struct MUST_USE_STRUCT LDKPing {
2630 * Nearly everywhere, inner must be non-null, however in places where
2631 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2633 LDKnativePing *inner;
2640 * A pong message to be sent or received from a peer
2642 typedef struct MUST_USE_STRUCT LDKPong {
2644 * Nearly everywhere, inner must be non-null, however in places where
2645 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2647 LDKnativePong *inner;
2654 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
2655 * This is used to convince the recipient that the channel is at a certain commitment
2656 * number even if they lost that data due to a local failure. Of course, the peer may lie
2657 * and even later commitments may have been revoked.
2659 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
2661 * Nearly everywhere, inner must be non-null, however in places where
2662 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2664 LDKnativeDataLossProtect *inner;
2666 } LDKDataLossProtect;
2671 * The unsigned part of a node_announcement
2673 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
2675 * Nearly everywhere, inner must be non-null, however in places where
2676 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2678 LDKnativeUnsignedNodeAnnouncement *inner;
2680 } LDKUnsignedNodeAnnouncement;
2685 * Features used within a `node_announcement` message.
2687 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
2689 * Nearly everywhere, inner must be non-null, however in places where
2690 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2692 LDKnativeNodeFeatures *inner;
2699 * Features used within a `channel_announcement` message.
2701 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
2703 * Nearly everywhere, inner must be non-null, however in places where
2704 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2706 LDKnativeChannelFeatures *inner;
2708 } LDKChannelFeatures;
2713 * The unsigned part of a channel_update
2715 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
2717 * Nearly everywhere, inner must be non-null, however in places where
2718 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2720 LDKnativeUnsignedChannelUpdate *inner;
2722 } LDKUnsignedChannelUpdate;
2727 * A reply_channel_range message is a reply to a query_channel_range
2728 * message. Multiple reply_channel_range messages can be sent in reply
2729 * to a single query_channel_range message. The query recipient makes a
2730 * best effort to respond based on their local network view which may
2731 * not be a perfect view of the network. The short_channel_ids in the
2732 * reply are encoded. We only support encoding_type=0 uncompressed
2733 * serialization and do not support encoding_type=1 zlib serialization.
2735 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
2737 * Nearly everywhere, inner must be non-null, however in places where
2738 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2740 LDKnativeReplyChannelRange *inner;
2742 } LDKReplyChannelRange;
2744 typedef struct LDKCVecTempl_u64 {
2749 typedef struct LDKCVecTempl_u64 LDKCVec_u64Z;
2754 * A reply_short_channel_ids_end message is sent as a reply to a
2755 * query_short_channel_ids message. The query recipient makes a best
2756 * effort to respond based on their local network view which may not be
2757 * a perfect view of the network.
2759 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
2761 * Nearly everywhere, inner must be non-null, however in places where
2762 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2764 LDKnativeReplyShortChannelIdsEnd *inner;
2766 } LDKReplyShortChannelIdsEnd;
2771 * A gossip_timestamp_filter message is used by a node to request
2772 * gossip relay for messages in the requested time range when the
2773 * gossip_queries feature has been negotiated.
2775 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
2777 * Nearly everywhere, inner must be non-null, however in places where
2778 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2780 LDKnativeGossipTimestampFilter *inner;
2782 } LDKGossipTimestampFilter;
2784 typedef struct LDKCVecTempl_UpdateAddHTLC {
2785 struct LDKUpdateAddHTLC *data;
2787 } LDKCVecTempl_UpdateAddHTLC;
2789 typedef struct LDKCVecTempl_UpdateAddHTLC LDKCVec_UpdateAddHTLCZ;
2791 typedef struct LDKCVecTempl_UpdateFulfillHTLC {
2792 struct LDKUpdateFulfillHTLC *data;
2794 } LDKCVecTempl_UpdateFulfillHTLC;
2796 typedef struct LDKCVecTempl_UpdateFulfillHTLC LDKCVec_UpdateFulfillHTLCZ;
2798 typedef struct LDKCVecTempl_UpdateFailHTLC {
2799 struct LDKUpdateFailHTLC *data;
2801 } LDKCVecTempl_UpdateFailHTLC;
2803 typedef struct LDKCVecTempl_UpdateFailHTLC LDKCVec_UpdateFailHTLCZ;
2805 typedef struct LDKCVecTempl_UpdateFailMalformedHTLC {
2806 struct LDKUpdateFailMalformedHTLC *data;
2808 } LDKCVecTempl_UpdateFailMalformedHTLC;
2810 typedef struct LDKCVecTempl_UpdateFailMalformedHTLC LDKCVec_UpdateFailMalformedHTLCZ;
2812 typedef union LDKCResultPtr_bool__LightningError {
2814 struct LDKLightningError *err;
2815 } LDKCResultPtr_bool__LightningError;
2817 typedef struct LDKCResultTempl_bool__LightningError {
2818 union LDKCResultPtr_bool__LightningError contents;
2820 } LDKCResultTempl_bool__LightningError;
2822 typedef struct LDKCResultTempl_bool__LightningError LDKCResult_boolLightningErrorZ;
2824 typedef struct LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate {
2825 struct LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate *data;
2827 } LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate;
2829 typedef struct LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
2831 typedef struct LDKCVecTempl_NodeAnnouncement {
2832 struct LDKNodeAnnouncement *data;
2834 } LDKCVecTempl_NodeAnnouncement;
2836 typedef struct LDKCVecTempl_NodeAnnouncement LDKCVec_NodeAnnouncementZ;
2839 * A trait to describe an object which can receive routing messages.
2841 * # Implementor DoS Warnings
2843 * For `gossip_queries` messages there are potential DoS vectors when handling
2844 * inbound queries. Implementors using an on-disk network graph should be aware of
2845 * repeated disk I/O for queries accessing different parts of the network graph.
2847 typedef struct LDKRoutingMessageHandler {
2850 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
2851 * false or returning an Err otherwise.
2853 LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *msg);
2855 * Handle a channel_announcement message, returning true if it should be forwarded on, false
2856 * or returning an Err otherwise.
2858 LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *msg);
2860 * Handle an incoming channel_update message, returning true if it should be forwarded on,
2861 * false or returning an Err otherwise.
2863 LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *msg);
2865 * Handle some updates to the route graph that we learned due to an outbound failed payment.
2867 void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *update);
2869 * Gets a subset of the channel announcements and updates required to dump our routing table
2870 * to a remote node, starting at the short_channel_id indicated by starting_point and
2871 * including the batch_amount entries immediately higher in numerical value than starting_point.
2873 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
2875 * Gets a subset of the node announcements required to dump our routing table to a remote node,
2876 * starting at the node *after* the provided publickey and including batch_amount entries
2877 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
2878 * If None is provided for starting_point, we start at the first node.
2880 LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
2882 * Called when a connection is established with a peer. This can be used to
2883 * perform routing table synchronization using a strategy defined by the
2886 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *init);
2888 * Handles the reply of a query we initiated to learn about channels
2889 * for a given range of blocks. We can expect to receive one or more
2890 * replies to a single query.
2892 LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
2894 * Handles the reply of a query we initiated asking for routing gossip
2895 * messages for a list of channels. We should receive this message when
2896 * a node has completed its best effort to send us the pertaining routing
2899 LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
2901 * Handles when a peer asks us to send a list of short_channel_ids
2902 * for the requested range of blocks.
2904 LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
2906 * Handles when a peer asks us to send routing gossip messages for a
2907 * list of short_channel_ids.
2909 LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
2910 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
2911 void (*free)(void *this_arg);
2912 } LDKRoutingMessageHandler;
2914 typedef union LDKCResultPtr_ChannelReestablish__DecodeError {
2915 struct LDKChannelReestablish *result;
2916 struct LDKDecodeError *err;
2917 } LDKCResultPtr_ChannelReestablish__DecodeError;
2919 typedef struct LDKCResultTempl_ChannelReestablish__DecodeError {
2920 union LDKCResultPtr_ChannelReestablish__DecodeError contents;
2922 } LDKCResultTempl_ChannelReestablish__DecodeError;
2924 typedef struct LDKCResultTempl_ChannelReestablish__DecodeError LDKCResult_ChannelReestablishDecodeErrorZ;
2926 typedef union LDKCResultPtr_Init__DecodeError {
2927 struct LDKInit *result;
2928 struct LDKDecodeError *err;
2929 } LDKCResultPtr_Init__DecodeError;
2931 typedef struct LDKCResultTempl_Init__DecodeError {
2932 union LDKCResultPtr_Init__DecodeError contents;
2934 } LDKCResultTempl_Init__DecodeError;
2936 typedef struct LDKCResultTempl_Init__DecodeError LDKCResult_InitDecodeErrorZ;
2938 typedef union LDKCResultPtr_Ping__DecodeError {
2939 struct LDKPing *result;
2940 struct LDKDecodeError *err;
2941 } LDKCResultPtr_Ping__DecodeError;
2943 typedef struct LDKCResultTempl_Ping__DecodeError {
2944 union LDKCResultPtr_Ping__DecodeError contents;
2946 } LDKCResultTempl_Ping__DecodeError;
2948 typedef struct LDKCResultTempl_Ping__DecodeError LDKCResult_PingDecodeErrorZ;
2950 typedef union LDKCResultPtr_Pong__DecodeError {
2951 struct LDKPong *result;
2952 struct LDKDecodeError *err;
2953 } LDKCResultPtr_Pong__DecodeError;
2955 typedef struct LDKCResultTempl_Pong__DecodeError {
2956 union LDKCResultPtr_Pong__DecodeError contents;
2958 } LDKCResultTempl_Pong__DecodeError;
2960 typedef struct LDKCResultTempl_Pong__DecodeError LDKCResult_PongDecodeErrorZ;
2962 typedef union LDKCResultPtr_UnsignedChannelAnnouncement__DecodeError {
2963 struct LDKUnsignedChannelAnnouncement *result;
2964 struct LDKDecodeError *err;
2965 } LDKCResultPtr_UnsignedChannelAnnouncement__DecodeError;
2967 typedef struct LDKCResultTempl_UnsignedChannelAnnouncement__DecodeError {
2968 union LDKCResultPtr_UnsignedChannelAnnouncement__DecodeError contents;
2970 } LDKCResultTempl_UnsignedChannelAnnouncement__DecodeError;
2972 typedef struct LDKCResultTempl_UnsignedChannelAnnouncement__DecodeError LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
2974 typedef union LDKCResultPtr_UnsignedChannelUpdate__DecodeError {
2975 struct LDKUnsignedChannelUpdate *result;
2976 struct LDKDecodeError *err;
2977 } LDKCResultPtr_UnsignedChannelUpdate__DecodeError;
2979 typedef struct LDKCResultTempl_UnsignedChannelUpdate__DecodeError {
2980 union LDKCResultPtr_UnsignedChannelUpdate__DecodeError contents;
2982 } LDKCResultTempl_UnsignedChannelUpdate__DecodeError;
2984 typedef struct LDKCResultTempl_UnsignedChannelUpdate__DecodeError LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
2986 typedef union LDKCResultPtr_ErrorMessage__DecodeError {
2987 struct LDKErrorMessage *result;
2988 struct LDKDecodeError *err;
2989 } LDKCResultPtr_ErrorMessage__DecodeError;
2991 typedef struct LDKCResultTempl_ErrorMessage__DecodeError {
2992 union LDKCResultPtr_ErrorMessage__DecodeError contents;
2994 } LDKCResultTempl_ErrorMessage__DecodeError;
2996 typedef struct LDKCResultTempl_ErrorMessage__DecodeError LDKCResult_ErrorMessageDecodeErrorZ;
2998 typedef union LDKCResultPtr_UnsignedNodeAnnouncement__DecodeError {
2999 struct LDKUnsignedNodeAnnouncement *result;
3000 struct LDKDecodeError *err;
3001 } LDKCResultPtr_UnsignedNodeAnnouncement__DecodeError;
3003 typedef struct LDKCResultTempl_UnsignedNodeAnnouncement__DecodeError {
3004 union LDKCResultPtr_UnsignedNodeAnnouncement__DecodeError contents;
3006 } LDKCResultTempl_UnsignedNodeAnnouncement__DecodeError;
3008 typedef struct LDKCResultTempl_UnsignedNodeAnnouncement__DecodeError LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
3010 typedef union LDKCResultPtr_QueryShortChannelIds__DecodeError {
3011 struct LDKQueryShortChannelIds *result;
3012 struct LDKDecodeError *err;
3013 } LDKCResultPtr_QueryShortChannelIds__DecodeError;
3015 typedef struct LDKCResultTempl_QueryShortChannelIds__DecodeError {
3016 union LDKCResultPtr_QueryShortChannelIds__DecodeError contents;
3018 } LDKCResultTempl_QueryShortChannelIds__DecodeError;
3020 typedef struct LDKCResultTempl_QueryShortChannelIds__DecodeError LDKCResult_QueryShortChannelIdsDecodeErrorZ;
3022 typedef union LDKCResultPtr_ReplyShortChannelIdsEnd__DecodeError {
3023 struct LDKReplyShortChannelIdsEnd *result;
3024 struct LDKDecodeError *err;
3025 } LDKCResultPtr_ReplyShortChannelIdsEnd__DecodeError;
3027 typedef struct LDKCResultTempl_ReplyShortChannelIdsEnd__DecodeError {
3028 union LDKCResultPtr_ReplyShortChannelIdsEnd__DecodeError contents;
3030 } LDKCResultTempl_ReplyShortChannelIdsEnd__DecodeError;
3032 typedef struct LDKCResultTempl_ReplyShortChannelIdsEnd__DecodeError LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
3034 typedef union LDKCResultPtr_QueryChannelRange__DecodeError {
3035 struct LDKQueryChannelRange *result;
3036 struct LDKDecodeError *err;
3037 } LDKCResultPtr_QueryChannelRange__DecodeError;
3039 typedef struct LDKCResultTempl_QueryChannelRange__DecodeError {
3040 union LDKCResultPtr_QueryChannelRange__DecodeError contents;
3042 } LDKCResultTempl_QueryChannelRange__DecodeError;
3044 typedef struct LDKCResultTempl_QueryChannelRange__DecodeError LDKCResult_QueryChannelRangeDecodeErrorZ;
3046 typedef union LDKCResultPtr_ReplyChannelRange__DecodeError {
3047 struct LDKReplyChannelRange *result;
3048 struct LDKDecodeError *err;
3049 } LDKCResultPtr_ReplyChannelRange__DecodeError;
3051 typedef struct LDKCResultTempl_ReplyChannelRange__DecodeError {
3052 union LDKCResultPtr_ReplyChannelRange__DecodeError contents;
3054 } LDKCResultTempl_ReplyChannelRange__DecodeError;
3056 typedef struct LDKCResultTempl_ReplyChannelRange__DecodeError LDKCResult_ReplyChannelRangeDecodeErrorZ;
3058 typedef union LDKCResultPtr_GossipTimestampFilter__DecodeError {
3059 struct LDKGossipTimestampFilter *result;
3060 struct LDKDecodeError *err;
3061 } LDKCResultPtr_GossipTimestampFilter__DecodeError;
3063 typedef struct LDKCResultTempl_GossipTimestampFilter__DecodeError {
3064 union LDKCResultPtr_GossipTimestampFilter__DecodeError contents;
3066 } LDKCResultTempl_GossipTimestampFilter__DecodeError;
3068 typedef struct LDKCResultTempl_GossipTimestampFilter__DecodeError LDKCResult_GossipTimestampFilterDecodeErrorZ;
3073 * Provides references to trait impls which handle different types of messages.
3075 typedef struct MUST_USE_STRUCT LDKMessageHandler {
3077 * Nearly everywhere, inner must be non-null, however in places where
3078 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3080 LDKnativeMessageHandler *inner;
3082 } LDKMessageHandler;
3085 * Provides an object which can be used to send data to and which uniquely identifies a connection
3086 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
3087 * implement Hash to meet the PeerManager API.
3089 * For efficiency, Clone should be relatively cheap for this type.
3091 * You probably want to just extend an int and put a file descriptor in a struct and implement
3092 * send_data. Note that if you are using a higher-level net library that may call close() itself,
3093 * be careful to ensure you don't have races whereby you might register a new connection with an
3094 * fd which is the same as a previous one which has yet to be removed via
3095 * PeerManager::socket_disconnected().
3097 typedef struct LDKSocketDescriptor {
3100 * Attempts to send some data from the given slice to the peer.
3102 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
3103 * Note that in the disconnected case, socket_disconnected must still fire and further write
3104 * attempts may occur until that time.
3106 * If the returned size is smaller than data.len(), a write_available event must
3107 * trigger the next time more data can be written. Additionally, until the a send_data event
3108 * completes fully, no further read_events should trigger on the same peer!
3110 * If a read_event on this descriptor had previously returned true (indicating that read
3111 * events should be paused to prevent DoS in the send buffer), resume_read may be set
3112 * indicating that read events on this descriptor should resume. A resume_read of false does
3113 * *not* imply that further read events should be paused.
3115 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
3117 * Disconnect the socket pointed to by this SocketDescriptor. Once this function returns, no
3118 * more calls to write_buffer_space_avail, read_event or socket_disconnected may be made with
3119 * this descriptor. No socket_disconnected call should be generated as a result of this call,
3120 * though races may occur whereby disconnect_socket is called after a call to
3121 * socket_disconnected but prior to socket_disconnected returning.
3123 void (*disconnect_socket)(void *this_arg);
3124 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *other_arg);
3125 uint64_t (*hash)(const void *this_arg);
3126 void *(*clone)(const void *this_arg);
3127 void (*free)(void *this_arg);
3128 } LDKSocketDescriptor;
3133 * A PeerManager manages a set of peers, described by their SocketDescriptor and marshalls socket
3134 * events into messages which it passes on to its MessageHandlers.
3136 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
3137 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
3138 * essentially you should default to using a SimpleRefPeerManager, and use a
3139 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
3140 * you're using lightning-net-tokio.
3142 typedef struct MUST_USE_STRUCT LDKPeerManager {
3144 * Nearly everywhere, inner must be non-null, however in places where
3145 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3147 LDKnativePeerManager *inner;
3151 typedef struct LDKCVecTempl_PublicKey {
3152 struct LDKPublicKey *data;
3154 } LDKCVecTempl_PublicKey;
3156 typedef struct LDKCVecTempl_PublicKey LDKCVec_PublicKeyZ;
3158 typedef union LDKCResultPtr_CVecTempl_u8_____PeerHandleError {
3159 struct LDKCVecTempl_u8 *result;
3160 struct LDKPeerHandleError *err;
3161 } LDKCResultPtr_CVecTempl_u8_____PeerHandleError;
3163 typedef struct LDKCResultTempl_CVecTempl_u8_____PeerHandleError {
3164 union LDKCResultPtr_CVecTempl_u8_____PeerHandleError contents;
3166 } LDKCResultTempl_CVecTempl_u8_____PeerHandleError;
3168 typedef struct LDKCResultTempl_CVecTempl_u8_____PeerHandleError LDKCResult_CVec_u8ZPeerHandleErrorZ;
3170 typedef union LDKCResultPtr_bool__PeerHandleError {
3172 struct LDKPeerHandleError *err;
3173 } LDKCResultPtr_bool__PeerHandleError;
3175 typedef struct LDKCResultTempl_bool__PeerHandleError {
3176 union LDKCResultPtr_bool__PeerHandleError contents;
3178 } LDKCResultTempl_bool__PeerHandleError;
3180 typedef struct LDKCResultTempl_bool__PeerHandleError LDKCResult_boolPeerHandleErrorZ;
3182 typedef union LDKCResultPtr_SecretKey__Secp256k1Error {
3183 struct LDKSecretKey *result;
3184 enum LDKSecp256k1Error *err;
3185 } LDKCResultPtr_SecretKey__Secp256k1Error;
3187 typedef struct LDKCResultTempl_SecretKey__Secp256k1Error {
3188 union LDKCResultPtr_SecretKey__Secp256k1Error contents;
3190 } LDKCResultTempl_SecretKey__Secp256k1Error;
3192 typedef struct LDKCResultTempl_SecretKey__Secp256k1Error LDKCResult_SecretKeySecpErrorZ;
3194 typedef union LDKCResultPtr_PublicKey__Secp256k1Error {
3195 struct LDKPublicKey *result;
3196 enum LDKSecp256k1Error *err;
3197 } LDKCResultPtr_PublicKey__Secp256k1Error;
3199 typedef struct LDKCResultTempl_PublicKey__Secp256k1Error {
3200 union LDKCResultPtr_PublicKey__Secp256k1Error contents;
3202 } LDKCResultTempl_PublicKey__Secp256k1Error;
3204 typedef struct LDKCResultTempl_PublicKey__Secp256k1Error LDKCResult_PublicKeySecpErrorZ;
3209 * The set of public keys which are used in the creation of one commitment transaction.
3210 * These are derived from the channel base keys and per-commitment data.
3212 * A broadcaster key is provided from potential broadcaster of the computed transaction.
3213 * A countersignatory key is coming from a protocol participant unable to broadcast the
3216 * These keys are assumed to be good, either because the code derived them from
3217 * channel basepoints via the new function, or they were obtained via
3218 * CommitmentTransaction.trust().keys() because we trusted the source of the
3219 * pre-calculated keys.
3221 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
3223 * Nearly everywhere, inner must be non-null, however in places where
3224 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3226 LDKnativeTxCreationKeys *inner;
3228 } LDKTxCreationKeys;
3230 typedef union LDKCResultPtr_TxCreationKeys__Secp256k1Error {
3231 struct LDKTxCreationKeys *result;
3232 enum LDKSecp256k1Error *err;
3233 } LDKCResultPtr_TxCreationKeys__Secp256k1Error;
3235 typedef struct LDKCResultTempl_TxCreationKeys__Secp256k1Error {
3236 union LDKCResultPtr_TxCreationKeys__Secp256k1Error contents;
3238 } LDKCResultTempl_TxCreationKeys__Secp256k1Error;
3240 typedef struct LDKCResultTempl_TxCreationKeys__Secp256k1Error LDKCResult_TxCreationKeysSecpErrorZ;
3245 * Late-bound per-channel counterparty data used to build transactions.
3247 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
3249 * Nearly everywhere, inner must be non-null, however in places where
3250 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3252 LDKnativeCounterpartyChannelTransactionParameters *inner;
3254 } LDKCounterpartyChannelTransactionParameters;
3259 * Static channel fields used to build transactions given per-commitment fields, organized by
3260 * broadcaster/countersignatory.
3262 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
3263 * as_holder_broadcastable and as_counterparty_broadcastable functions.
3265 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
3267 * Nearly everywhere, inner must be non-null, however in places where
3268 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3270 LDKnativeDirectedChannelTransactionParameters *inner;
3272 } LDKDirectedChannelTransactionParameters;
3277 * A pre-built Bitcoin commitment transaction and its txid.
3279 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
3281 * Nearly everywhere, inner must be non-null, however in places where
3282 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3284 LDKnativeBuiltCommitmentTransaction *inner;
3286 } LDKBuiltCommitmentTransaction;
3293 typedef struct MUST_USE_STRUCT LDKRouteHop {
3295 * Nearly everywhere, inner must be non-null, however in places where
3296 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3298 LDKnativeRouteHop *inner;
3302 typedef struct LDKCVecTempl_RouteHop {
3303 struct LDKRouteHop *data;
3305 } LDKCVecTempl_RouteHop;
3307 typedef struct LDKCVecTempl_CVecTempl_RouteHop {
3308 struct LDKCVecTempl_RouteHop *data;
3310 } LDKCVecTempl_CVecTempl_RouteHop;
3312 typedef struct LDKCVecTempl_CVecTempl_RouteHop LDKCVec_CVec_RouteHopZZ;
3314 typedef union LDKCResultPtr_Route__DecodeError {
3315 struct LDKRoute *result;
3316 struct LDKDecodeError *err;
3317 } LDKCResultPtr_Route__DecodeError;
3319 typedef struct LDKCResultTempl_Route__DecodeError {
3320 union LDKCResultPtr_Route__DecodeError contents;
3322 } LDKCResultTempl_Route__DecodeError;
3324 typedef struct LDKCResultTempl_Route__DecodeError LDKCResult_RouteDecodeErrorZ;
3329 * A channel descriptor which provides a last-hop route to get_route
3331 typedef struct MUST_USE_STRUCT LDKRouteHint {
3333 * Nearly everywhere, inner must be non-null, however in places where
3334 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3336 LDKnativeRouteHint *inner;
3343 * Fees for routing via a given channel or a node
3345 typedef struct MUST_USE_STRUCT LDKRoutingFees {
3347 * Nearly everywhere, inner must be non-null, however in places where
3348 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3350 LDKnativeRoutingFees *inner;
3354 typedef union LDKCResultPtr_Route__LightningError {
3355 struct LDKRoute *result;
3356 struct LDKLightningError *err;
3357 } LDKCResultPtr_Route__LightningError;
3359 typedef struct LDKCResultTempl_Route__LightningError {
3360 union LDKCResultPtr_Route__LightningError contents;
3362 } LDKCResultTempl_Route__LightningError;
3364 typedef struct LDKCResultTempl_Route__LightningError LDKCResult_RouteLightningErrorZ;
3369 * Represents the network as nodes and channels between them
3371 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
3373 * Nearly everywhere, inner must be non-null, however in places where
3374 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3376 LDKnativeNetworkGraph *inner;
3380 typedef struct LDKCVecTempl_RouteHint {
3381 struct LDKRouteHint *data;
3383 } LDKCVecTempl_RouteHint;
3385 typedef struct LDKCVecTempl_RouteHint LDKCVec_RouteHintZ;
3390 * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
3391 * This exists only to make accessing a RwLock<NetworkGraph> possible from
3392 * the C bindings, as it can be done directly in Rust code.
3394 typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
3396 * Nearly everywhere, inner must be non-null, however in places where
3397 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3399 LDKnativeLockedNetworkGraph *inner;
3401 } LDKLockedNetworkGraph;
3406 * Receives and validates network updates from peers,
3407 * stores authentic and relevant data as a network graph.
3408 * This network graph is then used for routing payments.
3409 * Provides interface to help with initial routing sync by
3410 * serving historical announcements.
3412 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
3414 * Nearly everywhere, inner must be non-null, however in places where
3415 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3417 LDKnativeNetGraphMsgHandler *inner;
3419 } LDKNetGraphMsgHandler;
3424 * Details about one direction of a channel. Received
3425 * within a channel update.
3427 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
3429 * Nearly everywhere, inner must be non-null, however in places where
3430 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3432 LDKnativeDirectionalChannelInfo *inner;
3434 } LDKDirectionalChannelInfo;
3439 * Details about a channel (both directions).
3440 * Received within a channel announcement.
3442 typedef struct MUST_USE_STRUCT LDKChannelInfo {
3444 * Nearly everywhere, inner must be non-null, however in places where
3445 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3447 LDKnativeChannelInfo *inner;
3451 typedef union LDKCResultPtr_RoutingFees__DecodeError {
3452 struct LDKRoutingFees *result;
3453 struct LDKDecodeError *err;
3454 } LDKCResultPtr_RoutingFees__DecodeError;
3456 typedef struct LDKCResultTempl_RoutingFees__DecodeError {
3457 union LDKCResultPtr_RoutingFees__DecodeError contents;
3459 } LDKCResultTempl_RoutingFees__DecodeError;
3461 typedef struct LDKCResultTempl_RoutingFees__DecodeError LDKCResult_RoutingFeesDecodeErrorZ;
3466 * Information received in the latest node_announcement from this node.
3468 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
3470 * Nearly everywhere, inner must be non-null, however in places where
3471 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3473 LDKnativeNodeAnnouncementInfo *inner;
3475 } LDKNodeAnnouncementInfo;
3477 typedef union LDKCResultPtr_NodeAnnouncementInfo__DecodeError {
3478 struct LDKNodeAnnouncementInfo *result;
3479 struct LDKDecodeError *err;
3480 } LDKCResultPtr_NodeAnnouncementInfo__DecodeError;
3482 typedef struct LDKCResultTempl_NodeAnnouncementInfo__DecodeError {
3483 union LDKCResultPtr_NodeAnnouncementInfo__DecodeError contents;
3485 } LDKCResultTempl_NodeAnnouncementInfo__DecodeError;
3487 typedef struct LDKCResultTempl_NodeAnnouncementInfo__DecodeError LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
3492 * Details about a node in the network, known from the network announcement.
3494 typedef struct MUST_USE_STRUCT LDKNodeInfo {
3496 * Nearly everywhere, inner must be non-null, however in places where
3497 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3499 LDKnativeNodeInfo *inner;
3503 typedef union LDKCResultPtr_NodeInfo__DecodeError {
3504 struct LDKNodeInfo *result;
3505 struct LDKDecodeError *err;
3506 } LDKCResultPtr_NodeInfo__DecodeError;
3508 typedef struct LDKCResultTempl_NodeInfo__DecodeError {
3509 union LDKCResultPtr_NodeInfo__DecodeError contents;
3511 } LDKCResultTempl_NodeInfo__DecodeError;
3513 typedef struct LDKCResultTempl_NodeInfo__DecodeError LDKCResult_NodeInfoDecodeErrorZ;
3515 typedef union LDKCResultPtr_NetworkGraph__DecodeError {
3516 struct LDKNetworkGraph *result;
3517 struct LDKDecodeError *err;
3518 } LDKCResultPtr_NetworkGraph__DecodeError;
3520 typedef struct LDKCResultTempl_NetworkGraph__DecodeError {
3521 union LDKCResultPtr_NetworkGraph__DecodeError contents;
3523 } LDKCResultTempl_NetworkGraph__DecodeError;
3525 typedef struct LDKCResultTempl_NetworkGraph__DecodeError LDKCResult_NetworkGraphDecodeErrorZ;
3527 typedef struct LDKCVecTempl_RouteHop LDKCVec_RouteHopZ;
3529 extern const void (*CVec_SpendableOutputDescriptorZ_free)(LDKCVec_SpendableOutputDescriptorZ);
3531 extern const void (*CVec_MessageSendEventZ_free)(LDKCVec_MessageSendEventZ);
3533 extern const void (*CVec_EventZ_free)(LDKCVec_EventZ);
3535 extern const void (*C2Tuple_usizeTransactionZ_free)(LDKC2Tuple_usizeTransactionZ);
3537 extern const void (*CVec_C2Tuple_usizeTransactionZZ_free)(LDKCVec_C2Tuple_usizeTransactionZZ);
3539 extern const void (*CResult_NoneChannelMonitorUpdateErrZ_free)(LDKCResult_NoneChannelMonitorUpdateErrZ);
3541 extern const LDKCResult_NoneChannelMonitorUpdateErrZ (*CResult_NoneChannelMonitorUpdateErrZ_err)(enum LDKChannelMonitorUpdateErr);
3543 extern const void (*CVec_MonitorEventZ_free)(LDKCVec_MonitorEventZ);
3545 extern const void (*CResult_ChannelMonitorUpdateDecodeErrorZ_free)(LDKCResult_ChannelMonitorUpdateDecodeErrorZ);
3547 extern const LDKCResult_ChannelMonitorUpdateDecodeErrorZ (*CResult_ChannelMonitorUpdateDecodeErrorZ_ok)(struct LDKChannelMonitorUpdate);
3549 extern const LDKCResult_ChannelMonitorUpdateDecodeErrorZ (*CResult_ChannelMonitorUpdateDecodeErrorZ_err)(struct LDKDecodeError);
3551 extern const void (*CResult_NoneMonitorUpdateErrorZ_free)(LDKCResult_NoneMonitorUpdateErrorZ);
3553 extern const LDKCResult_NoneMonitorUpdateErrorZ (*CResult_NoneMonitorUpdateErrorZ_err)(struct LDKMonitorUpdateError);
3555 extern const void (*C2Tuple_OutPointScriptZ_free)(LDKC2Tuple_OutPointScriptZ);
3557 extern const void (*CVec_TransactionZ_free)(LDKCVec_TransactionZ);
3559 extern const void (*C2Tuple_u32TxOutZ_free)(LDKC2Tuple_u32TxOutZ);
3561 extern const void (*CVec_C2Tuple_u32TxOutZZ_free)(LDKCVec_C2Tuple_u32TxOutZZ);
3563 extern const void (*C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free)(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ);
3565 extern const void (*CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free)(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ);
3567 extern const void (*C2Tuple_u64u64Z_free)(LDKC2Tuple_u64u64Z);
3569 extern const void (*CVec_SignatureZ_free)(LDKCVec_SignatureZ);
3571 extern const void (*C2Tuple_SignatureCVec_SignatureZZ_free)(LDKC2Tuple_SignatureCVec_SignatureZZ);
3573 extern const void (*CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free)(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ);
3575 extern const LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok)(LDKC2Tuple_SignatureCVec_SignatureZZ);
3577 extern const void (*CResult_SignatureNoneZ_free)(LDKCResult_SignatureNoneZ);
3579 extern const LDKCResult_SignatureNoneZ (*CResult_SignatureNoneZ_ok)(struct LDKSignature);
3581 extern const void (*CResult_CVec_SignatureZNoneZ_free)(LDKCResult_CVec_SignatureZNoneZ);
3583 extern const LDKCResult_CVec_SignatureZNoneZ (*CResult_CVec_SignatureZNoneZ_ok)(LDKCVec_SignatureZ);
3585 extern const void (*CResult_ChanKeySignerDecodeErrorZ_free)(LDKCResult_ChanKeySignerDecodeErrorZ);
3587 extern const LDKCResult_ChanKeySignerDecodeErrorZ (*CResult_ChanKeySignerDecodeErrorZ_ok)(struct LDKChannelKeys);
3589 extern const LDKCResult_ChanKeySignerDecodeErrorZ (*CResult_ChanKeySignerDecodeErrorZ_err)(struct LDKDecodeError);
3591 extern const void (*CResult_InMemoryChannelKeysDecodeErrorZ_free)(LDKCResult_InMemoryChannelKeysDecodeErrorZ);
3593 extern const LDKCResult_InMemoryChannelKeysDecodeErrorZ (*CResult_InMemoryChannelKeysDecodeErrorZ_ok)(struct LDKInMemoryChannelKeys);
3595 extern const LDKCResult_InMemoryChannelKeysDecodeErrorZ (*CResult_InMemoryChannelKeysDecodeErrorZ_err)(struct LDKDecodeError);
3597 extern const void (*CResult_TxOutAccessErrorZ_free)(LDKCResult_TxOutAccessErrorZ);
3599 extern const LDKCResult_TxOutAccessErrorZ (*CResult_TxOutAccessErrorZ_ok)(struct LDKTxOut);
3601 extern const LDKCResult_TxOutAccessErrorZ (*CResult_TxOutAccessErrorZ_err)(enum LDKAccessError);
3603 extern const void (*CResult_NoneAPIErrorZ_free)(LDKCResult_NoneAPIErrorZ);
3605 extern const LDKCResult_NoneAPIErrorZ (*CResult_NoneAPIErrorZ_err)(struct LDKAPIError);
3607 extern const void (*CVec_ChannelDetailsZ_free)(LDKCVec_ChannelDetailsZ);
3609 extern const void (*CResult_NonePaymentSendFailureZ_free)(LDKCResult_NonePaymentSendFailureZ);
3611 extern const LDKCResult_NonePaymentSendFailureZ (*CResult_NonePaymentSendFailureZ_err)(struct LDKPaymentSendFailure);
3613 extern const void (*CVec_NetAddressZ_free)(LDKCVec_NetAddressZ);
3615 extern const void (*CVec_ChannelMonitorZ_free)(LDKCVec_ChannelMonitorZ);
3617 extern const void (*CVec_u64Z_free)(LDKCVec_u64Z);
3619 extern const void (*CVec_UpdateAddHTLCZ_free)(LDKCVec_UpdateAddHTLCZ);
3621 extern const void (*CVec_UpdateFulfillHTLCZ_free)(LDKCVec_UpdateFulfillHTLCZ);
3623 extern const void (*CVec_UpdateFailHTLCZ_free)(LDKCVec_UpdateFailHTLCZ);
3625 extern const void (*CVec_UpdateFailMalformedHTLCZ_free)(LDKCVec_UpdateFailMalformedHTLCZ);
3627 extern const void (*CResult_boolLightningErrorZ_free)(LDKCResult_boolLightningErrorZ);
3629 extern const LDKCResult_boolLightningErrorZ (*CResult_boolLightningErrorZ_ok)(bool);
3631 extern const LDKCResult_boolLightningErrorZ (*CResult_boolLightningErrorZ_err)(struct LDKLightningError);
3633 extern const void (*C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free)(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ);
3635 extern const void (*CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free)(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ);
3637 extern const void (*CVec_NodeAnnouncementZ_free)(LDKCVec_NodeAnnouncementZ);
3639 extern const void (*CResult_NoneLightningErrorZ_free)(LDKCResult_NoneLightningErrorZ);
3641 extern const LDKCResult_NoneLightningErrorZ (*CResult_NoneLightningErrorZ_err)(struct LDKLightningError);
3643 extern const void (*CResult_ChannelReestablishDecodeErrorZ_free)(LDKCResult_ChannelReestablishDecodeErrorZ);
3645 extern const LDKCResult_ChannelReestablishDecodeErrorZ (*CResult_ChannelReestablishDecodeErrorZ_ok)(struct LDKChannelReestablish);
3647 extern const LDKCResult_ChannelReestablishDecodeErrorZ (*CResult_ChannelReestablishDecodeErrorZ_err)(struct LDKDecodeError);
3649 extern const void (*CResult_InitDecodeErrorZ_free)(LDKCResult_InitDecodeErrorZ);
3651 extern const LDKCResult_InitDecodeErrorZ (*CResult_InitDecodeErrorZ_ok)(struct LDKInit);
3653 extern const LDKCResult_InitDecodeErrorZ (*CResult_InitDecodeErrorZ_err)(struct LDKDecodeError);
3655 extern const void (*CResult_PingDecodeErrorZ_free)(LDKCResult_PingDecodeErrorZ);
3657 extern const LDKCResult_PingDecodeErrorZ (*CResult_PingDecodeErrorZ_ok)(struct LDKPing);
3659 extern const LDKCResult_PingDecodeErrorZ (*CResult_PingDecodeErrorZ_err)(struct LDKDecodeError);
3661 extern const void (*CResult_PongDecodeErrorZ_free)(LDKCResult_PongDecodeErrorZ);
3663 extern const LDKCResult_PongDecodeErrorZ (*CResult_PongDecodeErrorZ_ok)(struct LDKPong);
3665 extern const LDKCResult_PongDecodeErrorZ (*CResult_PongDecodeErrorZ_err)(struct LDKDecodeError);
3667 extern const void (*CResult_UnsignedChannelAnnouncementDecodeErrorZ_free)(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ);
3669 extern const LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ (*CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok)(struct LDKUnsignedChannelAnnouncement);
3671 extern const LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ (*CResult_UnsignedChannelAnnouncementDecodeErrorZ_err)(struct LDKDecodeError);
3673 extern const void (*CResult_UnsignedChannelUpdateDecodeErrorZ_free)(LDKCResult_UnsignedChannelUpdateDecodeErrorZ);
3675 extern const LDKCResult_UnsignedChannelUpdateDecodeErrorZ (*CResult_UnsignedChannelUpdateDecodeErrorZ_ok)(struct LDKUnsignedChannelUpdate);
3677 extern const LDKCResult_UnsignedChannelUpdateDecodeErrorZ (*CResult_UnsignedChannelUpdateDecodeErrorZ_err)(struct LDKDecodeError);
3679 extern const void (*CResult_ErrorMessageDecodeErrorZ_free)(LDKCResult_ErrorMessageDecodeErrorZ);
3681 extern const LDKCResult_ErrorMessageDecodeErrorZ (*CResult_ErrorMessageDecodeErrorZ_ok)(struct LDKErrorMessage);
3683 extern const LDKCResult_ErrorMessageDecodeErrorZ (*CResult_ErrorMessageDecodeErrorZ_err)(struct LDKDecodeError);
3685 extern const void (*CResult_UnsignedNodeAnnouncementDecodeErrorZ_free)(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ);
3687 extern const LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ (*CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok)(struct LDKUnsignedNodeAnnouncement);
3689 extern const LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ (*CResult_UnsignedNodeAnnouncementDecodeErrorZ_err)(struct LDKDecodeError);
3691 extern const void (*CResult_QueryShortChannelIdsDecodeErrorZ_free)(LDKCResult_QueryShortChannelIdsDecodeErrorZ);
3693 extern const LDKCResult_QueryShortChannelIdsDecodeErrorZ (*CResult_QueryShortChannelIdsDecodeErrorZ_ok)(struct LDKQueryShortChannelIds);
3695 extern const LDKCResult_QueryShortChannelIdsDecodeErrorZ (*CResult_QueryShortChannelIdsDecodeErrorZ_err)(struct LDKDecodeError);
3697 extern const void (*CResult_ReplyShortChannelIdsEndDecodeErrorZ_free)(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ);
3699 extern const LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ (*CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok)(struct LDKReplyShortChannelIdsEnd);
3701 extern const LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ (*CResult_ReplyShortChannelIdsEndDecodeErrorZ_err)(struct LDKDecodeError);
3703 extern const void (*CResult_QueryChannelRangeDecodeErrorZ_free)(LDKCResult_QueryChannelRangeDecodeErrorZ);
3705 extern const LDKCResult_QueryChannelRangeDecodeErrorZ (*CResult_QueryChannelRangeDecodeErrorZ_ok)(struct LDKQueryChannelRange);
3707 extern const LDKCResult_QueryChannelRangeDecodeErrorZ (*CResult_QueryChannelRangeDecodeErrorZ_err)(struct LDKDecodeError);
3709 extern const void (*CResult_ReplyChannelRangeDecodeErrorZ_free)(LDKCResult_ReplyChannelRangeDecodeErrorZ);
3711 extern const LDKCResult_ReplyChannelRangeDecodeErrorZ (*CResult_ReplyChannelRangeDecodeErrorZ_ok)(struct LDKReplyChannelRange);
3713 extern const LDKCResult_ReplyChannelRangeDecodeErrorZ (*CResult_ReplyChannelRangeDecodeErrorZ_err)(struct LDKDecodeError);
3715 extern const void (*CResult_GossipTimestampFilterDecodeErrorZ_free)(LDKCResult_GossipTimestampFilterDecodeErrorZ);
3717 extern const LDKCResult_GossipTimestampFilterDecodeErrorZ (*CResult_GossipTimestampFilterDecodeErrorZ_ok)(struct LDKGossipTimestampFilter);
3719 extern const LDKCResult_GossipTimestampFilterDecodeErrorZ (*CResult_GossipTimestampFilterDecodeErrorZ_err)(struct LDKDecodeError);
3721 extern const void (*CVec_PublicKeyZ_free)(LDKCVec_PublicKeyZ);
3723 extern const void (*CVec_u8Z_free)(LDKCVec_u8Z);
3725 extern const void (*CResult_CVec_u8ZPeerHandleErrorZ_free)(LDKCResult_CVec_u8ZPeerHandleErrorZ);
3727 extern const LDKCResult_CVec_u8ZPeerHandleErrorZ (*CResult_CVec_u8ZPeerHandleErrorZ_ok)(LDKCVec_u8Z);
3729 extern const LDKCResult_CVec_u8ZPeerHandleErrorZ (*CResult_CVec_u8ZPeerHandleErrorZ_err)(struct LDKPeerHandleError);
3731 extern const void (*CResult_NonePeerHandleErrorZ_free)(LDKCResult_NonePeerHandleErrorZ);
3733 extern const LDKCResult_NonePeerHandleErrorZ (*CResult_NonePeerHandleErrorZ_err)(struct LDKPeerHandleError);
3735 extern const void (*CResult_boolPeerHandleErrorZ_free)(LDKCResult_boolPeerHandleErrorZ);
3737 extern const LDKCResult_boolPeerHandleErrorZ (*CResult_boolPeerHandleErrorZ_ok)(bool);
3739 extern const LDKCResult_boolPeerHandleErrorZ (*CResult_boolPeerHandleErrorZ_err)(struct LDKPeerHandleError);
3741 extern const void (*CResult_SecretKeySecpErrorZ_free)(LDKCResult_SecretKeySecpErrorZ);
3743 extern const LDKCResult_SecretKeySecpErrorZ (*CResult_SecretKeySecpErrorZ_ok)(struct LDKSecretKey);
3745 extern const LDKCResult_SecretKeySecpErrorZ (*CResult_SecretKeySecpErrorZ_err)(enum LDKSecp256k1Error);
3747 extern const void (*CResult_PublicKeySecpErrorZ_free)(LDKCResult_PublicKeySecpErrorZ);
3749 extern const LDKCResult_PublicKeySecpErrorZ (*CResult_PublicKeySecpErrorZ_ok)(struct LDKPublicKey);
3751 extern const LDKCResult_PublicKeySecpErrorZ (*CResult_PublicKeySecpErrorZ_err)(enum LDKSecp256k1Error);
3753 extern const void (*CResult_TxCreationKeysSecpErrorZ_free)(LDKCResult_TxCreationKeysSecpErrorZ);
3755 extern const LDKCResult_TxCreationKeysSecpErrorZ (*CResult_TxCreationKeysSecpErrorZ_ok)(struct LDKTxCreationKeys);
3757 extern const LDKCResult_TxCreationKeysSecpErrorZ (*CResult_TxCreationKeysSecpErrorZ_err)(enum LDKSecp256k1Error);
3759 extern const void (*CResult_TrustedCommitmentTransactionNoneZ_free)(LDKCResult_TrustedCommitmentTransactionNoneZ);
3761 extern const LDKCResult_TrustedCommitmentTransactionNoneZ (*CResult_TrustedCommitmentTransactionNoneZ_ok)(struct LDKTrustedCommitmentTransaction);
3763 extern const void (*CVec_RouteHopZ_free)(LDKCVec_RouteHopZ);
3765 extern const void (*CVec_CVec_RouteHopZZ_free)(LDKCVec_CVec_RouteHopZZ);
3767 extern const void (*CResult_RouteDecodeErrorZ_free)(LDKCResult_RouteDecodeErrorZ);
3769 extern const LDKCResult_RouteDecodeErrorZ (*CResult_RouteDecodeErrorZ_ok)(struct LDKRoute);
3771 extern const LDKCResult_RouteDecodeErrorZ (*CResult_RouteDecodeErrorZ_err)(struct LDKDecodeError);
3773 extern const void (*CVec_RouteHintZ_free)(LDKCVec_RouteHintZ);
3775 extern const void (*CResult_RouteLightningErrorZ_free)(LDKCResult_RouteLightningErrorZ);
3777 extern const LDKCResult_RouteLightningErrorZ (*CResult_RouteLightningErrorZ_ok)(struct LDKRoute);
3779 extern const LDKCResult_RouteLightningErrorZ (*CResult_RouteLightningErrorZ_err)(struct LDKLightningError);
3781 extern const void (*CResult_RoutingFeesDecodeErrorZ_free)(LDKCResult_RoutingFeesDecodeErrorZ);
3783 extern const LDKCResult_RoutingFeesDecodeErrorZ (*CResult_RoutingFeesDecodeErrorZ_ok)(struct LDKRoutingFees);
3785 extern const LDKCResult_RoutingFeesDecodeErrorZ (*CResult_RoutingFeesDecodeErrorZ_err)(struct LDKDecodeError);
3787 extern const void (*CResult_NodeAnnouncementInfoDecodeErrorZ_free)(LDKCResult_NodeAnnouncementInfoDecodeErrorZ);
3789 extern const LDKCResult_NodeAnnouncementInfoDecodeErrorZ (*CResult_NodeAnnouncementInfoDecodeErrorZ_ok)(struct LDKNodeAnnouncementInfo);
3791 extern const LDKCResult_NodeAnnouncementInfoDecodeErrorZ (*CResult_NodeAnnouncementInfoDecodeErrorZ_err)(struct LDKDecodeError);
3793 extern const void (*CResult_NodeInfoDecodeErrorZ_free)(LDKCResult_NodeInfoDecodeErrorZ);
3795 extern const LDKCResult_NodeInfoDecodeErrorZ (*CResult_NodeInfoDecodeErrorZ_ok)(struct LDKNodeInfo);
3797 extern const LDKCResult_NodeInfoDecodeErrorZ (*CResult_NodeInfoDecodeErrorZ_err)(struct LDKDecodeError);
3799 extern const void (*CResult_NetworkGraphDecodeErrorZ_free)(LDKCResult_NetworkGraphDecodeErrorZ);
3801 extern const LDKCResult_NetworkGraphDecodeErrorZ (*CResult_NetworkGraphDecodeErrorZ_ok)(struct LDKNetworkGraph);
3803 extern const LDKCResult_NetworkGraphDecodeErrorZ (*CResult_NetworkGraphDecodeErrorZ_err)(struct LDKDecodeError);
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 void Transaction_free(struct LDKTransaction _res);
3813 void TxOut_free(struct LDKTxOut _res);
3815 LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
3817 LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
3819 LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
3821 LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, LDKCVec_u8Z b);
3823 LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
3825 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, LDKCVec_C2Tuple_u32TxOutZZ b);
3827 LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
3829 LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, LDKCVec_SignatureZ b);
3831 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
3833 LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
3835 LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
3837 LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
3839 LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
3841 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
3843 LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
3845 LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
3847 LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
3849 void Event_free(struct LDKEvent this_ptr);
3851 struct LDKEvent Event_clone(const struct LDKEvent *orig);
3853 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
3855 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *orig);
3858 * Calls the free function if one is set
3860 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
3863 * Calls the free function if one is set
3865 void EventsProvider_free(struct LDKEventsProvider this_ptr);
3867 void APIError_free(struct LDKAPIError this_ptr);
3869 struct LDKAPIError APIError_clone(const struct LDKAPIError *orig);
3871 enum LDKLevel Level_clone(const enum LDKLevel *orig);
3874 * Returns the most verbose logging level.
3876 MUST_USE_RES enum LDKLevel Level_max(void);
3879 * Calls the free function if one is set
3881 void Logger_free(struct LDKLogger this_ptr);
3883 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_ptr);
3885 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *orig);
3888 * Confirmations we will wait for before considering the channel locked in.
3889 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
3890 * equivalent limit applied to outbound channels).
3894 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *this_ptr);
3897 * Confirmations we will wait for before considering the channel locked in.
3898 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
3899 * equivalent limit applied to outbound channels).
3903 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *this_ptr, uint32_t val);
3906 * Set to the amount of time we require our counterparty to wait to claim their money.
3908 * It's one of the main parameter of our security model. We (or one of our watchtowers) MUST
3909 * be online to check for peer having broadcast a revoked transaction to steal our funds
3910 * at least once every our_to_self_delay blocks.
3912 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
3913 * case of an honest unilateral channel close, which implicitly decrease the economic value of
3916 * Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel
3917 * opening so you can tweak config to ask for more security, not less.
3919 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *this_ptr);
3922 * Set to the amount of time we require our counterparty to wait to claim their money.
3924 * It's one of the main parameter of our security model. We (or one of our watchtowers) MUST
3925 * be online to check for peer having broadcast a revoked transaction to steal our funds
3926 * at least once every our_to_self_delay blocks.
3928 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
3929 * case of an honest unilateral channel close, which implicitly decrease the economic value of
3932 * Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel
3933 * opening so you can tweak config to ask for more security, not less.
3935 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *this_ptr, uint16_t val);
3938 * Set to the smallest value HTLC we will accept to process.
3940 * This value is sent to our counterparty on channel-open and we close the channel any time
3941 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
3943 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
3946 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *this_ptr);
3949 * Set to the smallest value HTLC we will accept to process.
3951 * This value is sent to our counterparty on channel-open and we close the channel any time
3952 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
3954 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
3957 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *this_ptr, uint64_t val);
3959 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);
3961 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
3963 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_ptr);
3965 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *orig);
3968 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
3969 * only applies to inbound channels.
3973 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *this_ptr);
3976 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
3977 * only applies to inbound channels.
3981 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *this_ptr, uint64_t val);
3984 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
3985 * you to limit the maximum minimum-size they can require.
3987 * Default value: u64::max_value.
3989 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *this_ptr);
3992 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
3993 * you to limit the maximum minimum-size they can require.
3995 * Default value: u64::max_value.
3997 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *this_ptr, uint64_t val);
4000 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
4001 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
4005 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *this_ptr);
4008 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
4009 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
4013 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *this_ptr, uint64_t val);
4016 * The remote node will require we keep a certain amount in direct payment to ourselves at all
4017 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
4018 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
4020 * Default value: u64::max_value.
4022 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *this_ptr);
4025 * The remote node will require we keep a certain amount in direct payment to ourselves at all
4026 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
4027 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
4029 * Default value: u64::max_value.
4031 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *this_ptr, uint64_t val);
4034 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
4035 * time. This allows you to set a minimum such value.
4039 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *this_ptr);
4042 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
4043 * time. This allows you to set a minimum such value.
4047 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *this_ptr, uint16_t val);
4050 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
4051 * required to always be higher than this value so this only applies to HTLC outputs (and
4052 * potentially to-self outputs before any payments have been made).
4053 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
4054 * This setting allows you to set a minimum dust limit for their commitment transactions,
4055 * reflecting the reality that tiny outputs are not considered standard transactions and will
4056 * not propagate through the Bitcoin network.
4058 * Default value: 546, the current dust limit on the Bitcoin network.
4060 uint64_t ChannelHandshakeLimits_get_min_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *this_ptr);
4063 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
4064 * required to always be higher than this value so this only applies to HTLC outputs (and
4065 * potentially to-self outputs before any payments have been made).
4066 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
4067 * This setting allows you to set a minimum dust limit for their commitment transactions,
4068 * reflecting the reality that tiny outputs are not considered standard transactions and will
4069 * not propagate through the Bitcoin network.
4071 * Default value: 546, the current dust limit on the Bitcoin network.
4073 void ChannelHandshakeLimits_set_min_dust_limit_satoshis(struct LDKChannelHandshakeLimits *this_ptr, uint64_t val);
4076 * Maximum allowed threshold above which outputs will not be generated in their commitment
4078 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
4080 * Default value: u64::max_value.
4082 uint64_t ChannelHandshakeLimits_get_max_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *this_ptr);
4085 * Maximum allowed threshold above which outputs will not be generated in their commitment
4087 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
4089 * Default value: u64::max_value.
4091 void ChannelHandshakeLimits_set_max_dust_limit_satoshis(struct LDKChannelHandshakeLimits *this_ptr, uint64_t val);
4094 * Before a channel is usable the funding transaction will need to be confirmed by at least a
4095 * certain number of blocks, specified by the node which is not the funder (as the funder can
4096 * assume they aren't going to double-spend themselves).
4097 * This config allows you to set a limit on the maximum amount of time to wait.
4099 * Default value: 144, or roughly one day and only applies to outbound channels.
4101 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *this_ptr);
4104 * Before a channel is usable the funding transaction will need to be confirmed by at least a
4105 * certain number of blocks, specified by the node which is not the funder (as the funder can
4106 * assume they aren't going to double-spend themselves).
4107 * This config allows you to set a limit on the maximum amount of time to wait.
4109 * Default value: 144, or roughly one day and only applies to outbound channels.
4111 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *this_ptr, uint32_t val);
4114 * Set to force the incoming channel to match our announced channel preference in
4117 * Default value: true, to make the default that no announced channels are possible (which is
4118 * appropriate for any nodes which are not online very reliably).
4120 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *this_ptr);
4123 * Set to force the incoming channel to match our announced channel preference in
4126 * Default value: true, to make the default that no announced channels are possible (which is
4127 * appropriate for any nodes which are not online very reliably).
4129 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *this_ptr, bool val);
4132 * Set to the amount of time we're willing to wait to claim money back to us.
4134 * Not checking this value would be a security issue, as our peer would be able to set it to
4135 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
4137 * Default value: MAX_LOCAL_BREAKDOWN_TIMEOUT (1008), which we also enforce as a maximum value
4138 * so you can tweak config to reduce the loss of having useless locked funds (if your peer accepts)
4140 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *this_ptr);
4143 * Set to the amount of time we're willing to wait to claim money back to us.
4145 * Not checking this value would be a security issue, as our peer would be able to set it to
4146 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
4148 * Default value: MAX_LOCAL_BREAKDOWN_TIMEOUT (1008), which we also enforce as a maximum value
4149 * so you can tweak config to reduce the loss of having useless locked funds (if your peer accepts)
4151 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *this_ptr, uint16_t val);
4153 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);
4155 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
4157 void ChannelConfig_free(struct LDKChannelConfig this_ptr);
4159 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *orig);
4162 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
4163 * This may be allowed to change at runtime in a later update, however doing so must result in
4164 * update messages sent to notify all nodes of our updated relay fee.
4168 uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *this_ptr);
4171 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
4172 * This may be allowed to change at runtime in a later update, however doing so must result in
4173 * update messages sent to notify all nodes of our updated relay fee.
4177 void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *this_ptr, uint32_t val);
4180 * Set to announce the channel publicly and notify all nodes that they can route via this
4183 * This should only be set to true for nodes which expect to be online reliably.
4185 * As the node which funds a channel picks this value this will only apply for new outbound
4186 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
4188 * This cannot be changed after the initial channel handshake.
4190 * Default value: false.
4192 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *this_ptr);
4195 * Set to announce the channel publicly and notify all nodes that they can route via this
4198 * This should only be set to true for nodes which expect to be online reliably.
4200 * As the node which funds a channel picks this value this will only apply for new outbound
4201 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
4203 * This cannot be changed after the initial channel handshake.
4205 * Default value: false.
4207 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *this_ptr, bool val);
4210 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
4211 * supports it, they will then enforce the mutual-close output to us matches what we provided
4212 * at intialization, preventing us from closing to an alternate pubkey.
4214 * This is set to true by default to provide a slight increase in security, though ultimately
4215 * any attacker who is able to take control of a channel can just as easily send the funds via
4216 * lightning payments, so we never require that our counterparties support this option.
4218 * This cannot be changed after a channel has been initialized.
4220 * Default value: true.
4222 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *this_ptr);
4225 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
4226 * supports it, they will then enforce the mutual-close output to us matches what we provided
4227 * at intialization, preventing us from closing to an alternate pubkey.
4229 * This is set to true by default to provide a slight increase in security, though ultimately
4230 * any attacker who is able to take control of a channel can just as easily send the funds via
4231 * lightning payments, so we never require that our counterparties support this option.
4233 * This cannot be changed after a channel has been initialized.
4235 * Default value: true.
4237 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *this_ptr, bool val);
4239 MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
4241 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
4243 LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *obj);
4245 struct LDKChannelConfig ChannelConfig_read(struct LDKu8slice ser);
4247 void UserConfig_free(struct LDKUserConfig this_ptr);
4249 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *orig);
4252 * Channel config that we propose to our counterparty.
4254 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *this_ptr);
4257 * Channel config that we propose to our counterparty.
4259 void UserConfig_set_own_channel_config(struct LDKUserConfig *this_ptr, struct LDKChannelHandshakeConfig val);
4262 * Limits applied to our counterparty's proposed channel config settings.
4264 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *this_ptr);
4267 * Limits applied to our counterparty's proposed channel config settings.
4269 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *this_ptr, struct LDKChannelHandshakeLimits val);
4272 * Channel config which affects behavior during channel lifetime.
4274 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *this_ptr);
4277 * Channel config which affects behavior during channel lifetime.
4279 void UserConfig_set_channel_options(struct LDKUserConfig *this_ptr, struct LDKChannelConfig val);
4281 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);
4283 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
4285 enum LDKAccessError AccessError_clone(const enum LDKAccessError *orig);
4288 * Calls the free function if one is set
4290 void Access_free(struct LDKAccess this_ptr);
4293 * Calls the free function if one is set
4295 void Watch_free(struct LDKWatch this_ptr);
4298 * Calls the free function if one is set
4300 void Filter_free(struct LDKFilter this_ptr);
4303 * Calls the free function if one is set
4305 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
4307 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *orig);
4310 * Calls the free function if one is set
4312 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
4314 void ChainMonitor_free(struct LDKChainMonitor this_ptr);
4317 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
4318 * of a channel and reacting accordingly based on transactions in the connected block. See
4319 * [`ChannelMonitor::block_connected`] for details. Any HTLCs that were resolved on chain will
4320 * be returned by [`chain::Watch::release_pending_monitor_events`].
4322 * Calls back to [`chain::Filter`] if any monitor indicated new outputs to watch. Subsequent
4323 * calls must not exclude any transactions matching the new outputs nor any in-block
4324 * descendants of such transactions. It is not necessary to re-fetch the block to obtain
4327 * [`ChannelMonitor::block_connected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_connected
4328 * [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
4329 * [`chain::Filter`]: ../trait.Filter.html
4331 void ChainMonitor_block_connected(const struct LDKChainMonitor *this_arg, const uint8_t (*header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
4334 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
4335 * of a channel based on the disconnected block. See [`ChannelMonitor::block_disconnected`] for
4338 * [`ChannelMonitor::block_disconnected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_disconnected
4340 void ChainMonitor_block_disconnected(const struct LDKChainMonitor *this_arg, const uint8_t (*header)[80], uint32_t disconnected_height);
4343 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
4345 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
4346 * will call back to it indicating transactions and outputs of interest. This allows clients to
4347 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
4348 * always need to fetch full blocks absent another means for determining which blocks contain
4349 * transactions relevant to the watched channels.
4351 * [`chain::Filter`]: ../trait.Filter.html
4353 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
4355 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *this_arg);
4357 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *this_arg);
4359 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_ptr);
4361 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *orig);
4364 * The sequence number of this update. Updates *must* be replayed in-order according to this
4365 * sequence number (and updates may panic if they are not). The update_id values are strictly
4366 * increasing and increase by one for each new update, with one exception specified below.
4368 * This sequence number is also used to track up to which points updates which returned
4369 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
4370 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
4372 * The only instance where update_id values are not strictly increasing is the case where we
4373 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
4374 * its docs for more details.
4376 * [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
4378 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *this_ptr);
4381 * The sequence number of this update. Updates *must* be replayed in-order according to this
4382 * sequence number (and updates may panic if they are not). The update_id values are strictly
4383 * increasing and increase by one for each new update, with one exception specified below.
4385 * This sequence number is also used to track up to which points updates which returned
4386 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
4387 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
4389 * The only instance where update_id values are not strictly increasing is the case where we
4390 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
4391 * its docs for more details.
4393 * [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
4395 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *this_ptr, uint64_t val);
4397 LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *obj);
4399 LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
4401 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *orig);
4403 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_ptr);
4405 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
4407 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *orig);
4409 void HTLCUpdate_free(struct LDKHTLCUpdate this_ptr);
4411 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *orig);
4413 LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *obj);
4415 struct LDKHTLCUpdate HTLCUpdate_read(struct LDKu8slice ser);
4417 void ChannelMonitor_free(struct LDKChannelMonitor this_ptr);
4420 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
4423 * panics if the given update is not the next update by update_id.
4425 MUST_USE_RES LDKCResult_NoneMonitorUpdateErrorZ ChannelMonitor_update_monitor(struct LDKChannelMonitor *this_arg, const struct LDKChannelMonitorUpdate *updates, const struct LDKBroadcasterInterface *broadcaster, const struct LDKFeeEstimator *fee_estimator, const struct LDKLogger *logger);
4428 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
4431 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *this_arg);
4434 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
4436 MUST_USE_RES LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *this_arg);
4439 * Get the list of HTLCs who's status has been updated on chain. This should be called by
4440 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
4442 * [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
4444 MUST_USE_RES LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(struct LDKChannelMonitor *this_arg);
4447 * Gets the list of pending events which were generated by previous actions, clearing the list
4450 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
4451 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
4452 * no internal locking in ChannelMonitors.
4454 MUST_USE_RES LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(struct LDKChannelMonitor *this_arg);
4457 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
4458 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
4459 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
4460 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
4461 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
4462 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
4463 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
4464 * out-of-band the other node operator to coordinate with him if option is available to you.
4465 * In any-case, choice is up to the user.
4467 MUST_USE_RES LDKCVec_TransactionZ ChannelMonitor_get_latest_holder_commitment_txn(struct LDKChannelMonitor *this_arg, const struct LDKLogger *logger);
4470 * Processes transactions in a newly connected block, which may result in any of the following:
4471 * - update the monitor's state against resolved HTLCs
4472 * - punish the counterparty in the case of seeing a revoked commitment transaction
4473 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
4474 * - detect settled outputs for later spending
4475 * - schedule and bump any in-flight claims
4477 * Returns any new outputs to watch from `txdata`; after called, these are also included in
4478 * [`get_outputs_to_watch`].
4480 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
4482 MUST_USE_RES LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ChannelMonitor_block_connected(struct LDKChannelMonitor *this_arg, const uint8_t (*header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
4485 * Determines if the disconnected block contained any transactions of interest and updates
4488 void ChannelMonitor_block_disconnected(struct LDKChannelMonitor *this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
4491 * Calls the free function if one is set
4493 void Persist_free(struct LDKPersist this_ptr);
4495 void OutPoint_free(struct LDKOutPoint this_ptr);
4497 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *orig);
4500 * The referenced transaction's txid.
4502 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *this_ptr))[32];
4505 * The referenced transaction's txid.
4507 void OutPoint_set_txid(struct LDKOutPoint *this_ptr, struct LDKThirtyTwoBytes val);
4510 * The index of the referenced output in its transaction's vout.
4512 uint16_t OutPoint_get_index(const struct LDKOutPoint *this_ptr);
4515 * The index of the referenced output in its transaction's vout.
4517 void OutPoint_set_index(struct LDKOutPoint *this_ptr, uint16_t val);
4519 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
4522 * Convert an `OutPoint` to a lightning channel id.
4524 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *this_arg);
4526 LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *obj);
4528 struct LDKOutPoint OutPoint_read(struct LDKu8slice ser);
4530 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
4532 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *orig);
4534 struct LDKChannelKeys ChannelKeys_clone(const struct LDKChannelKeys *orig);
4537 * Calls the free function if one is set
4539 void ChannelKeys_free(struct LDKChannelKeys this_ptr);
4542 * Calls the free function if one is set
4544 void KeysInterface_free(struct LDKKeysInterface this_ptr);
4546 void InMemoryChannelKeys_free(struct LDKInMemoryChannelKeys this_ptr);
4548 struct LDKInMemoryChannelKeys InMemoryChannelKeys_clone(const struct LDKInMemoryChannelKeys *orig);
4551 * Private key of anchor tx
4553 const uint8_t (*InMemoryChannelKeys_get_funding_key(const struct LDKInMemoryChannelKeys *this_ptr))[32];
4556 * Private key of anchor tx
4558 void InMemoryChannelKeys_set_funding_key(struct LDKInMemoryChannelKeys *this_ptr, struct LDKSecretKey val);
4561 * Holder secret key for blinded revocation pubkey
4563 const uint8_t (*InMemoryChannelKeys_get_revocation_base_key(const struct LDKInMemoryChannelKeys *this_ptr))[32];
4566 * Holder secret key for blinded revocation pubkey
4568 void InMemoryChannelKeys_set_revocation_base_key(struct LDKInMemoryChannelKeys *this_ptr, struct LDKSecretKey val);
4571 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
4573 const uint8_t (*InMemoryChannelKeys_get_payment_key(const struct LDKInMemoryChannelKeys *this_ptr))[32];
4576 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
4578 void InMemoryChannelKeys_set_payment_key(struct LDKInMemoryChannelKeys *this_ptr, struct LDKSecretKey val);
4581 * Holder secret key used in HTLC tx
4583 const uint8_t (*InMemoryChannelKeys_get_delayed_payment_base_key(const struct LDKInMemoryChannelKeys *this_ptr))[32];
4586 * Holder secret key used in HTLC tx
4588 void InMemoryChannelKeys_set_delayed_payment_base_key(struct LDKInMemoryChannelKeys *this_ptr, struct LDKSecretKey val);
4591 * Holder htlc secret key used in commitment tx htlc outputs
4593 const uint8_t (*InMemoryChannelKeys_get_htlc_base_key(const struct LDKInMemoryChannelKeys *this_ptr))[32];
4596 * Holder htlc secret key used in commitment tx htlc outputs
4598 void InMemoryChannelKeys_set_htlc_base_key(struct LDKInMemoryChannelKeys *this_ptr, struct LDKSecretKey val);
4603 const uint8_t (*InMemoryChannelKeys_get_commitment_seed(const struct LDKInMemoryChannelKeys *this_ptr))[32];
4608 void InMemoryChannelKeys_set_commitment_seed(struct LDKInMemoryChannelKeys *this_ptr, struct LDKThirtyTwoBytes val);
4611 * Create a new InMemoryChannelKeys
4613 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, LDKC2Tuple_u64u64Z key_derivation_params);
4616 * Counterparty pubkeys.
4617 * Will panic if ready_channel wasn't called.
4619 MUST_USE_RES struct LDKChannelPublicKeys InMemoryChannelKeys_counterparty_pubkeys(const struct LDKInMemoryChannelKeys *this_arg);
4622 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
4623 * transactions, ie the amount of time that we have to wait to recover our funds if we
4624 * broadcast a transaction.
4625 * Will panic if ready_channel wasn't called.
4627 MUST_USE_RES uint16_t InMemoryChannelKeys_counterparty_selected_contest_delay(const struct LDKInMemoryChannelKeys *this_arg);
4630 * The contest_delay value specified by us and applied on transactions broadcastable
4631 * by our counterparty, ie the amount of time that they have to wait to recover their funds
4632 * if they broadcast a transaction.
4633 * Will panic if ready_channel wasn't called.
4635 MUST_USE_RES uint16_t InMemoryChannelKeys_holder_selected_contest_delay(const struct LDKInMemoryChannelKeys *this_arg);
4638 * Whether the holder is the initiator
4639 * Will panic if ready_channel wasn't called.
4641 MUST_USE_RES bool InMemoryChannelKeys_is_outbound(const struct LDKInMemoryChannelKeys *this_arg);
4645 * Will panic if ready_channel wasn't called.
4647 MUST_USE_RES struct LDKOutPoint InMemoryChannelKeys_funding_outpoint(const struct LDKInMemoryChannelKeys *this_arg);
4650 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
4651 * building transactions.
4653 * Will panic if ready_channel wasn't called.
4655 MUST_USE_RES struct LDKChannelTransactionParameters InMemoryChannelKeys_get_channel_parameters(const struct LDKInMemoryChannelKeys *this_arg);
4657 struct LDKChannelKeys InMemoryChannelKeys_as_ChannelKeys(const struct LDKInMemoryChannelKeys *this_arg);
4659 LDKCVec_u8Z InMemoryChannelKeys_write(const struct LDKInMemoryChannelKeys *obj);
4661 LDKCResult_InMemoryChannelKeysDecodeErrorZ InMemoryChannelKeys_read(struct LDKu8slice ser);
4663 void KeysManager_free(struct LDKKeysManager this_ptr);
4666 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
4667 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
4668 * starting_time isn't strictly required to actually be a time, but it must absolutely,
4669 * without a doubt, be unique to this instance. ie if you start multiple times with the same
4670 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
4671 * simply use the current time (with very high precision).
4673 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
4674 * obviously, starting_time should be unique every time you reload the library - it is only
4675 * used to generate new ephemeral key data (which will be stored by the individual channel if
4678 * Note that the seed is required to recover certain on-chain funds independent of
4679 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
4680 * channel, and some on-chain during-closing funds.
4682 * Note that until the 0.1 release there is no guarantee of backward compatibility between
4683 * versions. Once the library is more fully supported, the docs will be updated to include a
4684 * detailed description of the guarantee.
4686 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], enum LDKNetwork network, uint64_t starting_time_secs, uint32_t starting_time_nanos);
4689 * Derive an old set of ChannelKeys for per-channel secrets based on a key derivation
4691 * Key derivation parameters are accessible through a per-channel secrets
4692 * ChannelKeys::key_derivation_params and is provided inside DynamicOuputP2WSH in case of
4693 * onchain output detection for which a corresponding delayed_payment_key must be derived.
4695 MUST_USE_RES struct LDKInMemoryChannelKeys KeysManager_derive_channel_keys(const struct LDKKeysManager *this_arg, uint64_t channel_value_satoshis, uint64_t params_1, uint64_t params_2);
4697 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *this_arg);
4699 void ChannelManager_free(struct LDKChannelManager this_ptr);
4701 void ChannelDetails_free(struct LDKChannelDetails this_ptr);
4703 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *orig);
4706 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
4707 * thereafter this is the txid of the funding transaction xor the funding transaction output).
4708 * Note that this means this value is *not* persistent - it can change once during the
4709 * lifetime of the channel.
4711 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *this_ptr))[32];
4714 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
4715 * thereafter this is the txid of the funding transaction xor the funding transaction output).
4716 * Note that this means this value is *not* persistent - it can change once during the
4717 * lifetime of the channel.
4719 void ChannelDetails_set_channel_id(struct LDKChannelDetails *this_ptr, struct LDKThirtyTwoBytes val);
4722 * The node_id of our counterparty
4724 struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *this_ptr);
4727 * The node_id of our counterparty
4729 void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *this_ptr, struct LDKPublicKey val);
4732 * The Features the channel counterparty provided upon last connection.
4733 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
4734 * many routing-relevant features are present in the init context.
4736 struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *this_ptr);
4739 * The Features the channel counterparty provided upon last connection.
4740 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
4741 * many routing-relevant features are present in the init context.
4743 void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *this_ptr, struct LDKInitFeatures val);
4746 * The value, in satoshis, of this channel as appears in the funding output
4748 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *this_ptr);
4751 * The value, in satoshis, of this channel as appears in the funding output
4753 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *this_ptr, uint64_t val);
4756 * The user_id passed in to create_channel, or 0 if the channel was inbound.
4758 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *this_ptr);
4761 * The user_id passed in to create_channel, or 0 if the channel was inbound.
4763 void ChannelDetails_set_user_id(struct LDKChannelDetails *this_ptr, uint64_t val);
4766 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
4767 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
4768 * available for inclusion in new outbound HTLCs). This further does not include any pending
4769 * outgoing HTLCs which are awaiting some other resolution to be sent.
4771 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *this_ptr);
4774 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
4775 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
4776 * available for inclusion in new outbound HTLCs). This further does not include any pending
4777 * outgoing HTLCs which are awaiting some other resolution to be sent.
4779 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *this_ptr, uint64_t val);
4782 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
4783 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
4784 * available for inclusion in new inbound HTLCs).
4785 * Note that there are some corner cases not fully handled here, so the actual available
4786 * inbound capacity may be slightly higher than this.
4788 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *this_ptr);
4791 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
4792 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
4793 * available for inclusion in new inbound HTLCs).
4794 * Note that there are some corner cases not fully handled here, so the actual available
4795 * inbound capacity may be slightly higher than this.
4797 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *this_ptr, uint64_t val);
4800 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
4801 * the peer is connected, and (c) no monitor update failure is pending resolution.
4803 bool ChannelDetails_get_is_live(const struct LDKChannelDetails *this_ptr);
4806 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
4807 * the peer is connected, and (c) no monitor update failure is pending resolution.
4809 void ChannelDetails_set_is_live(struct LDKChannelDetails *this_ptr, bool val);
4811 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
4814 * Constructs a new ChannelManager to hold several channels and route between them.
4816 * This is the main \"logic hub\" for all channel-related actions, and implements
4817 * ChannelMessageHandler.
4819 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
4821 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
4823 * Users must provide the current blockchain height from which to track onchain channel
4824 * funding outpoints and send payments with reliable timelocks.
4826 * Users need to notify the new ChannelManager when a new block is connected or
4827 * disconnected using its `block_connected` and `block_disconnected` methods.
4829 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);
4832 * Creates a new outbound channel to the given remote node and with the given value.
4834 * user_id will be provided back as user_channel_id in FundingGenerationReady and
4835 * FundingBroadcastSafe events to allow tracking of which events correspond with which
4836 * create_channel call. Note that user_channel_id defaults to 0 for inbound channels, so you
4837 * may wish to avoid using 0 for user_id here.
4839 * If successful, will generate a SendOpenChannel message event, so you should probably poll
4840 * PeerManager::process_events afterwards.
4842 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
4843 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
4845 MUST_USE_RES LDKCResult_NoneAPIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, uint64_t user_id, struct LDKUserConfig override_config);
4848 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
4851 MUST_USE_RES LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *this_arg);
4854 * Gets the list of usable channels, in random order. Useful as an argument to
4855 * get_route to ensure non-announced channels are used.
4857 * These are guaranteed to have their is_live value set to true, see the documentation for
4858 * ChannelDetails::is_live for more info on exactly what the criteria are.
4860 MUST_USE_RES LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *this_arg);
4863 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
4864 * will be accepted on the given channel, and after additional timeout/the closing of all
4865 * pending HTLCs, the channel will be closed on chain.
4867 * May generate a SendShutdown message event on success, which should be relayed.
4869 MUST_USE_RES LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *this_arg, const uint8_t (*channel_id)[32]);
4872 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
4873 * the chain and rejecting new HTLCs on the given channel.
4875 void ChannelManager_force_close_channel(const struct LDKChannelManager *this_arg, const uint8_t (*channel_id)[32]);
4878 * Force close all channels, immediately broadcasting the latest local commitment transaction
4879 * for each to the chain and rejecting new HTLCs on each.
4881 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *this_arg);
4884 * Sends a payment along a given route.
4886 * Value parameters are provided via the last hop in route, see documentation for RouteHop
4887 * fields for more info.
4889 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
4890 * payment), we don't do anything to stop you! We always try to ensure that if the provided
4891 * next hop knows the preimage to payment_hash they can claim an additional amount as
4892 * specified in the last hop in the route! Thus, you should probably do your own
4893 * payment_preimage tracking (which you should already be doing as they represent \"proof of
4894 * payment\") and prevent double-sends yourself.
4896 * May generate SendHTLCs message(s) event on success, which should be relayed.
4898 * Each path may have a different return value, and PaymentSendValue may return a Vec with
4899 * each entry matching the corresponding-index entry in the route paths, see
4900 * PaymentSendFailure for more info.
4902 * In general, a path may raise:
4903 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
4904 * node public key) is specified.
4905 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
4906 * (including due to previous monitor update failure or new permanent monitor update
4908 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
4911 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
4912 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
4913 * different route unless you intend to pay twice!
4915 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
4916 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
4917 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
4918 * must not contain multiple paths as multi-path payments require a recipient-provided
4920 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
4921 * bit set (either as required or as available). If multiple paths are present in the Route,
4922 * we assume the invoice had the basic_mpp feature set.
4924 MUST_USE_RES LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *this_arg, const struct LDKRoute *route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
4927 * Call this upon creation of a funding transaction for the given channel.
4929 * Note that ALL inputs in the transaction pointed to by funding_txo MUST spend SegWit outputs
4930 * or your counterparty can steal your funds!
4932 * Panics if a funding transaction has already been provided for this channel.
4934 * May panic if the funding_txo is duplicative with some other channel (note that this should
4935 * be trivially prevented by using unique funding transaction keys per-channel).
4937 void ChannelManager_funding_transaction_generated(const struct LDKChannelManager *this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKOutPoint funding_txo);
4940 * Generates a signed node_announcement from the given arguments and creates a
4941 * BroadcastNodeAnnouncement event. Note that such messages will be ignored unless peers have
4942 * seen a channel_announcement from us (ie unless we have public channels open).
4944 * RGB is a node \"color\" and alias is a printable human-readable string to describe this node
4945 * to humans. They carry no in-protocol meaning.
4947 * addresses represent the set (possibly empty) of socket addresses on which this node accepts
4948 * incoming connections. These will be broadcast to the network, publicly tying these
4949 * addresses together. If you wish to preserve user privacy, addresses should likely contain
4950 * only Tor Onion addresses.
4952 * Panics if addresses is absurdly large (more than 500).
4954 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, LDKCVec_NetAddressZ addresses);
4957 * Processes HTLCs which are pending waiting on random forward delay.
4959 * Should only really ever be called in response to a PendingHTLCsForwardable event.
4960 * Will likely generate further events.
4962 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *this_arg);
4965 * If a peer is disconnected we mark any channels with that peer as 'disabled'.
4966 * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
4967 * to inform the network about the uselessness of these channels.
4969 * This method handles all the details, and must be called roughly once per minute.
4971 void ChannelManager_timer_chan_freshness_every_min(const struct LDKChannelManager *this_arg);
4974 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
4975 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
4976 * along the path (including in our own channel on which we received it).
4977 * Returns false if no payment was found to fail backwards, true if the process of failing the
4978 * HTLC backwards has been started.
4980 MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *this_arg, const uint8_t (*payment_hash)[32], struct LDKThirtyTwoBytes payment_secret);
4983 * Provides a payment preimage in response to a PaymentReceived event, returning true and
4984 * generating message events for the net layer to claim the payment, if possible. Thus, you
4985 * should probably kick the net layer to go send messages if this returns true!
4987 * You must specify the expected amounts for this HTLC, and we will only claim HTLCs
4988 * available within a few percent of the expected amount. This is critical for several
4989 * reasons : a) it avoids providing senders with `proof-of-payment` (in the form of the
4990 * payment_preimage without having provided the full value and b) it avoids certain
4991 * privacy-breaking recipient-probing attacks which may reveal payment activity to
4992 * motivated attackers.
4994 * Note that the privacy concerns in (b) are not relevant in payments with a payment_secret
4995 * set. Thus, for such payments we will claim any payments which do not under-pay.
4997 * May panic if called except in response to a PaymentReceived event.
4999 MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *this_arg, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret, uint64_t expected_amount);
5002 * Gets the node_id held by this ChannelManager
5004 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *this_arg);
5007 * Restores a single, given channel to normal operation after a
5008 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
5011 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
5012 * fully committed in every copy of the given channels' ChannelMonitors.
5014 * Note that there is no effect to calling with a highest_applied_update_id other than the
5015 * current latest ChannelMonitorUpdate and one call to this function after multiple
5016 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
5017 * exists largely only to prevent races between this and concurrent update_monitor calls.
5019 * Thus, the anticipated use is, at a high level:
5020 * 1) You register a chain::Watch with this ChannelManager,
5021 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
5022 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
5023 * any time it cannot do so instantly,
5024 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
5025 * 4) once all remote copies are updated, you call this function with the update_id that
5026 * completed, and once it is the latest the Channel will be re-enabled.
5028 void ChannelManager_channel_monitor_updated(const struct LDKChannelManager *this_arg, const struct LDKOutPoint *funding_txo, uint64_t highest_applied_update_id);
5030 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *this_arg);
5032 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *this_arg);
5035 * Updates channel state based on transactions seen in a connected block.
5037 void ChannelManager_block_connected(const struct LDKChannelManager *this_arg, const uint8_t (*header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
5040 * Updates channel state based on a disconnected block.
5042 * If necessary, the channel may be force-closed without letting the counterparty participate
5045 void ChannelManager_block_disconnected(const struct LDKChannelManager *this_arg, const uint8_t (*header)[80]);
5047 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *this_arg);
5049 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_ptr);
5052 * The keys provider which will give us relevant keys. Some keys will be loaded during
5053 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
5056 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *this_ptr);
5059 * The keys provider which will give us relevant keys. Some keys will be loaded during
5060 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
5063 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *this_ptr, struct LDKKeysInterface val);
5066 * The fee_estimator for use in the ChannelManager in the future.
5068 * No calls to the FeeEstimator will be made during deserialization.
5070 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *this_ptr);
5073 * The fee_estimator for use in the ChannelManager in the future.
5075 * No calls to the FeeEstimator will be made during deserialization.
5077 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *this_ptr, struct LDKFeeEstimator val);
5080 * The chain::Watch for use in the ChannelManager in the future.
5082 * No calls to the chain::Watch will be made during deserialization. It is assumed that
5083 * you have deserialized ChannelMonitors separately and will add them to your
5084 * chain::Watch after deserializing this ChannelManager.
5086 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *this_ptr);
5089 * The chain::Watch for use in the ChannelManager in the future.
5091 * No calls to the chain::Watch will be made during deserialization. It is assumed that
5092 * you have deserialized ChannelMonitors separately and will add them to your
5093 * chain::Watch after deserializing this ChannelManager.
5095 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *this_ptr, struct LDKWatch val);
5098 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
5099 * used to broadcast the latest local commitment transactions of channels which must be
5100 * force-closed during deserialization.
5102 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *this_ptr);
5105 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
5106 * used to broadcast the latest local commitment transactions of channels which must be
5107 * force-closed during deserialization.
5109 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *this_ptr, struct LDKBroadcasterInterface val);
5112 * The Logger for use in the ChannelManager and which may be used to log information during
5115 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *this_ptr);
5118 * The Logger for use in the ChannelManager and which may be used to log information during
5121 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *this_ptr, struct LDKLogger val);
5124 * Default settings used for new channels. Any existing channels will continue to use the
5125 * runtime settings which were stored when the ChannelManager was serialized.
5127 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *this_ptr);
5130 * Default settings used for new channels. Any existing channels will continue to use the
5131 * runtime settings which were stored when the ChannelManager was serialized.
5133 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *this_ptr, struct LDKUserConfig val);
5136 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
5137 * HashMap for you. This is primarily useful for C bindings where it is not practical to
5138 * populate a HashMap directly from C.
5140 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, LDKCVec_ChannelMonitorZ channel_monitors);
5142 void DecodeError_free(struct LDKDecodeError this_ptr);
5144 void Init_free(struct LDKInit this_ptr);
5146 struct LDKInit Init_clone(const struct LDKInit *orig);
5148 void ErrorMessage_free(struct LDKErrorMessage this_ptr);
5150 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *orig);
5153 * The channel ID involved in the error
5155 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *this_ptr))[32];
5158 * The channel ID involved in the error
5160 void ErrorMessage_set_channel_id(struct LDKErrorMessage *this_ptr, struct LDKThirtyTwoBytes val);
5163 * A possibly human-readable error description.
5164 * The string should be sanitized before it is used (e.g. emitted to logs
5165 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
5166 * vulnerability in the terminal emulator or the logging subsystem.
5168 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *this_ptr);
5171 * A possibly human-readable error description.
5172 * The string should be sanitized before it is used (e.g. emitted to logs
5173 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
5174 * vulnerability in the terminal emulator or the logging subsystem.
5176 void ErrorMessage_set_data(struct LDKErrorMessage *this_ptr, LDKCVec_u8Z val);
5178 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, LDKCVec_u8Z data_arg);
5180 void Ping_free(struct LDKPing this_ptr);
5182 struct LDKPing Ping_clone(const struct LDKPing *orig);
5185 * The desired response length
5187 uint16_t Ping_get_ponglen(const struct LDKPing *this_ptr);
5190 * The desired response length
5192 void Ping_set_ponglen(struct LDKPing *this_ptr, uint16_t val);
5195 * The ping packet size.
5196 * This field is not sent on the wire. byteslen zeros are sent.
5198 uint16_t Ping_get_byteslen(const struct LDKPing *this_ptr);
5201 * The ping packet size.
5202 * This field is not sent on the wire. byteslen zeros are sent.
5204 void Ping_set_byteslen(struct LDKPing *this_ptr, uint16_t val);
5206 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
5208 void Pong_free(struct LDKPong this_ptr);
5210 struct LDKPong Pong_clone(const struct LDKPong *orig);
5213 * The pong packet size.
5214 * This field is not sent on the wire. byteslen zeros are sent.
5216 uint16_t Pong_get_byteslen(const struct LDKPong *this_ptr);
5219 * The pong packet size.
5220 * This field is not sent on the wire. byteslen zeros are sent.
5222 void Pong_set_byteslen(struct LDKPong *this_ptr, uint16_t val);
5224 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
5226 void OpenChannel_free(struct LDKOpenChannel this_ptr);
5228 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *orig);
5231 * The genesis hash of the blockchain where the channel is to be opened
5233 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *this_ptr))[32];
5236 * The genesis hash of the blockchain where the channel is to be opened
5238 void OpenChannel_set_chain_hash(struct LDKOpenChannel *this_ptr, struct LDKThirtyTwoBytes val);
5241 * A temporary channel ID, until the funding outpoint is announced
5243 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *this_ptr))[32];
5246 * A temporary channel ID, until the funding outpoint is announced
5248 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *this_ptr, struct LDKThirtyTwoBytes val);
5253 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *this_ptr);
5258 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *this_ptr, uint64_t val);
5261 * The amount to push to the counterparty as part of the open, in milli-satoshi
5263 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *this_ptr);
5266 * The amount to push to the counterparty as part of the open, in milli-satoshi
5268 void OpenChannel_set_push_msat(struct LDKOpenChannel *this_ptr, uint64_t val);
5271 * The threshold below which outputs on transactions broadcast by sender will be omitted
5273 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *this_ptr);
5276 * The threshold below which outputs on transactions broadcast by sender will be omitted
5278 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *this_ptr, uint64_t val);
5281 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
5283 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *this_ptr);
5286 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
5288 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *this_ptr, uint64_t val);
5291 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
5293 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *this_ptr);
5296 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
5298 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *this_ptr, uint64_t val);
5301 * The minimum HTLC size incoming to sender, in milli-satoshi
5303 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *this_ptr);
5306 * The minimum HTLC size incoming to sender, in milli-satoshi
5308 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *this_ptr, uint64_t val);
5311 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
5313 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *this_ptr);
5316 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
5318 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *this_ptr, uint32_t val);
5321 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
5323 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *this_ptr);
5326 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
5328 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *this_ptr, uint16_t val);
5331 * The maximum number of inbound HTLCs towards sender
5333 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *this_ptr);
5336 * The maximum number of inbound HTLCs towards sender
5338 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *this_ptr, uint16_t val);
5341 * The sender's key controlling the funding transaction
5343 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *this_ptr);
5346 * The sender's key controlling the funding transaction
5348 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *this_ptr, struct LDKPublicKey val);
5351 * Used to derive a revocation key for transactions broadcast by counterparty
5353 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *this_ptr);
5356 * Used to derive a revocation key for transactions broadcast by counterparty
5358 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *this_ptr, struct LDKPublicKey val);
5361 * A payment key to sender for transactions broadcast by counterparty
5363 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *this_ptr);
5366 * A payment key to sender for transactions broadcast by counterparty
5368 void OpenChannel_set_payment_point(struct LDKOpenChannel *this_ptr, struct LDKPublicKey val);
5371 * Used to derive a payment key to sender for transactions broadcast by sender
5373 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *this_ptr);
5376 * Used to derive a payment key to sender for transactions broadcast by sender
5378 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *this_ptr, struct LDKPublicKey val);
5381 * Used to derive an HTLC payment key to sender
5383 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *this_ptr);
5386 * Used to derive an HTLC payment key to sender
5388 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *this_ptr, struct LDKPublicKey val);
5391 * The first to-be-broadcast-by-sender transaction's per commitment point
5393 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *this_ptr);
5396 * The first to-be-broadcast-by-sender transaction's per commitment point
5398 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *this_ptr, struct LDKPublicKey val);
5403 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *this_ptr);
5408 void OpenChannel_set_channel_flags(struct LDKOpenChannel *this_ptr, uint8_t val);
5410 void AcceptChannel_free(struct LDKAcceptChannel this_ptr);
5412 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *orig);
5415 * A temporary channel ID, until the funding outpoint is announced
5417 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *this_ptr))[32];
5420 * A temporary channel ID, until the funding outpoint is announced
5422 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *this_ptr, struct LDKThirtyTwoBytes val);
5425 * The threshold below which outputs on transactions broadcast by sender will be omitted
5427 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *this_ptr);
5430 * The threshold below which outputs on transactions broadcast by sender will be omitted
5432 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *this_ptr, uint64_t val);
5435 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
5437 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *this_ptr);
5440 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
5442 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *this_ptr, uint64_t val);
5445 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
5447 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *this_ptr);
5450 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
5452 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *this_ptr, uint64_t val);
5455 * The minimum HTLC size incoming to sender, in milli-satoshi
5457 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *this_ptr);
5460 * The minimum HTLC size incoming to sender, in milli-satoshi
5462 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *this_ptr, uint64_t val);
5465 * Minimum depth of the funding transaction before the channel is considered open
5467 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *this_ptr);
5470 * Minimum depth of the funding transaction before the channel is considered open
5472 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *this_ptr, uint32_t val);
5475 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
5477 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *this_ptr);
5480 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
5482 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *this_ptr, uint16_t val);
5485 * The maximum number of inbound HTLCs towards sender
5487 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *this_ptr);
5490 * The maximum number of inbound HTLCs towards sender
5492 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *this_ptr, uint16_t val);
5495 * The sender's key controlling the funding transaction
5497 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *this_ptr);
5500 * The sender's key controlling the funding transaction
5502 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *this_ptr, struct LDKPublicKey val);
5505 * Used to derive a revocation key for transactions broadcast by counterparty
5507 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *this_ptr);
5510 * Used to derive a revocation key for transactions broadcast by counterparty
5512 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *this_ptr, struct LDKPublicKey val);
5515 * A payment key to sender for transactions broadcast by counterparty
5517 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *this_ptr);
5520 * A payment key to sender for transactions broadcast by counterparty
5522 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *this_ptr, struct LDKPublicKey val);
5525 * Used to derive a payment key to sender for transactions broadcast by sender
5527 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *this_ptr);
5530 * Used to derive a payment key to sender for transactions broadcast by sender
5532 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *this_ptr, struct LDKPublicKey val);
5535 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
5537 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *this_ptr);
5540 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
5542 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *this_ptr, struct LDKPublicKey val);
5545 * The first to-be-broadcast-by-sender transaction's per commitment point
5547 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *this_ptr);
5550 * The first to-be-broadcast-by-sender transaction's per commitment point
5552 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *this_ptr, struct LDKPublicKey val);
5554 void FundingCreated_free(struct LDKFundingCreated this_ptr);
5556 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *orig);
5559 * A temporary channel ID, until the funding is established
5561 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *this_ptr))[32];
5564 * A temporary channel ID, until the funding is established
5566 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *this_ptr, struct LDKThirtyTwoBytes val);
5569 * The funding transaction ID
5571 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *this_ptr))[32];
5574 * The funding transaction ID
5576 void FundingCreated_set_funding_txid(struct LDKFundingCreated *this_ptr, struct LDKThirtyTwoBytes val);
5579 * The specific output index funding this channel
5581 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *this_ptr);
5584 * The specific output index funding this channel
5586 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *this_ptr, uint16_t val);
5589 * The signature of the channel initiator (funder) on the funding transaction
5591 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *this_ptr);
5594 * The signature of the channel initiator (funder) on the funding transaction
5596 void FundingCreated_set_signature(struct LDKFundingCreated *this_ptr, struct LDKSignature val);
5598 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);
5600 void FundingSigned_free(struct LDKFundingSigned this_ptr);
5602 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *orig);
5607 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *this_ptr))[32];
5612 void FundingSigned_set_channel_id(struct LDKFundingSigned *this_ptr, struct LDKThirtyTwoBytes val);
5615 * The signature of the channel acceptor (fundee) on the funding transaction
5617 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *this_ptr);
5620 * The signature of the channel acceptor (fundee) on the funding transaction
5622 void FundingSigned_set_signature(struct LDKFundingSigned *this_ptr, struct LDKSignature val);
5624 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
5626 void FundingLocked_free(struct LDKFundingLocked this_ptr);
5628 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *orig);
5633 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *this_ptr))[32];
5638 void FundingLocked_set_channel_id(struct LDKFundingLocked *this_ptr, struct LDKThirtyTwoBytes val);
5641 * The per-commitment point of the second commitment transaction
5643 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *this_ptr);
5646 * The per-commitment point of the second commitment transaction
5648 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *this_ptr, struct LDKPublicKey val);
5650 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
5652 void Shutdown_free(struct LDKShutdown this_ptr);
5654 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *orig);
5659 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *this_ptr))[32];
5664 void Shutdown_set_channel_id(struct LDKShutdown *this_ptr, struct LDKThirtyTwoBytes val);
5667 * The destination of this peer's funds on closing.
5668 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
5670 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *this_ptr);
5673 * The destination of this peer's funds on closing.
5674 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
5676 void Shutdown_set_scriptpubkey(struct LDKShutdown *this_ptr, LDKCVec_u8Z val);
5678 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, LDKCVec_u8Z scriptpubkey_arg);
5680 void ClosingSigned_free(struct LDKClosingSigned this_ptr);
5682 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *orig);
5687 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *this_ptr))[32];
5692 void ClosingSigned_set_channel_id(struct LDKClosingSigned *this_ptr, struct LDKThirtyTwoBytes val);
5695 * The proposed total fee for the closing transaction
5697 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *this_ptr);
5700 * The proposed total fee for the closing transaction
5702 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *this_ptr, uint64_t val);
5705 * A signature on the closing transaction
5707 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *this_ptr);
5710 * A signature on the closing transaction
5712 void ClosingSigned_set_signature(struct LDKClosingSigned *this_ptr, struct LDKSignature val);
5714 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
5716 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_ptr);
5718 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *orig);
5723 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *this_ptr))[32];
5728 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *this_ptr, struct LDKThirtyTwoBytes val);
5733 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *this_ptr);
5738 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *this_ptr, uint64_t val);
5741 * The HTLC value in milli-satoshi
5743 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *this_ptr);
5746 * The HTLC value in milli-satoshi
5748 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *this_ptr, uint64_t val);
5751 * The payment hash, the pre-image of which controls HTLC redemption
5753 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *this_ptr))[32];
5756 * The payment hash, the pre-image of which controls HTLC redemption
5758 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *this_ptr, struct LDKThirtyTwoBytes val);
5761 * The expiry height of the HTLC
5763 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *this_ptr);
5766 * The expiry height of the HTLC
5768 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *this_ptr, uint32_t val);
5770 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_ptr);
5772 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *orig);
5777 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *this_ptr))[32];
5782 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *this_ptr, struct LDKThirtyTwoBytes val);
5787 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *this_ptr);
5792 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *this_ptr, uint64_t val);
5795 * The pre-image of the payment hash, allowing HTLC redemption
5797 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *this_ptr))[32];
5800 * The pre-image of the payment hash, allowing HTLC redemption
5802 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *this_ptr, struct LDKThirtyTwoBytes val);
5804 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
5806 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_ptr);
5808 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *orig);
5813 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *this_ptr))[32];
5818 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *this_ptr, struct LDKThirtyTwoBytes val);
5823 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *this_ptr);
5828 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *this_ptr, uint64_t val);
5830 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_ptr);
5832 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *orig);
5837 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *this_ptr))[32];
5842 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *this_ptr, struct LDKThirtyTwoBytes val);
5847 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *this_ptr);
5852 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *this_ptr, uint64_t val);
5857 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *this_ptr);
5862 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *this_ptr, uint16_t val);
5864 void CommitmentSigned_free(struct LDKCommitmentSigned this_ptr);
5866 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *orig);
5871 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *this_ptr))[32];
5876 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *this_ptr, struct LDKThirtyTwoBytes val);
5879 * A signature on the commitment transaction
5881 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *this_ptr);
5884 * A signature on the commitment transaction
5886 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *this_ptr, struct LDKSignature val);
5889 * Signatures on the HTLC transactions
5891 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *this_ptr, LDKCVec_SignatureZ val);
5893 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, LDKCVec_SignatureZ htlc_signatures_arg);
5895 void RevokeAndACK_free(struct LDKRevokeAndACK this_ptr);
5897 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *orig);
5902 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *this_ptr))[32];
5907 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *this_ptr, struct LDKThirtyTwoBytes val);
5910 * The secret corresponding to the per-commitment point
5912 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *this_ptr))[32];
5915 * The secret corresponding to the per-commitment point
5917 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *this_ptr, struct LDKThirtyTwoBytes val);
5920 * The next sender-broadcast commitment transaction's per-commitment point
5922 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *this_ptr);
5925 * The next sender-broadcast commitment transaction's per-commitment point
5927 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *this_ptr, struct LDKPublicKey val);
5929 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);
5931 void UpdateFee_free(struct LDKUpdateFee this_ptr);
5933 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *orig);
5938 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *this_ptr))[32];
5943 void UpdateFee_set_channel_id(struct LDKUpdateFee *this_ptr, struct LDKThirtyTwoBytes val);
5946 * Fee rate per 1000-weight of the transaction
5948 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *this_ptr);
5951 * Fee rate per 1000-weight of the transaction
5953 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *this_ptr, uint32_t val);
5955 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
5957 void DataLossProtect_free(struct LDKDataLossProtect this_ptr);
5959 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *orig);
5962 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
5963 * belonging to the recipient
5965 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *this_ptr))[32];
5968 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
5969 * belonging to the recipient
5971 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *this_ptr, struct LDKThirtyTwoBytes val);
5974 * The sender's per-commitment point for their current commitment transaction
5976 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *this_ptr);
5979 * The sender's per-commitment point for their current commitment transaction
5981 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *this_ptr, struct LDKPublicKey val);
5983 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
5985 void ChannelReestablish_free(struct LDKChannelReestablish this_ptr);
5987 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *orig);
5992 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *this_ptr))[32];
5997 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *this_ptr, struct LDKThirtyTwoBytes val);
6000 * The next commitment number for the sender
6002 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *this_ptr);
6005 * The next commitment number for the sender
6007 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *this_ptr, uint64_t val);
6010 * The next commitment number for the recipient
6012 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *this_ptr);
6015 * The next commitment number for the recipient
6017 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *this_ptr, uint64_t val);
6019 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_ptr);
6021 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *orig);
6026 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *this_ptr))[32];
6031 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *this_ptr, struct LDKThirtyTwoBytes val);
6034 * The short channel ID
6036 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *this_ptr);
6039 * The short channel ID
6041 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *this_ptr, uint64_t val);
6044 * A signature by the node key
6046 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *this_ptr);
6049 * A signature by the node key
6051 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *this_ptr, struct LDKSignature val);
6054 * A signature by the funding key
6056 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *this_ptr);
6059 * A signature by the funding key
6061 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *this_ptr, struct LDKSignature val);
6063 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);
6065 void NetAddress_free(struct LDKNetAddress this_ptr);
6067 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *orig);
6069 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_ptr);
6071 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *orig);
6074 * The advertised features
6076 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *this_ptr);
6079 * The advertised features
6081 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *this_ptr, struct LDKNodeFeatures val);
6084 * A strictly monotonic announcement counter, with gaps allowed
6086 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *this_ptr);
6089 * A strictly monotonic announcement counter, with gaps allowed
6091 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *this_ptr, uint32_t val);
6094 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
6097 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *this_ptr);
6100 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
6103 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *this_ptr, struct LDKPublicKey val);
6106 * An RGB color for UI purposes
6108 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *this_ptr))[3];
6111 * An RGB color for UI purposes
6113 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *this_ptr, struct LDKThreeBytes val);
6116 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
6119 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *this_ptr))[32];
6122 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
6125 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *this_ptr, struct LDKThirtyTwoBytes val);
6128 * List of addresses on which this node is reachable
6130 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *this_ptr, LDKCVec_NetAddressZ val);
6132 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_ptr);
6134 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *orig);
6137 * The signature by the node key
6139 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *this_ptr);
6142 * The signature by the node key
6144 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *this_ptr, struct LDKSignature val);
6147 * The actual content of the announcement
6149 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *this_ptr);
6152 * The actual content of the announcement
6154 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *this_ptr, struct LDKUnsignedNodeAnnouncement val);
6156 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
6158 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_ptr);
6160 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *orig);
6163 * The advertised channel features
6165 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *this_ptr);
6168 * The advertised channel features
6170 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *this_ptr, struct LDKChannelFeatures val);
6173 * The genesis hash of the blockchain where the channel is to be opened
6175 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *this_ptr))[32];
6178 * The genesis hash of the blockchain where the channel is to be opened
6180 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *this_ptr, struct LDKThirtyTwoBytes val);
6183 * The short channel ID
6185 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *this_ptr);
6188 * The short channel ID
6190 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *this_ptr, uint64_t val);
6193 * One of the two node_ids which are endpoints of this channel
6195 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *this_ptr);
6198 * One of the two node_ids which are endpoints of this channel
6200 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *this_ptr, struct LDKPublicKey val);
6203 * The other of the two node_ids which are endpoints of this channel
6205 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *this_ptr);
6208 * The other of the two node_ids which are endpoints of this channel
6210 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *this_ptr, struct LDKPublicKey val);
6213 * The funding key for the first node
6215 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *this_ptr);
6218 * The funding key for the first node
6220 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *this_ptr, struct LDKPublicKey val);
6223 * The funding key for the second node
6225 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *this_ptr);
6228 * The funding key for the second node
6230 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *this_ptr, struct LDKPublicKey val);
6232 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_ptr);
6234 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *orig);
6237 * Authentication of the announcement by the first public node
6239 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *this_ptr);
6242 * Authentication of the announcement by the first public node
6244 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *this_ptr, struct LDKSignature val);
6247 * Authentication of the announcement by the second public node
6249 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *this_ptr);
6252 * Authentication of the announcement by the second public node
6254 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *this_ptr, struct LDKSignature val);
6257 * Proof of funding UTXO ownership by the first public node
6259 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *this_ptr);
6262 * Proof of funding UTXO ownership by the first public node
6264 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *this_ptr, struct LDKSignature val);
6267 * Proof of funding UTXO ownership by the second public node
6269 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *this_ptr);
6272 * Proof of funding UTXO ownership by the second public node
6274 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *this_ptr, struct LDKSignature val);
6277 * The actual announcement
6279 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *this_ptr);
6282 * The actual announcement
6284 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *this_ptr, struct LDKUnsignedChannelAnnouncement val);
6286 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);
6288 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_ptr);
6290 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *orig);
6293 * The genesis hash of the blockchain where the channel is to be opened
6295 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *this_ptr))[32];
6298 * The genesis hash of the blockchain where the channel is to be opened
6300 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *this_ptr, struct LDKThirtyTwoBytes val);
6303 * The short channel ID
6305 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *this_ptr);
6308 * The short channel ID
6310 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *this_ptr, uint64_t val);
6313 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
6315 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *this_ptr);
6318 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
6320 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *this_ptr, uint32_t val);
6325 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *this_ptr);
6330 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *this_ptr, uint8_t val);
6333 * The number of blocks to subtract from incoming HTLC cltv_expiry values
6335 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *this_ptr);
6338 * The number of blocks to subtract from incoming HTLC cltv_expiry values
6340 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *this_ptr, uint16_t val);
6343 * The minimum HTLC size incoming to sender, in milli-satoshi
6345 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *this_ptr);
6348 * The minimum HTLC size incoming to sender, in milli-satoshi
6350 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *this_ptr, uint64_t val);
6353 * The base HTLC fee charged by sender, in milli-satoshi
6355 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *this_ptr);
6358 * The base HTLC fee charged by sender, in milli-satoshi
6360 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *this_ptr, uint32_t val);
6363 * The amount to fee multiplier, in micro-satoshi
6365 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *this_ptr);
6368 * The amount to fee multiplier, in micro-satoshi
6370 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *this_ptr, uint32_t val);
6372 void ChannelUpdate_free(struct LDKChannelUpdate this_ptr);
6374 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *orig);
6377 * A signature of the channel update
6379 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *this_ptr);
6382 * A signature of the channel update
6384 void ChannelUpdate_set_signature(struct LDKChannelUpdate *this_ptr, struct LDKSignature val);
6387 * The actual channel update
6389 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *this_ptr);
6392 * The actual channel update
6394 void ChannelUpdate_set_contents(struct LDKChannelUpdate *this_ptr, struct LDKUnsignedChannelUpdate val);
6396 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
6398 void QueryChannelRange_free(struct LDKQueryChannelRange this_ptr);
6400 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *orig);
6403 * The genesis hash of the blockchain being queried
6405 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *this_ptr))[32];
6408 * The genesis hash of the blockchain being queried
6410 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *this_ptr, struct LDKThirtyTwoBytes val);
6413 * The height of the first block for the channel UTXOs being queried
6415 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *this_ptr);
6418 * The height of the first block for the channel UTXOs being queried
6420 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *this_ptr, uint32_t val);
6423 * The number of blocks to include in the query results
6425 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *this_ptr);
6428 * The number of blocks to include in the query results
6430 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *this_ptr, uint32_t val);
6432 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
6434 void ReplyChannelRange_free(struct LDKReplyChannelRange this_ptr);
6436 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *orig);
6439 * The genesis hash of the blockchain being queried
6441 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *this_ptr))[32];
6444 * The genesis hash of the blockchain being queried
6446 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *this_ptr, struct LDKThirtyTwoBytes val);
6449 * The height of the first block in the range of the reply
6451 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *this_ptr);
6454 * The height of the first block in the range of the reply
6456 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *this_ptr, uint32_t val);
6459 * The number of blocks included in the range of the reply
6461 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *this_ptr);
6464 * The number of blocks included in the range of the reply
6466 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *this_ptr, uint32_t val);
6469 * Indicates if the query recipient maintains up-to-date channel
6470 * information for the chain_hash
6472 bool ReplyChannelRange_get_full_information(const struct LDKReplyChannelRange *this_ptr);
6475 * Indicates if the query recipient maintains up-to-date channel
6476 * information for the chain_hash
6478 void ReplyChannelRange_set_full_information(struct LDKReplyChannelRange *this_ptr, bool val);
6481 * The short_channel_ids in the channel range
6483 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *this_ptr, LDKCVec_u64Z val);
6485 MUST_USE_RES struct LDKReplyChannelRange ReplyChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg, bool full_information_arg, LDKCVec_u64Z short_channel_ids_arg);
6487 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_ptr);
6489 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *orig);
6492 * The genesis hash of the blockchain being queried
6494 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *this_ptr))[32];
6497 * The genesis hash of the blockchain being queried
6499 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *this_ptr, struct LDKThirtyTwoBytes val);
6502 * The short_channel_ids that are being queried
6504 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *this_ptr, LDKCVec_u64Z val);
6506 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, LDKCVec_u64Z short_channel_ids_arg);
6508 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_ptr);
6510 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *orig);
6513 * The genesis hash of the blockchain that was queried
6515 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *this_ptr))[32];
6518 * The genesis hash of the blockchain that was queried
6520 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *this_ptr, struct LDKThirtyTwoBytes val);
6523 * Indicates if the query recipient maintains up-to-date channel
6524 * information for the chain_hash
6526 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *this_ptr);
6529 * Indicates if the query recipient maintains up-to-date channel
6530 * information for the chain_hash
6532 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *this_ptr, bool val);
6534 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
6536 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_ptr);
6538 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *orig);
6541 * The genesis hash of the blockchain for channel and node information
6543 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *this_ptr))[32];
6546 * The genesis hash of the blockchain for channel and node information
6548 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *this_ptr, struct LDKThirtyTwoBytes val);
6551 * The starting unix timestamp
6553 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *this_ptr);
6556 * The starting unix timestamp
6558 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *this_ptr, uint32_t val);
6561 * The range of information in seconds
6563 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *this_ptr);
6566 * The range of information in seconds
6568 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *this_ptr, uint32_t val);
6570 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
6572 void ErrorAction_free(struct LDKErrorAction this_ptr);
6574 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *orig);
6576 void LightningError_free(struct LDKLightningError this_ptr);
6579 * A human-readable message describing the error
6581 struct LDKStr LightningError_get_err(const struct LDKLightningError *this_ptr);
6584 * A human-readable message describing the error
6586 void LightningError_set_err(struct LDKLightningError *this_ptr, LDKCVec_u8Z val);
6589 * The action which should be taken against the offending peer.
6591 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *this_ptr);
6594 * The action which should be taken against the offending peer.
6596 void LightningError_set_action(struct LDKLightningError *this_ptr, struct LDKErrorAction val);
6598 MUST_USE_RES struct LDKLightningError LightningError_new(LDKCVec_u8Z err_arg, struct LDKErrorAction action_arg);
6600 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_ptr);
6602 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *orig);
6605 * update_add_htlc messages which should be sent
6607 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *this_ptr, LDKCVec_UpdateAddHTLCZ val);
6610 * update_fulfill_htlc messages which should be sent
6612 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *this_ptr, LDKCVec_UpdateFulfillHTLCZ val);
6615 * update_fail_htlc messages which should be sent
6617 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *this_ptr, LDKCVec_UpdateFailHTLCZ val);
6620 * update_fail_malformed_htlc messages which should be sent
6622 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *this_ptr, LDKCVec_UpdateFailMalformedHTLCZ val);
6625 * An update_fee message which should be sent
6627 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *this_ptr);
6630 * An update_fee message which should be sent
6632 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *this_ptr, struct LDKUpdateFee val);
6635 * Finally, the commitment_signed message which should be sent
6637 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *this_ptr);
6640 * Finally, the commitment_signed message which should be sent
6642 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *this_ptr, struct LDKCommitmentSigned val);
6644 MUST_USE_RES struct LDKCommitmentUpdate CommitmentUpdate_new(LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg, LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg, LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg, LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg, struct LDKUpdateFee update_fee_arg, struct LDKCommitmentSigned commitment_signed_arg);
6646 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
6648 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *orig);
6651 * Calls the free function if one is set
6653 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
6656 * Calls the free function if one is set
6658 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
6660 LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *obj);
6662 struct LDKAcceptChannel AcceptChannel_read(struct LDKu8slice ser);
6664 LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *obj);
6666 struct LDKAnnouncementSignatures AnnouncementSignatures_read(struct LDKu8slice ser);
6668 LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *obj);
6670 LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
6672 LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *obj);
6674 struct LDKClosingSigned ClosingSigned_read(struct LDKu8slice ser);
6676 LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *obj);
6678 struct LDKCommitmentSigned CommitmentSigned_read(struct LDKu8slice ser);
6680 LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *obj);
6682 struct LDKFundingCreated FundingCreated_read(struct LDKu8slice ser);
6684 LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *obj);
6686 struct LDKFundingSigned FundingSigned_read(struct LDKu8slice ser);
6688 LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *obj);
6690 struct LDKFundingLocked FundingLocked_read(struct LDKu8slice ser);
6692 LDKCVec_u8Z Init_write(const struct LDKInit *obj);
6694 LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
6696 LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *obj);
6698 struct LDKOpenChannel OpenChannel_read(struct LDKu8slice ser);
6700 LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *obj);
6702 struct LDKRevokeAndACK RevokeAndACK_read(struct LDKu8slice ser);
6704 LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *obj);
6706 struct LDKShutdown Shutdown_read(struct LDKu8slice ser);
6708 LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *obj);
6710 struct LDKUpdateFailHTLC UpdateFailHTLC_read(struct LDKu8slice ser);
6712 LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *obj);
6714 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
6716 LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *obj);
6718 struct LDKUpdateFee UpdateFee_read(struct LDKu8slice ser);
6720 LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *obj);
6722 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_read(struct LDKu8slice ser);
6724 LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *obj);
6726 struct LDKUpdateAddHTLC UpdateAddHTLC_read(struct LDKu8slice ser);
6728 LDKCVec_u8Z Ping_write(const struct LDKPing *obj);
6730 LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
6732 LDKCVec_u8Z Pong_write(const struct LDKPong *obj);
6734 LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
6736 LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *obj);
6738 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
6740 LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *obj);
6742 struct LDKChannelAnnouncement ChannelAnnouncement_read(struct LDKu8slice ser);
6744 LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *obj);
6746 LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
6748 LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *obj);
6750 struct LDKChannelUpdate ChannelUpdate_read(struct LDKu8slice ser);
6752 LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *obj);
6754 LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
6756 LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *obj);
6758 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
6760 LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *obj);
6762 struct LDKNodeAnnouncement NodeAnnouncement_read(struct LDKu8slice ser);
6764 LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
6766 LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *obj);
6768 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
6770 LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *obj);
6772 LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
6774 LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *obj);
6776 LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
6778 LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *obj);
6780 LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
6782 LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *obj);
6784 void MessageHandler_free(struct LDKMessageHandler this_ptr);
6787 * A message handler which handles messages specific to channels. Usually this is just a
6788 * ChannelManager object.
6790 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *this_ptr);
6793 * A message handler which handles messages specific to channels. Usually this is just a
6794 * ChannelManager object.
6796 void MessageHandler_set_chan_handler(struct LDKMessageHandler *this_ptr, struct LDKChannelMessageHandler val);
6799 * A message handler which handles messages updating our knowledge of the network channel
6800 * graph. Usually this is just a NetGraphMsgHandlerMonitor object.
6802 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *this_ptr);
6805 * A message handler which handles messages updating our knowledge of the network channel
6806 * graph. Usually this is just a NetGraphMsgHandlerMonitor object.
6808 void MessageHandler_set_route_handler(struct LDKMessageHandler *this_ptr, struct LDKRoutingMessageHandler val);
6810 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
6812 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *orig);
6815 * Calls the free function if one is set
6817 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
6819 void PeerHandleError_free(struct LDKPeerHandleError this_ptr);
6822 * Used to indicate that we probably can't make any future connections to this peer, implying
6823 * we should go ahead and force-close any channels we have with it.
6825 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *this_ptr);
6828 * Used to indicate that we probably can't make any future connections to this peer, implying
6829 * we should go ahead and force-close any channels we have with it.
6831 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *this_ptr, bool val);
6833 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
6835 void PeerManager_free(struct LDKPeerManager this_ptr);
6838 * Constructs a new PeerManager with the given message handlers and node_id secret key
6839 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
6840 * cryptographically secure random bytes.
6842 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);
6845 * Get the list of node ids for peers which have completed the initial handshake.
6847 * For outbound connections, this will be the same as the their_node_id parameter passed in to
6848 * new_outbound_connection, however entries will only appear once the initial handshake has
6849 * completed and we are sure the remote peer has the private key for the given node_id.
6851 MUST_USE_RES LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *this_arg);
6854 * Indicates a new outbound connection has been established to a node with the given node_id.
6855 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
6856 * descriptor but must disconnect the connection immediately.
6858 * Returns a small number of bytes to send to the remote node (currently always 50).
6860 * Panics if descriptor is duplicative with some other descriptor which has not yet had a
6861 * socket_disconnected().
6863 MUST_USE_RES LDKCResult_CVec_u8ZPeerHandleErrorZ PeerManager_new_outbound_connection(const struct LDKPeerManager *this_arg, struct LDKPublicKey their_node_id, struct LDKSocketDescriptor descriptor);
6866 * Indicates a new inbound connection has been established.
6868 * May refuse the connection by returning an Err, but will never write bytes to the remote end
6869 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
6870 * call socket_disconnected for the new descriptor but must disconnect the connection
6873 * Panics if descriptor is duplicative with some other descriptor which has not yet had
6874 * socket_disconnected called.
6876 MUST_USE_RES LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *this_arg, struct LDKSocketDescriptor descriptor);
6879 * Indicates that there is room to write data to the given socket descriptor.
6881 * May return an Err to indicate that the connection should be closed.
6883 * Will most likely call send_data on the descriptor passed in (or the descriptor handed into
6884 * new_*\\_connection) before returning. Thus, be very careful with reentrancy issues! The
6885 * invariants around calling write_buffer_space_avail in case a write did not fully complete
6886 * must still hold - be ready to call write_buffer_space_avail again if a write call generated
6887 * here isn't sufficient! Panics if the descriptor was not previously registered in a
6888 * new_\\*_connection event.
6890 MUST_USE_RES LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *this_arg, struct LDKSocketDescriptor *descriptor);
6893 * Indicates that data was read from the given socket descriptor.
6895 * May return an Err to indicate that the connection should be closed.
6897 * Will *not* call back into send_data on any descriptors to avoid reentrancy complexity.
6898 * Thus, however, you almost certainly want to call process_events() after any read_event to
6899 * generate send_data calls to handle responses.
6901 * If Ok(true) is returned, further read_events should not be triggered until a send_data call
6902 * on this file descriptor has resume_read set (preventing DoS issues in the send buffer).
6904 * Panics if the descriptor was not previously registered in a new_*_connection event.
6906 MUST_USE_RES LDKCResult_boolPeerHandleErrorZ PeerManager_read_event(const struct LDKPeerManager *this_arg, struct LDKSocketDescriptor *peer_descriptor, struct LDKu8slice data);
6909 * Checks for any events generated by our handlers and processes them. Includes sending most
6910 * response messages as well as messages generated by calls to handler functions directly (eg
6911 * functions like ChannelManager::process_pending_htlc_forward or send_payment).
6913 void PeerManager_process_events(const struct LDKPeerManager *this_arg);
6916 * Indicates that the given socket descriptor's connection is now closed.
6918 * This must only be called if the socket has been disconnected by the peer or your own
6919 * decision to disconnect it and must NOT be called in any case where other parts of this
6920 * library (eg PeerHandleError, explicit disconnect_socket calls) instruct you to disconnect
6923 * Panics if the descriptor was not previously registered in a successful new_*_connection event.
6925 void PeerManager_socket_disconnected(const struct LDKPeerManager *this_arg, const struct LDKSocketDescriptor *descriptor);
6928 * This function should be called roughly once every 30 seconds.
6929 * It will send pings to each peer and disconnect those which did not respond to the last round of pings.
6930 * Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues!
6932 void PeerManager_timer_tick_occured(const struct LDKPeerManager *this_arg);
6935 * Build the commitment secret from the seed and the commitment number
6937 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
6940 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
6941 * from the base secret and the per_commitment_point.
6943 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
6944 * generated (ie our own).
6946 LDKCResult_SecretKeySecpErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
6949 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
6950 * from the base point and the per_commitment_key. This is the public equivalent of
6951 * derive_private_key - using only public keys to derive a public key instead of private keys.
6953 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
6954 * generated (ie our own).
6956 LDKCResult_PublicKeySecpErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
6959 * Derives a per-commitment-transaction revocation key from its constituent parts.
6961 * Only the cheating participant owns a valid witness to propagate a revoked
6962 * commitment transaction, thus per_commitment_secret always come from cheater
6963 * and revocation_base_secret always come from punisher, which is the broadcaster
6964 * of the transaction spending with this key knowledge.
6966 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
6967 * generated (ie our own).
6969 LDKCResult_SecretKeySecpErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
6972 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
6973 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
6974 * public key instead of private keys.
6976 * Only the cheating participant owns a valid witness to propagate a revoked
6977 * commitment transaction, thus per_commitment_point always come from cheater
6978 * and revocation_base_point always come from punisher, which is the broadcaster
6979 * of the transaction spending with this key knowledge.
6981 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
6982 * generated (ie our own).
6984 LDKCResult_PublicKeySecpErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
6986 void TxCreationKeys_free(struct LDKTxCreationKeys this_ptr);
6988 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *orig);
6991 * The broadcaster's per-commitment public key which was used to derive the other keys.
6993 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *this_ptr);
6996 * The broadcaster's per-commitment public key which was used to derive the other keys.
6998 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *this_ptr, struct LDKPublicKey val);
7001 * The revocation key which is used to allow the broadcaster of the commitment
7002 * transaction to provide their counterparty the ability to punish them if they broadcast
7005 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *this_ptr);
7008 * The revocation key which is used to allow the broadcaster of the commitment
7009 * transaction to provide their counterparty the ability to punish them if they broadcast
7012 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *this_ptr, struct LDKPublicKey val);
7015 * Broadcaster's HTLC Key
7017 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *this_ptr);
7020 * Broadcaster's HTLC Key
7022 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *this_ptr, struct LDKPublicKey val);
7025 * Countersignatory's HTLC Key
7027 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *this_ptr);
7030 * Countersignatory's HTLC Key
7032 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *this_ptr, struct LDKPublicKey val);
7035 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
7037 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *this_ptr);
7040 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
7042 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *this_ptr, struct LDKPublicKey val);
7044 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);
7046 LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *obj);
7048 struct LDKTxCreationKeys TxCreationKeys_read(struct LDKu8slice ser);
7050 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_ptr);
7052 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *orig);
7055 * The public key which is used to sign all commitment transactions, as it appears in the
7056 * on-chain channel lock-in 2-of-2 multisig output.
7058 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *this_ptr);
7061 * The public key which is used to sign all commitment transactions, as it appears in the
7062 * on-chain channel lock-in 2-of-2 multisig output.
7064 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *this_ptr, struct LDKPublicKey val);
7067 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
7068 * revocation keys. This is combined with the per-commitment-secret generated by the
7069 * counterparty to create a secret which the counterparty can reveal to revoke previous
7072 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *this_ptr);
7075 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
7076 * revocation keys. This is combined with the per-commitment-secret generated by the
7077 * counterparty to create a secret which the counterparty can reveal to revoke previous
7080 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *this_ptr, struct LDKPublicKey val);
7083 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
7084 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
7085 * static across every commitment transaction.
7087 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *this_ptr);
7090 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
7091 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
7092 * static across every commitment transaction.
7094 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *this_ptr, struct LDKPublicKey val);
7097 * The base point which is used (with derive_public_key) to derive a per-commitment payment
7098 * public key which receives non-HTLC-encumbered funds which are only available for spending
7099 * after some delay (or can be claimed via the revocation path).
7101 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *this_ptr);
7104 * The base point which is used (with derive_public_key) to derive a per-commitment payment
7105 * public key which receives non-HTLC-encumbered funds which are only available for spending
7106 * after some delay (or can be claimed via the revocation path).
7108 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *this_ptr, struct LDKPublicKey val);
7111 * The base point which is used (with derive_public_key) to derive a per-commitment public key
7112 * which is used to encumber HTLC-in-flight outputs.
7114 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *this_ptr);
7117 * The base point which is used (with derive_public_key) to derive a per-commitment public key
7118 * which is used to encumber HTLC-in-flight outputs.
7120 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *this_ptr, struct LDKPublicKey val);
7122 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);
7124 LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *obj);
7126 struct LDKChannelPublicKeys ChannelPublicKeys_read(struct LDKu8slice ser);
7129 * Create per-state keys from channel base points and the per-commitment point.
7130 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
7132 MUST_USE_RES LDKCResult_TxCreationKeysSecpErrorZ 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);
7135 * Generate per-state keys from channel static keys.
7136 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
7138 MUST_USE_RES LDKCResult_TxCreationKeysSecpErrorZ TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *broadcaster_keys, const struct LDKChannelPublicKeys *countersignatory_keys);
7141 * A script either spendable by the revocation
7142 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
7143 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
7145 LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
7147 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_ptr);
7149 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *orig);
7152 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
7153 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
7154 * need to compare this value to whether the commitment transaction in question is that of
7155 * the counterparty or our own.
7157 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *this_ptr);
7160 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
7161 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
7162 * need to compare this value to whether the commitment transaction in question is that of
7163 * the counterparty or our own.
7165 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *this_ptr, bool val);
7168 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
7169 * this divided by 1000.
7171 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *this_ptr);
7174 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
7175 * this divided by 1000.
7177 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *this_ptr, uint64_t val);
7180 * The CLTV lock-time at which this HTLC expires.
7182 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *this_ptr);
7185 * The CLTV lock-time at which this HTLC expires.
7187 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *this_ptr, uint32_t val);
7190 * The hash of the preimage which unlocks this HTLC.
7192 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *this_ptr))[32];
7195 * The hash of the preimage which unlocks this HTLC.
7197 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *this_ptr, struct LDKThirtyTwoBytes val);
7199 LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *obj);
7201 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_read(struct LDKu8slice ser);
7204 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
7205 * does not need to have its previous_output_index filled.
7207 LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *htlc, const struct LDKTxCreationKeys *keys);
7210 * Gets the redeemscript for a funding output from the two funding public keys.
7211 * Note that the order of funding public keys does not matter.
7213 LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
7216 * panics if htlc.transaction_output_index.is_none()!
7218 struct LDKTransaction build_htlc_transaction(const uint8_t (*prev_hash)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *htlc, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
7220 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_ptr);
7222 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *orig);
7225 * Holder public keys
7227 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *this_ptr);
7230 * Holder public keys
7232 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *this_ptr, struct LDKChannelPublicKeys val);
7235 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
7237 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *this_ptr);
7240 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
7242 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *this_ptr, uint16_t val);
7245 * Whether the holder is the initiator of this channel.
7246 * This is an input to the commitment number obscure factor computation.
7248 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *this_ptr);
7251 * Whether the holder is the initiator of this channel.
7252 * This is an input to the commitment number obscure factor computation.
7254 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *this_ptr, bool val);
7257 * The late-bound counterparty channel transaction parameters.
7258 * These parameters are populated at the point in the protocol where the counterparty provides them.
7260 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *this_ptr);
7263 * The late-bound counterparty channel transaction parameters.
7264 * These parameters are populated at the point in the protocol where the counterparty provides them.
7266 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
7269 * The late-bound funding outpoint
7271 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *this_ptr);
7274 * The late-bound funding outpoint
7276 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *this_ptr, struct LDKOutPoint val);
7278 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);
7280 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_ptr);
7282 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *orig);
7285 * Counter-party public keys
7287 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *this_ptr);
7290 * Counter-party public keys
7292 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *this_ptr, struct LDKChannelPublicKeys val);
7295 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
7297 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *this_ptr);
7300 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
7302 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *this_ptr, uint16_t val);
7304 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
7307 * Whether the late bound parameters are populated.
7309 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *this_arg);
7312 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
7313 * given that the holder is the broadcaster.
7315 * self.is_populated() must be true before calling this function.
7317 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *this_arg);
7320 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
7321 * given that the counterparty is the broadcaster.
7323 * self.is_populated() must be true before calling this function.
7325 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *this_arg);
7327 LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *obj);
7329 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
7331 LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *obj);
7333 struct LDKChannelTransactionParameters ChannelTransactionParameters_read(struct LDKu8slice ser);
7335 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_ptr);
7338 * Get the channel pubkeys for the broadcaster
7340 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *this_arg);
7343 * Get the channel pubkeys for the countersignatory
7345 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *this_arg);
7348 * Get the contest delay applicable to the transactions.
7349 * Note that the contest delay was selected by the countersignatory.
7351 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *this_arg);
7354 * Whether the channel is outbound from the broadcaster.
7356 * The boolean representing the side that initiated the channel is
7357 * an input to the commitment number obscure factor computation.
7359 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *this_arg);
7362 * The funding outpoint
7364 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *this_arg);
7366 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_ptr);
7368 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *orig);
7371 * Our counterparty's signature for the transaction
7373 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *this_ptr);
7376 * Our counterparty's signature for the transaction
7378 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *this_ptr, struct LDKSignature val);
7381 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
7383 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *this_ptr, LDKCVec_SignatureZ val);
7385 LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *obj);
7387 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_read(struct LDKu8slice ser);
7390 * Create a new holder transaction with the given counterparty signatures.
7391 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
7393 MUST_USE_RES struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_new(struct LDKCommitmentTransaction commitment_tx, struct LDKSignature counterparty_sig, LDKCVec_SignatureZ counterparty_htlc_sigs, struct LDKPublicKey holder_funding_key, struct LDKPublicKey counterparty_funding_key);
7395 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_ptr);
7397 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *orig);
7400 * The commitment transaction
7402 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *this_ptr);
7405 * The commitment transaction
7407 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *this_ptr, struct LDKTransaction val);
7410 * The txid for the commitment transaction.
7412 * This is provided as a performance optimization, instead of calling transaction.txid()
7415 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *this_ptr))[32];
7418 * The txid for the commitment transaction.
7420 * This is provided as a performance optimization, instead of calling transaction.txid()
7423 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *this_ptr, struct LDKThirtyTwoBytes val);
7425 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
7427 LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *obj);
7429 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_read(struct LDKu8slice ser);
7432 * Get the SIGHASH_ALL sighash value of the transaction.
7434 * This can be used to verify a signature.
7436 MUST_USE_RES struct LDKThirtyTwoBytes BuiltCommitmentTransaction_get_sighash_all(const struct LDKBuiltCommitmentTransaction *this_arg, struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
7439 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
7440 * because we are about to broadcast a holder transaction.
7442 MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign(const struct LDKBuiltCommitmentTransaction *this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
7444 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_ptr);
7446 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *orig);
7448 LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *obj);
7450 struct LDKCommitmentTransaction CommitmentTransaction_read(struct LDKu8slice ser);
7453 * The backwards-counting commitment number
7455 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *this_arg);
7458 * The value to be sent to the broadcaster
7460 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *this_arg);
7463 * The value to be sent to the counterparty
7465 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *this_arg);
7468 * The feerate paid per 1000-weight-unit in this commitment transaction.
7470 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *this_arg);
7473 * Trust our pre-built transaction and derived transaction creation public keys.
7475 * Applies a wrapper which allows access to these fields.
7477 * This should only be used if you fully trust the builder of this object. It should not
7478 *\tbe used by an external signer - instead use the verify function.
7480 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *this_arg);
7483 * Verify our pre-built transaction and derived transaction creation public keys.
7485 * Applies a wrapper which allows access to these fields.
7487 * An external validating signer must call this method before signing
7488 * or using the built transaction.
7490 MUST_USE_RES LDKCResult_TrustedCommitmentTransactionNoneZ CommitmentTransaction_verify(const struct LDKCommitmentTransaction *this_arg, const struct LDKDirectedChannelTransactionParameters *channel_parameters, const struct LDKChannelPublicKeys *broadcaster_keys, const struct LDKChannelPublicKeys *countersignatory_keys);
7492 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_ptr);
7495 * The transaction ID of the built Bitcoin transaction
7497 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *this_arg);
7500 * The pre-built Bitcoin commitment transaction
7502 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *this_arg);
7505 * The pre-calculated transaction creation public keys.
7507 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *this_arg);
7510 * Get a signature for each HTLC which was included in the commitment transaction (ie for
7511 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
7513 * The returned Vec has one entry for each HTLC, and in the same order.
7515 MUST_USE_RES LDKCResult_CVec_SignatureZNoneZ TrustedCommitmentTransaction_get_htlc_sigs(const struct LDKTrustedCommitmentTransaction *this_arg, const uint8_t (*htlc_base_key)[32], const struct LDKDirectedChannelTransactionParameters *channel_parameters);
7518 * Get the transaction number obscure factor
7520 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
7522 void InitFeatures_free(struct LDKInitFeatures this_ptr);
7524 void NodeFeatures_free(struct LDKNodeFeatures this_ptr);
7526 void ChannelFeatures_free(struct LDKChannelFeatures this_ptr);
7528 void RouteHop_free(struct LDKRouteHop this_ptr);
7530 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *orig);
7533 * The node_id of the node at this hop.
7535 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *this_ptr);
7538 * The node_id of the node at this hop.
7540 void RouteHop_set_pubkey(struct LDKRouteHop *this_ptr, struct LDKPublicKey val);
7543 * The node_announcement features of the node at this hop. For the last hop, these may be
7544 * amended to match the features present in the invoice this node generated.
7546 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *this_ptr);
7549 * The node_announcement features of the node at this hop. For the last hop, these may be
7550 * amended to match the features present in the invoice this node generated.
7552 void RouteHop_set_node_features(struct LDKRouteHop *this_ptr, struct LDKNodeFeatures val);
7555 * The channel that should be used from the previous hop to reach this node.
7557 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *this_ptr);
7560 * The channel that should be used from the previous hop to reach this node.
7562 void RouteHop_set_short_channel_id(struct LDKRouteHop *this_ptr, uint64_t val);
7565 * The channel_announcement features of the channel that should be used from the previous hop
7566 * to reach this node.
7568 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *this_ptr);
7571 * The channel_announcement features of the channel that should be used from the previous hop
7572 * to reach this node.
7574 void RouteHop_set_channel_features(struct LDKRouteHop *this_ptr, struct LDKChannelFeatures val);
7577 * The fee taken on this hop. For the last hop, this should be the full value of the payment.
7579 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *this_ptr);
7582 * The fee taken on this hop. For the last hop, this should be the full value of the payment.
7584 void RouteHop_set_fee_msat(struct LDKRouteHop *this_ptr, uint64_t val);
7587 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
7588 * expected at the destination, in excess of the current block height.
7590 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *this_ptr);
7593 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
7594 * expected at the destination, in excess of the current block height.
7596 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *this_ptr, uint32_t val);
7598 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);
7600 void Route_free(struct LDKRoute this_ptr);
7602 struct LDKRoute Route_clone(const struct LDKRoute *orig);
7605 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
7606 * last RouteHop in each path must be the same.
7607 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
7608 * destination. Thus, this must always be at least length one. While the maximum length of any
7609 * given path is variable, keeping the length of any path to less than 20 should currently
7610 * ensure it is viable.
7612 void Route_set_paths(struct LDKRoute *this_ptr, LDKCVec_CVec_RouteHopZZ val);
7614 MUST_USE_RES struct LDKRoute Route_new(LDKCVec_CVec_RouteHopZZ paths_arg);
7616 LDKCVec_u8Z Route_write(const struct LDKRoute *obj);
7618 LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
7620 void RouteHint_free(struct LDKRouteHint this_ptr);
7622 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *orig);
7625 * The node_id of the non-target end of the route
7627 struct LDKPublicKey RouteHint_get_src_node_id(const struct LDKRouteHint *this_ptr);
7630 * The node_id of the non-target end of the route
7632 void RouteHint_set_src_node_id(struct LDKRouteHint *this_ptr, struct LDKPublicKey val);
7635 * The short_channel_id of this channel
7637 uint64_t RouteHint_get_short_channel_id(const struct LDKRouteHint *this_ptr);
7640 * The short_channel_id of this channel
7642 void RouteHint_set_short_channel_id(struct LDKRouteHint *this_ptr, uint64_t val);
7645 * The fees which must be paid to use this channel
7647 struct LDKRoutingFees RouteHint_get_fees(const struct LDKRouteHint *this_ptr);
7650 * The fees which must be paid to use this channel
7652 void RouteHint_set_fees(struct LDKRouteHint *this_ptr, struct LDKRoutingFees val);
7655 * The difference in CLTV values between this node and the next node.
7657 uint16_t RouteHint_get_cltv_expiry_delta(const struct LDKRouteHint *this_ptr);
7660 * The difference in CLTV values between this node and the next node.
7662 void RouteHint_set_cltv_expiry_delta(struct LDKRouteHint *this_ptr, uint16_t val);
7665 * The minimum value, in msat, which must be relayed to the next hop.
7667 uint64_t RouteHint_get_htlc_minimum_msat(const struct LDKRouteHint *this_ptr);
7670 * The minimum value, in msat, which must be relayed to the next hop.
7672 void RouteHint_set_htlc_minimum_msat(struct LDKRouteHint *this_ptr, uint64_t val);
7674 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);
7677 * Gets a route from us to the given target node.
7679 * Extra routing hops between known nodes and the target will be used if they are included in
7682 * If some channels aren't announced, it may be useful to fill in a first_hops with the
7683 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
7684 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those in first_hops
7687 * Panics if first_hops contains channels without short_channel_ids
7688 * (ChannelManager::list_usable_channels will never include such channels).
7690 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
7691 * equal), however the enabled/disabled bit on such channels as well as the htlc_minimum_msat
7692 * *is* checked as they may change based on the receiving node.
7694 LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *network, struct LDKPublicKey target, LDKCVec_ChannelDetailsZ *first_hops, LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
7696 void NetworkGraph_free(struct LDKNetworkGraph this_ptr);
7698 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_ptr);
7700 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_ptr);
7703 * Creates a new tracker of the actual state of the network of channels and nodes,
7704 * assuming a fresh network graph.
7705 * Chain monitor is used to make sure announced channels exist on-chain,
7706 * channel data is correct, and that the announcement is signed with
7707 * channel owners' keys.
7709 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
7712 * Creates a new tracker of the actual state of the network of channels and nodes,
7713 * assuming an existing Network Graph.
7715 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
7718 * Take a read lock on the network_graph and return it in the C-bindings
7719 * newtype helper. This is likely only useful when called via the C
7720 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
7723 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *this_arg);
7726 * Get a reference to the NetworkGraph which this read-lock contains.
7728 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *this_arg);
7730 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *this_arg);
7732 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *this_arg);
7734 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_ptr);
7737 * When the last update to the channel direction was issued.
7738 * Value is opaque, as set in the announcement.
7740 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *this_ptr);
7743 * When the last update to the channel direction was issued.
7744 * Value is opaque, as set in the announcement.
7746 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *this_ptr, uint32_t val);
7749 * Whether the channel can be currently used for payments (in this one direction).
7751 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *this_ptr);
7754 * Whether the channel can be currently used for payments (in this one direction).
7756 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *this_ptr, bool val);
7759 * The difference in CLTV values that you must have when routing through this channel.
7761 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *this_ptr);
7764 * The difference in CLTV values that you must have when routing through this channel.
7766 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *this_ptr, uint16_t val);
7769 * The minimum value, which must be relayed to the next hop via the channel
7771 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *this_ptr);
7774 * The minimum value, which must be relayed to the next hop via the channel
7776 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *this_ptr, uint64_t val);
7779 * Fees charged when the channel is used for routing
7781 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *this_ptr);
7784 * Fees charged when the channel is used for routing
7786 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *this_ptr, struct LDKRoutingFees val);
7789 * Most recent update for the channel received from the network
7790 * Mostly redundant with the data we store in fields explicitly.
7791 * Everything else is useful only for sending out for initial routing sync.
7792 * Not stored if contains excess data to prevent DoS.
7794 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *this_ptr);
7797 * Most recent update for the channel received from the network
7798 * Mostly redundant with the data we store in fields explicitly.
7799 * Everything else is useful only for sending out for initial routing sync.
7800 * Not stored if contains excess data to prevent DoS.
7802 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *this_ptr, struct LDKChannelUpdate val);
7804 LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *obj);
7806 struct LDKDirectionalChannelInfo DirectionalChannelInfo_read(struct LDKu8slice ser);
7808 void ChannelInfo_free(struct LDKChannelInfo this_ptr);
7811 * Protocol features of a channel communicated during its announcement
7813 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *this_ptr);
7816 * Protocol features of a channel communicated during its announcement
7818 void ChannelInfo_set_features(struct LDKChannelInfo *this_ptr, struct LDKChannelFeatures val);
7821 * Source node of the first direction of a channel
7823 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *this_ptr);
7826 * Source node of the first direction of a channel
7828 void ChannelInfo_set_node_one(struct LDKChannelInfo *this_ptr, struct LDKPublicKey val);
7831 * Details about the first direction of a channel
7833 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *this_ptr);
7836 * Details about the first direction of a channel
7838 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *this_ptr, struct LDKDirectionalChannelInfo val);
7841 * Source node of the second direction of a channel
7843 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *this_ptr);
7846 * Source node of the second direction of a channel
7848 void ChannelInfo_set_node_two(struct LDKChannelInfo *this_ptr, struct LDKPublicKey val);
7851 * Details about the second direction of a channel
7853 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *this_ptr);
7856 * Details about the second direction of a channel
7858 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *this_ptr, struct LDKDirectionalChannelInfo val);
7861 * An initial announcement of the channel
7862 * Mostly redundant with the data we store in fields explicitly.
7863 * Everything else is useful only for sending out for initial routing sync.
7864 * Not stored if contains excess data to prevent DoS.
7866 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *this_ptr);
7869 * An initial announcement of the channel
7870 * Mostly redundant with the data we store in fields explicitly.
7871 * Everything else is useful only for sending out for initial routing sync.
7872 * Not stored if contains excess data to prevent DoS.
7874 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *this_ptr, struct LDKChannelAnnouncement val);
7876 LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *obj);
7878 struct LDKChannelInfo ChannelInfo_read(struct LDKu8slice ser);
7880 void RoutingFees_free(struct LDKRoutingFees this_ptr);
7882 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *orig);
7885 * Flat routing fee in satoshis
7887 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *this_ptr);
7890 * Flat routing fee in satoshis
7892 void RoutingFees_set_base_msat(struct LDKRoutingFees *this_ptr, uint32_t val);
7895 * Liquidity-based routing fee in millionths of a routed amount.
7896 * In other words, 10000 is 1%.
7898 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *this_ptr);
7901 * Liquidity-based routing fee in millionths of a routed amount.
7902 * In other words, 10000 is 1%.
7904 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *this_ptr, uint32_t val);
7906 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
7908 LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
7910 LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *obj);
7912 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_ptr);
7915 * Protocol features the node announced support for
7917 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *this_ptr);
7920 * Protocol features the node announced support for
7922 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *this_ptr, struct LDKNodeFeatures val);
7925 * When the last known update to the node state was issued.
7926 * Value is opaque, as set in the announcement.
7928 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *this_ptr);
7931 * When the last known update to the node state was issued.
7932 * Value is opaque, as set in the announcement.
7934 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *this_ptr, uint32_t val);
7937 * Color assigned to the node
7939 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *this_ptr))[3];
7942 * Color assigned to the node
7944 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *this_ptr, struct LDKThreeBytes val);
7947 * Moniker assigned to the node.
7948 * May be invalid or malicious (eg control chars),
7949 * should not be exposed to the user.
7951 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *this_ptr))[32];
7954 * Moniker assigned to the node.
7955 * May be invalid or malicious (eg control chars),
7956 * should not be exposed to the user.
7958 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *this_ptr, struct LDKThirtyTwoBytes val);
7961 * Internet-level addresses via which one can connect to the node
7963 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *this_ptr, LDKCVec_NetAddressZ val);
7966 * An initial announcement of the node
7967 * Mostly redundant with the data we store in fields explicitly.
7968 * Everything else is useful only for sending out for initial routing sync.
7969 * Not stored if contains excess data to prevent DoS.
7971 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *this_ptr);
7974 * An initial announcement of the node
7975 * Mostly redundant with the data we store in fields explicitly.
7976 * Everything else is useful only for sending out for initial routing sync.
7977 * Not stored if contains excess data to prevent DoS.
7979 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *this_ptr, struct LDKNodeAnnouncement val);
7981 MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKThirtyTwoBytes alias_arg, LDKCVec_NetAddressZ addresses_arg, struct LDKNodeAnnouncement announcement_message_arg);
7983 LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *obj);
7985 LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
7987 void NodeInfo_free(struct LDKNodeInfo this_ptr);
7990 * All valid channels a node has announced
7992 void NodeInfo_set_channels(struct LDKNodeInfo *this_ptr, LDKCVec_u64Z val);
7995 * Lowest fees enabling routing via any of the enabled, known channels to a node.
7996 * The two fields (flat and proportional fee) are independent,
7997 * meaning they don't have to refer to the same channel.
7999 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *this_ptr);
8002 * Lowest fees enabling routing via any of the enabled, known channels to a node.
8003 * The two fields (flat and proportional fee) are independent,
8004 * meaning they don't have to refer to the same channel.
8006 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *this_ptr, struct LDKRoutingFees val);
8009 * More information about a node from node_announcement.
8010 * Optional because we store a Node entry after learning about it from
8011 * a channel announcement, but before receiving a node announcement.
8013 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *this_ptr);
8016 * More information about a node from node_announcement.
8017 * Optional because we store a Node entry after learning about it from
8018 * a channel announcement, but before receiving a node announcement.
8020 void NodeInfo_set_announcement_info(struct LDKNodeInfo *this_ptr, struct LDKNodeAnnouncementInfo val);
8022 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
8024 LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *obj);
8026 LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
8028 LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *obj);
8030 LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
8033 * Creates a new, empty, network graph.
8035 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
8038 * For an already known node (from channel announcements), update its stored properties from a
8039 * given node announcement.
8041 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
8042 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
8043 * routing messages from a source using a protocol other than the lightning P2P protocol.
8045 MUST_USE_RES LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *this_arg, const struct LDKNodeAnnouncement *msg);
8048 * For an already known node (from channel announcements), update its stored properties from a
8049 * given node announcement without verifying the associated signatures. Because we aren't
8050 * given the associated signatures here we cannot relay the node announcement to any of our
8053 MUST_USE_RES LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *this_arg, const struct LDKUnsignedNodeAnnouncement *msg);
8056 * Store or update channel info from a channel announcement.
8058 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
8059 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
8060 * routing messages from a source using a protocol other than the lightning P2P protocol.
8062 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
8063 * the corresponding UTXO exists on chain and is correctly-formatted.
8065 MUST_USE_RES LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(struct LDKNetworkGraph *this_arg, const struct LDKChannelAnnouncement *msg, struct LDKAccess *chain_access);
8068 * Store or update channel info from a channel announcement without verifying the associated
8069 * signatures. Because we aren't given the associated signatures here we cannot relay the
8070 * channel announcement to any of our peers.
8072 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
8073 * the corresponding UTXO exists on chain and is correctly-formatted.
8075 MUST_USE_RES LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(struct LDKNetworkGraph *this_arg, const struct LDKUnsignedChannelAnnouncement *msg, struct LDKAccess *chain_access);
8078 * Close a channel if a corresponding HTLC fail was sent.
8079 * If permanent, removes a channel from the local storage.
8080 * May cause the removal of nodes too, if this was their last channel.
8081 * If not permanent, makes channels unavailable for routing.
8083 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *this_arg, uint64_t short_channel_id, bool is_permanent);
8086 * For an already known (from announcement) channel, update info about one of the directions
8089 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
8090 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
8091 * routing messages from a source using a protocol other than the lightning P2P protocol.
8093 MUST_USE_RES LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *this_arg, const struct LDKChannelUpdate *msg);
8096 * For an already known (from announcement) channel, update info about one of the directions
8097 * of the channel without verifying the associated signatures. Because we aren't given the
8098 * associated signatures here we cannot relay the channel update to any of our peers.
8100 MUST_USE_RES LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *this_arg, const struct LDKUnsignedChannelUpdate *msg);
8102 /* Text to put at the end of the generated file */