Merge pull request #126 from TheBlueMatt/main
[ldk-c-bindings] / lightning-c-bindings / include / lightning.h
1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
3
4 /* Generated with cbindgen:0.24.5 */
5
6 /* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */
7
8 #include <stdarg.h>
9 #include <stdbool.h>
10 #include <stdint.h>
11 #include "ldk_rust_types.h"
12
13 /**
14  * Whether this blinded HTLC is being failed backwards by the introduction node or a blinded node,
15  * which determines the failure message that should be used.
16  */
17 typedef enum LDKBlindedFailure {
18    /**
19     * This HTLC is being failed backwards by the introduction node, and thus should be failed with
20     * [`msgs::UpdateFailHTLC`] and error code `0x8000|0x4000|24`.
21     */
22    LDKBlindedFailure_FromIntroductionNode,
23    /**
24     * This HTLC is being failed backwards by a blinded node within the path, and thus should be
25     * failed with [`msgs::UpdateFailMalformedHTLC`] and error code `0x8000|0x4000|24`.
26     */
27    LDKBlindedFailure_FromBlindedNode,
28    /**
29     * Must be last for serialization purposes
30     */
31    LDKBlindedFailure_Sentinel,
32 } LDKBlindedFailure;
33
34 /**
35  * Errors that may occur when converting a [`RawBolt11Invoice`] to a [`Bolt11Invoice`]. They relate to
36  * the requirements sections in BOLT #11
37  */
38 typedef enum LDKBolt11SemanticError {
39    /**
40     * The invoice is missing the mandatory payment hash
41     */
42    LDKBolt11SemanticError_NoPaymentHash,
43    /**
44     * The invoice has multiple payment hashes which isn't allowed
45     */
46    LDKBolt11SemanticError_MultiplePaymentHashes,
47    /**
48     * No description or description hash are part of the invoice
49     */
50    LDKBolt11SemanticError_NoDescription,
51    /**
52     * The invoice contains multiple descriptions and/or description hashes which isn't allowed
53     */
54    LDKBolt11SemanticError_MultipleDescriptions,
55    /**
56     * The invoice is missing the mandatory payment secret, which all modern lightning nodes
57     * should provide.
58     */
59    LDKBolt11SemanticError_NoPaymentSecret,
60    /**
61     * The invoice contains multiple payment secrets
62     */
63    LDKBolt11SemanticError_MultiplePaymentSecrets,
64    /**
65     * The invoice's features are invalid
66     */
67    LDKBolt11SemanticError_InvalidFeatures,
68    /**
69     * The recovery id doesn't fit the signature/pub key
70     */
71    LDKBolt11SemanticError_InvalidRecoveryId,
72    /**
73     * The invoice's signature is invalid
74     */
75    LDKBolt11SemanticError_InvalidSignature,
76    /**
77     * The invoice's amount was not a whole number of millisatoshis
78     */
79    LDKBolt11SemanticError_ImpreciseAmount,
80    /**
81     * Must be last for serialization purposes
82     */
83    LDKBolt11SemanticError_Sentinel,
84 } LDKBolt11SemanticError;
85
86 /**
87  * Error when interpreting a TLV stream as a specific type.
88  */
89 typedef enum LDKBolt12SemanticError {
90    /**
91     * The current [`std::time::SystemTime`] is past the offer or invoice's expiration.
92     */
93    LDKBolt12SemanticError_AlreadyExpired,
94    /**
95     * The provided chain hash does not correspond to a supported chain.
96     */
97    LDKBolt12SemanticError_UnsupportedChain,
98    /**
99     * A chain was provided but was not expected.
100     */
101    LDKBolt12SemanticError_UnexpectedChain,
102    /**
103     * An amount was expected but was missing.
104     */
105    LDKBolt12SemanticError_MissingAmount,
106    /**
107     * The amount exceeded the total bitcoin supply.
108     */
109    LDKBolt12SemanticError_InvalidAmount,
110    /**
111     * An amount was provided but was not sufficient in value.
112     */
113    LDKBolt12SemanticError_InsufficientAmount,
114    /**
115     * An amount was provided but was not expected.
116     */
117    LDKBolt12SemanticError_UnexpectedAmount,
118    /**
119     * A currency was provided that is not supported.
120     */
121    LDKBolt12SemanticError_UnsupportedCurrency,
122    /**
123     * A feature was required but is unknown.
124     */
125    LDKBolt12SemanticError_UnknownRequiredFeatures,
126    /**
127     * Features were provided but were not expected.
128     */
129    LDKBolt12SemanticError_UnexpectedFeatures,
130    /**
131     * A required description was not provided.
132     */
133    LDKBolt12SemanticError_MissingDescription,
134    /**
135     * A signing pubkey was not provided.
136     */
137    LDKBolt12SemanticError_MissingSigningPubkey,
138    /**
139     * A signing pubkey was provided but a different one was expected.
140     */
141    LDKBolt12SemanticError_InvalidSigningPubkey,
142    /**
143     * A signing pubkey was provided but was not expected.
144     */
145    LDKBolt12SemanticError_UnexpectedSigningPubkey,
146    /**
147     * A quantity was expected but was missing.
148     */
149    LDKBolt12SemanticError_MissingQuantity,
150    /**
151     * An unsupported quantity was provided.
152     */
153    LDKBolt12SemanticError_InvalidQuantity,
154    /**
155     * A quantity or quantity bounds was provided but was not expected.
156     */
157    LDKBolt12SemanticError_UnexpectedQuantity,
158    /**
159     * Metadata could not be used to verify the offers message.
160     */
161    LDKBolt12SemanticError_InvalidMetadata,
162    /**
163     * Metadata was provided but was not expected.
164     */
165    LDKBolt12SemanticError_UnexpectedMetadata,
166    /**
167     * Payer metadata was expected but was missing.
168     */
169    LDKBolt12SemanticError_MissingPayerMetadata,
170    /**
171     * A payer id was expected but was missing.
172     */
173    LDKBolt12SemanticError_MissingPayerId,
174    /**
175     * The payment id for a refund or request is already in use.
176     */
177    LDKBolt12SemanticError_DuplicatePaymentId,
178    /**
179     * Blinded paths were expected but were missing.
180     */
181    LDKBolt12SemanticError_MissingPaths,
182    /**
183     * Blinded paths were provided but were not expected.
184     */
185    LDKBolt12SemanticError_UnexpectedPaths,
186    /**
187     * The blinded payinfo given does not match the number of blinded path hops.
188     */
189    LDKBolt12SemanticError_InvalidPayInfo,
190    /**
191     * An invoice creation time was expected but was missing.
192     */
193    LDKBolt12SemanticError_MissingCreationTime,
194    /**
195     * An invoice payment hash was expected but was missing.
196     */
197    LDKBolt12SemanticError_MissingPaymentHash,
198    /**
199     * A signature was expected but was missing.
200     */
201    LDKBolt12SemanticError_MissingSignature,
202    /**
203     * Must be last for serialization purposes
204     */
205    LDKBolt12SemanticError_Sentinel,
206 } LDKBolt12SemanticError;
207
208 /**
209  * An enum which can either contain a  or not
210  */
211 typedef enum LDKCOption_NoneZ {
212    /**
213     * When we're in this state, this COption_NoneZ contains a
214     */
215    LDKCOption_NoneZ_Some,
216    /**
217     * When we're in this state, this COption_NoneZ contains nothing
218     */
219    LDKCOption_NoneZ_None,
220    /**
221     * Must be last for serialization purposes
222     */
223    LDKCOption_NoneZ_Sentinel,
224 } LDKCOption_NoneZ;
225
226 /**
227  * An enum representing the status of a channel monitor update persistence.
228  *
229  * These are generally used as the return value for an implementation of [`Persist`] which is used
230  * as the storage layer for a [`ChainMonitor`]. See the docs on [`Persist`] for a high-level
231  * explanation of how to handle different cases.
232  *
233  * While `UnrecoverableError` is provided as a failure variant, it is not truly \"handled\" on the
234  * calling side, and generally results in an immediate panic. For those who prefer to avoid
235  * panics, `InProgress` can be used and you can retry the update operation in the background or
236  * shut down cleanly.
237  *
238  * Note that channels should generally *not* be force-closed after a persistence failure.
239  * Force-closing with the latest [`ChannelMonitorUpdate`] applied may result in a transaction
240  * being broadcast which can only be spent by the latest [`ChannelMonitor`]! Thus, if the
241  * latest [`ChannelMonitor`] is not durably persisted anywhere and exists only in memory, naively
242  * calling [`ChannelManager::force_close_broadcasting_latest_txn`] *may result in loss of funds*!
243  *
244  * [`Persist`]: chainmonitor::Persist
245  * [`ChainMonitor`]: chainmonitor::ChainMonitor
246  * [`ChannelManager::force_close_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_broadcasting_latest_txn
247  */
248 typedef enum LDKChannelMonitorUpdateStatus {
249    /**
250     * The update has been durably persisted and all copies of the relevant [`ChannelMonitor`]
251     * have been updated.
252     *
253     * This includes performing any `fsync()` calls required to ensure the update is guaranteed to
254     * be available on restart even if the application crashes.
255     */
256    LDKChannelMonitorUpdateStatus_Completed,
257    /**
258     * Indicates that the update will happen asynchronously in the background or that a transient
259     * failure occurred which is being retried in the background and will eventually complete.
260     *
261     * This will \"freeze\" a channel, preventing us from revoking old states or submitting a new
262     * commitment transaction to the counterparty. Once the update(s) which are `InProgress` have
263     * been completed, a [`MonitorEvent::Completed`] can be used to restore the channel to an
264     * operational state.
265     *
266     * Even when a channel has been \"frozen\", updates to the [`ChannelMonitor`] can continue to
267     * occur (e.g. if an inbound HTLC which we forwarded was claimed upstream, resulting in us
268     * attempting to claim it on this channel) and those updates must still be persisted.
269     *
270     * No updates to the channel will be made which could invalidate other [`ChannelMonitor`]s
271     * until a [`MonitorEvent::Completed`] is provided, even if you return no error on a later
272     * monitor update for the same channel.
273     *
274     * For deployments where a copy of [`ChannelMonitor`]s and other local state are backed up in
275     * a remote location (with local copies persisted immediately), it is anticipated that all
276     * updates will return [`InProgress`] until the remote copies could be updated.
277     *
278     * Note that while fully asynchronous persistence of [`ChannelMonitor`] data is generally
279     * reliable, this feature is considered beta, and a handful of edge-cases remain. Until the
280     * remaining cases are fixed, in rare cases, *using this feature may lead to funds loss*.
281     *
282     * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
283     */
284    LDKChannelMonitorUpdateStatus_InProgress,
285    /**
286     * Indicates that an update has failed and will not complete at any point in the future.
287     *
288     * Currently returning this variant will cause LDK to immediately panic to encourage immediate
289     * shutdown. In the future this may be updated to disconnect peers and refuse to continue
290     * normal operation without a panic.
291     *
292     * Applications which wish to perform an orderly shutdown after failure should consider
293     * returning [`InProgress`] instead and simply shut down without ever marking the update
294     * complete.
295     *
296     * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
297     */
298    LDKChannelMonitorUpdateStatus_UnrecoverableError,
299    /**
300     * Must be last for serialization purposes
301     */
302    LDKChannelMonitorUpdateStatus_Sentinel,
303 } LDKChannelMonitorUpdateStatus;
304
305 /**
306  * Further information on the details of the channel shutdown.
307  * Upon channels being forced closed (i.e. commitment transaction confirmation detected
308  * by `ChainMonitor`), ChannelShutdownState will be set to `ShutdownComplete` or
309  * the channel will be removed shortly.
310  * Also note, that in normal operation, peers could disconnect at any of these states
311  * and require peer re-connection before making progress onto other states
312  */
313 typedef enum LDKChannelShutdownState {
314    /**
315     * Channel has not sent or received a shutdown message.
316     */
317    LDKChannelShutdownState_NotShuttingDown,
318    /**
319     * Local node has sent a shutdown message for this channel.
320     */
321    LDKChannelShutdownState_ShutdownInitiated,
322    /**
323     * Shutdown message exchanges have concluded and the channels are in the midst of
324     * resolving all existing open HTLCs before closing can continue.
325     */
326    LDKChannelShutdownState_ResolvingHTLCs,
327    /**
328     * All HTLCs have been resolved, nodes are currently negotiating channel close onchain fee rates.
329     */
330    LDKChannelShutdownState_NegotiatingClosingFee,
331    /**
332     * We've successfully negotiated a closing_signed dance. At this point `ChannelManager` is about
333     * to drop the channel.
334     */
335    LDKChannelShutdownState_ShutdownComplete,
336    /**
337     * Must be last for serialization purposes
338     */
339    LDKChannelShutdownState_Sentinel,
340 } LDKChannelShutdownState;
341
342 /**
343  * An enum that represents the priority at which we want a transaction to confirm used for feerate
344  * estimation.
345  */
346 typedef enum LDKConfirmationTarget {
347    /**
348     * We have some funds available on chain which we need to spend prior to some expiry time at
349     * which point our counterparty may be able to steal them. Generally we have in the high tens
350     * to low hundreds of blocks to get our transaction on-chain, but we shouldn't risk too low a
351     * fee - this should be a relatively high priority feerate.
352     */
353    LDKConfirmationTarget_OnChainSweep,
354    /**
355     * This is the lowest feerate we will allow our channel counterparty to have in an anchor
356     * channel in order to close the channel if a channel party goes away.
357     *
358     * This needs to be sufficient to get into the mempool when the channel needs to
359     * be force-closed. Setting too high may result in force-closures if our counterparty attempts
360     * to use a lower feerate. Because this is for anchor channels, we can always bump the feerate
361     * later; the feerate here only needs to be sufficient to enter the mempool.
362     *
363     * A good estimate is the expected mempool minimum at the time of force-closure. Obviously this
364     * is not an estimate which is very easy to calculate because we do not know the future. Using
365     * a simple long-term fee estimate or tracking of the mempool minimum is a good approach to
366     * ensure you can always close the channel. A future change to Bitcoin's P2P network
367     * (package relay) may obviate the need for this entirely.
368     */
369    LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee,
370    /**
371     * The lowest feerate we will allow our channel counterparty to have in a non-anchor channel.
372     *
373     * This is the feerate on the transaction which we (or our counterparty) will broadcast in
374     * order to close the channel if a channel party goes away. Setting this value too high will
375     * cause immediate force-closures in order to avoid having an unbroadcastable state.
376     *
377     * This feerate represents the fee we pick now, which must be sufficient to enter a block at an
378     * arbitrary time in the future. Obviously this is not an estimate which is very easy to
379     * calculate. This can leave channels subject to being unable to close if feerates rise, and in
380     * general you should prefer anchor channels to ensure you can increase the feerate when the
381     * transactions need broadcasting.
382     *
383     * Do note some fee estimators round up to the next full sat/vbyte (ie 250 sats per kw),
384     * causing occasional issues with feerate disagreements between an initiator that wants a
385     * feerate of 1.1 sat/vbyte and a receiver that wants 1.1 rounded up to 2. If your fee
386     * estimator rounds subtracting 250 to your desired feerate here can help avoid this issue.
387     *
388     * [`ChannelConfig::max_dust_htlc_exposure`]: crate::util::config::ChannelConfig::max_dust_htlc_exposure
389     */
390    LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee,
391    /**
392     * This is the feerate on the transaction which we (or our counterparty) will broadcast in
393     * order to close the channel if a channel party goes away.
394     *
395     * This needs to be sufficient to get into the mempool when the channel needs to
396     * be force-closed. Setting too low may result in force-closures. Because this is for anchor
397     * channels, it can be a low value as we can always bump the feerate later.
398     *
399     * A good estimate is the expected mempool minimum at the time of force-closure. Obviously this
400     * is not an estimate which is very easy to calculate because we do not know the future. Using
401     * a simple long-term fee estimate or tracking of the mempool minimum is a good approach to
402     * ensure you can always close the channel. A future change to Bitcoin's P2P network
403     * (package relay) may obviate the need for this entirely.
404     */
405    LDKConfirmationTarget_AnchorChannelFee,
406    /**
407     * Lightning is built around the ability to broadcast a transaction in the future to close our
408     * channel and claim all pending funds. In order to do so, non-anchor channels are built with
409     * transactions which we need to be able to broadcast at some point in the future.
410     *
411     * This feerate represents the fee we pick now, which must be sufficient to enter a block at an
412     * arbitrary time in the future. Obviously this is not an estimate which is very easy to
413     * calculate, so most lightning nodes use some relatively high-priority feerate using the
414     * current mempool. This leaves channels subject to being unable to close if feerates rise, and
415     * in general you should prefer anchor channels to ensure you can increase the feerate when the
416     * transactions need broadcasting.
417     *
418     * Since this should represent the feerate of a channel close that does not need fee
419     * bumping, this is also used as an upper bound for our attempted feerate when doing cooperative
420     * closure of any channel.
421     */
422    LDKConfirmationTarget_NonAnchorChannelFee,
423    /**
424     * When cooperatively closing a channel, this is the minimum feerate we will accept.
425     * Recommended at least within a day or so worth of blocks.
426     *
427     * This will also be used when initiating a cooperative close of a channel. When closing a
428     * channel you can override this fee by using
429     * [`ChannelManager::close_channel_with_feerate_and_script`].
430     *
431     * [`ChannelManager::close_channel_with_feerate_and_script`]: crate::ln::channelmanager::ChannelManager::close_channel_with_feerate_and_script
432     */
433    LDKConfirmationTarget_ChannelCloseMinimum,
434    /**
435     * The feerate [`OutputSweeper`] will use on transactions spending
436     * [`SpendableOutputDescriptor`]s after a channel closure.
437     *
438     * Generally spending these outputs is safe as long as they eventually confirm, so a value
439     * (slightly above) the mempool minimum should suffice. However, as this value will influence
440     * how long funds will be unavailable after channel closure, [`FeeEstimator`] implementors
441     * might want to choose a higher feerate to regain control over funds faster.
442     *
443     * [`OutputSweeper`]: crate::util::sweep::OutputSweeper
444     * [`SpendableOutputDescriptor`]: crate::sign::SpendableOutputDescriptor
445     */
446    LDKConfirmationTarget_OutputSpendingFee,
447    /**
448     * Must be last for serialization purposes
449     */
450    LDKConfirmationTarget_Sentinel,
451 } LDKConfirmationTarget;
452
453 /**
454  * Errors that may occur when constructing a new [`RawBolt11Invoice`] or [`Bolt11Invoice`]
455  */
456 typedef enum LDKCreationError {
457    /**
458     * The supplied description string was longer than 639 __bytes__ (see [`Description::new`])
459     */
460    LDKCreationError_DescriptionTooLong,
461    /**
462     * The specified route has too many hops and can't be encoded
463     */
464    LDKCreationError_RouteTooLong,
465    /**
466     * The Unix timestamp of the supplied date is less than zero or greater than 35-bits
467     */
468    LDKCreationError_TimestampOutOfBounds,
469    /**
470     * The supplied millisatoshi amount was greater than the total bitcoin supply.
471     */
472    LDKCreationError_InvalidAmount,
473    /**
474     * Route hints were required for this invoice and were missing. Applies to
475     * [phantom invoices].
476     *
477     * [phantom invoices]: crate::utils::create_phantom_invoice
478     */
479    LDKCreationError_MissingRouteHints,
480    /**
481     * The provided `min_final_cltv_expiry_delta` was less than [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
482     *
483     * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
484     */
485    LDKCreationError_MinFinalCltvExpiryDeltaTooShort,
486    /**
487     * Must be last for serialization purposes
488     */
489    LDKCreationError_Sentinel,
490 } LDKCreationError;
491
492 /**
493  * Enum representing the crypto currencies (or networks) supported by this library
494  */
495 typedef enum LDKCurrency {
496    /**
497     * Bitcoin mainnet
498     */
499    LDKCurrency_Bitcoin,
500    /**
501     * Bitcoin testnet
502     */
503    LDKCurrency_BitcoinTestnet,
504    /**
505     * Bitcoin regtest
506     */
507    LDKCurrency_Regtest,
508    /**
509     * Bitcoin simnet
510     */
511    LDKCurrency_Simnet,
512    /**
513     * Bitcoin signet
514     */
515    LDKCurrency_Signet,
516    /**
517     * Must be last for serialization purposes
518     */
519    LDKCurrency_Sentinel,
520 } LDKCurrency;
521
522 /**
523  * The side of a channel that is the [`IntroductionNode`] in a [`BlindedPath`]. [BOLT 7] defines
524  * which nodes is which in the [`ChannelAnnouncement`] message.
525  *
526  * [BOLT 7]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
527  * [`ChannelAnnouncement`]: crate::ln::msgs::ChannelAnnouncement
528  */
529 typedef enum LDKDirection {
530    /**
531     * The lesser node id when compared lexicographically in ascending order.
532     */
533    LDKDirection_NodeOne,
534    /**
535     * The greater node id when compared lexicographically in ascending order.
536     */
537    LDKDirection_NodeTwo,
538    /**
539     * Must be last for serialization purposes
540     */
541    LDKDirection_Sentinel,
542 } LDKDirection;
543
544 /**
545  * Describes the type of HTLC claim as determined by analyzing the witness.
546  */
547 typedef enum LDKHTLCClaim {
548    /**
549     * Claims an offered output on a commitment transaction through the timeout path.
550     */
551    LDKHTLCClaim_OfferedTimeout,
552    /**
553     * Claims an offered output on a commitment transaction through the success path.
554     */
555    LDKHTLCClaim_OfferedPreimage,
556    /**
557     * Claims an accepted output on a commitment transaction through the timeout path.
558     */
559    LDKHTLCClaim_AcceptedTimeout,
560    /**
561     * Claims an accepted output on a commitment transaction through the success path.
562     */
563    LDKHTLCClaim_AcceptedPreimage,
564    /**
565     * Claims an offered/accepted output on a commitment transaction through the revocation path.
566     */
567    LDKHTLCClaim_Revocation,
568    /**
569     * Must be last for serialization purposes
570     */
571    LDKHTLCClaim_Sentinel,
572 } LDKHTLCClaim;
573
574 /**
575  * Represents an IO Error. Note that some information is lost in the conversion from Rust.
576  */
577 typedef enum LDKIOError {
578    LDKIOError_NotFound,
579    LDKIOError_PermissionDenied,
580    LDKIOError_ConnectionRefused,
581    LDKIOError_ConnectionReset,
582    LDKIOError_ConnectionAborted,
583    LDKIOError_NotConnected,
584    LDKIOError_AddrInUse,
585    LDKIOError_AddrNotAvailable,
586    LDKIOError_BrokenPipe,
587    LDKIOError_AlreadyExists,
588    LDKIOError_WouldBlock,
589    LDKIOError_InvalidInput,
590    LDKIOError_InvalidData,
591    LDKIOError_TimedOut,
592    LDKIOError_WriteZero,
593    LDKIOError_Interrupted,
594    LDKIOError_Other,
595    LDKIOError_UnexpectedEof,
596    /**
597     * Must be last for serialization purposes
598     */
599    LDKIOError_Sentinel,
600 } LDKIOError;
601
602 /**
603  * Exposes the state of pending inbound HTLCs.
604  *
605  * At a high level, an HTLC being forwarded from one Lightning node to another Lightning node goes
606  * through the following states in the state machine:
607  * - Announced for addition by the originating node through the update_add_htlc message.
608  * - Added to the commitment transaction of the receiving node and originating node in turn
609  *   through the exchange of commitment_signed and revoke_and_ack messages.
610  * - Announced for resolution (fulfillment or failure) by the receiving node through either one of
611  *   the update_fulfill_htlc, update_fail_htlc, and update_fail_malformed_htlc messages.
612  * - Removed from the commitment transaction of the originating node and receiving node in turn
613  *   through the exchange of commitment_signed and revoke_and_ack messages.
614  *
615  * This can be used to inspect what next message an HTLC is waiting for to advance its state.
616  */
617 typedef enum LDKInboundHTLCStateDetails {
618    /**
619     * We have added this HTLC in our commitment transaction by receiving commitment_signed and
620     * returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote
621     * before this HTLC is included on the remote commitment transaction.
622     */
623    LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToAdd,
624    /**
625     * This HTLC has been included in the commitment_signed and revoke_and_ack messages on both sides
626     * and is included in both commitment transactions.
627     *
628     * This HTLC is now safe to either forward or be claimed as a payment by us. The HTLC will
629     * remain in this state until the forwarded upstream HTLC has been resolved and we resolve this
630     * HTLC correspondingly, or until we claim it as a payment. If it is part of a multipart
631     * payment, it will only be claimed together with other required parts.
632     */
633    LDKInboundHTLCStateDetails_Committed,
634    /**
635     * We have received the preimage for this HTLC and it is being removed by fulfilling it with
636     * update_fulfill_htlc. This HTLC is still on both commitment transactions, but we are awaiting
637     * the appropriate revoke_and_ack's from the remote before this HTLC is removed from the remote
638     * commitment transaction after update_fulfill_htlc.
639     */
640    LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFulfill,
641    /**
642     * The HTLC is being removed by failing it with update_fail_htlc or update_fail_malformed_htlc.
643     * This HTLC is still on both commitment transactions, but we are awaiting the appropriate
644     * revoke_and_ack's from the remote before this HTLC is removed from the remote commitment
645     * transaction.
646     */
647    LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFail,
648    /**
649     * Must be last for serialization purposes
650     */
651    LDKInboundHTLCStateDetails_Sentinel,
652 } LDKInboundHTLCStateDetails;
653
654 /**
655  * An enum representing the available verbosity levels of the logger.
656  */
657 typedef enum LDKLevel {
658    /**
659     * Designates extremely verbose information, including gossip-induced messages
660     */
661    LDKLevel_Gossip,
662    /**
663     * Designates very low priority, often extremely verbose, information
664     */
665    LDKLevel_Trace,
666    /**
667     * Designates lower priority information
668     */
669    LDKLevel_Debug,
670    /**
671     * Designates useful information
672     */
673    LDKLevel_Info,
674    /**
675     * Designates hazardous situations
676     */
677    LDKLevel_Warn,
678    /**
679     * Designates very serious errors
680     */
681    LDKLevel_Error,
682    /**
683     * Must be last for serialization purposes
684     */
685    LDKLevel_Sentinel,
686 } LDKLevel;
687
688 /**
689  * An enum representing the possible Bitcoin or test networks which we can run on
690  */
691 typedef enum LDKNetwork {
692    /**
693     * The main Bitcoin blockchain.
694     */
695    LDKNetwork_Bitcoin,
696    /**
697     * The testnet3 blockchain.
698     */
699    LDKNetwork_Testnet,
700    /**
701     * A local test blockchain.
702     */
703    LDKNetwork_Regtest,
704    /**
705     * A blockchain on which blocks are signed instead of mined.
706     */
707    LDKNetwork_Signet,
708    /**
709     * Must be last for serialization purposes
710     */
711    LDKNetwork_Sentinel,
712 } LDKNetwork;
713
714 /**
715  * Exposes the state of pending outbound HTLCs.
716  *
717  * At a high level, an HTLC being forwarded from one Lightning node to another Lightning node goes
718  * through the following states in the state machine:
719  * - Announced for addition by the originating node through the update_add_htlc message.
720  * - Added to the commitment transaction of the receiving node and originating node in turn
721  *   through the exchange of commitment_signed and revoke_and_ack messages.
722  * - Announced for resolution (fulfillment or failure) by the receiving node through either one of
723  *   the update_fulfill_htlc, update_fail_htlc, and update_fail_malformed_htlc messages.
724  * - Removed from the commitment transaction of the originating node and receiving node in turn
725  *   through the exchange of commitment_signed and revoke_and_ack messages.
726  *
727  * This can be used to inspect what next message an HTLC is waiting for to advance its state.
728  */
729 typedef enum LDKOutboundHTLCStateDetails {
730    /**
731     * We are awaiting the appropriate revoke_and_ack's from the remote before the HTLC is added
732     * on the remote's commitment transaction after update_add_htlc.
733     */
734    LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd,
735    /**
736     * The HTLC has been added to the remote's commitment transaction by sending commitment_signed
737     * and receiving revoke_and_ack in return.
738     *
739     * The HTLC will remain in this state until the remote node resolves the HTLC, or until we
740     * unilaterally close the channel due to a timeout with an uncooperative remote node.
741     */
742    LDKOutboundHTLCStateDetails_Committed,
743    /**
744     * The HTLC has been fulfilled successfully by the remote with a preimage in update_fulfill_htlc,
745     * and we removed the HTLC from our commitment transaction by receiving commitment_signed and
746     * returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote
747     * for the removal from its commitment transaction.
748     */
749    LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess,
750    /**
751     * The HTLC has been failed by the remote with update_fail_htlc or update_fail_malformed_htlc,
752     * and we removed the HTLC from our commitment transaction by receiving commitment_signed and
753     * returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote
754     * for the removal from its commitment transaction.
755     */
756    LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure,
757    /**
758     * Must be last for serialization purposes
759     */
760    LDKOutboundHTLCStateDetails_Sentinel,
761 } LDKOutboundHTLCStateDetails;
762
763 /**
764  * The reason the payment failed. Used in [`Event::PaymentFailed`].
765  */
766 typedef enum LDKPaymentFailureReason {
767    /**
768     * The intended recipient rejected our payment.
769     */
770    LDKPaymentFailureReason_RecipientRejected,
771    /**
772     * The user chose to abandon this payment by calling [`ChannelManager::abandon_payment`].
773     *
774     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
775     */
776    LDKPaymentFailureReason_UserAbandoned,
777    /**
778     * We exhausted all of our retry attempts while trying to send the payment, or we
779     * exhausted the [`Retry::Timeout`] if the user set one. If at any point a retry
780     * attempt failed while being forwarded along the path, an [`Event::PaymentPathFailed`] will
781     * have come before this.
782     *
783     * [`Retry::Timeout`]: crate::ln::channelmanager::Retry::Timeout
784     */
785    LDKPaymentFailureReason_RetriesExhausted,
786    /**
787     * The payment expired while retrying, based on the provided
788     * [`PaymentParameters::expiry_time`].
789     *
790     * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
791     */
792    LDKPaymentFailureReason_PaymentExpired,
793    /**
794     * We failed to find a route while retrying the payment.
795     *
796     * Note that this generally indicates that we've exhausted the available set of possible
797     * routes - we tried the payment over a few routes but were not able to find any further
798     * candidate routes beyond those.
799     */
800    LDKPaymentFailureReason_RouteNotFound,
801    /**
802     * This error should generally never happen. This likely means that there is a problem with
803     * your router.
804     */
805    LDKPaymentFailureReason_UnexpectedError,
806    /**
807     * Must be last for serialization purposes
808     */
809    LDKPaymentFailureReason_Sentinel,
810 } LDKPaymentFailureReason;
811
812 /**
813  * Specifies the recipient of an invoice.
814  *
815  * This indicates to [`NodeSigner::sign_invoice`] what node secret key should be used to sign
816  * the invoice.
817  */
818 typedef enum LDKRecipient {
819    /**
820     * The invoice should be signed with the local node secret key.
821     */
822    LDKRecipient_Node,
823    /**
824     * The invoice should be signed with the phantom node secret key. This secret key must be the
825     * same for all nodes participating in the [phantom node payment].
826     *
827     * [phantom node payment]: PhantomKeysManager
828     */
829    LDKRecipient_PhantomNode,
830    /**
831     * Must be last for serialization purposes
832     */
833    LDKRecipient_Sentinel,
834 } LDKRecipient;
835
836 /**
837  * Indicates an immediate error on [`ChannelManager::send_payment`]. Further errors may be
838  * surfaced later via [`Event::PaymentPathFailed`] and [`Event::PaymentFailed`].
839  *
840  * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
841  * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
842  * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
843  */
844 typedef enum LDKRetryableSendFailure {
845    /**
846     * The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. Note
847     * that this error is *not* caused by [`Retry::Timeout`].
848     *
849     * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
850     */
851    LDKRetryableSendFailure_PaymentExpired,
852    /**
853     * We were unable to find a route to the destination.
854     */
855    LDKRetryableSendFailure_RouteNotFound,
856    /**
857     * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
858     * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
859     *
860     * [`PaymentId`]: crate::ln::channelmanager::PaymentId
861     * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
862     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
863     */
864    LDKRetryableSendFailure_DuplicatePayment,
865    /**
866     * Must be last for serialization purposes
867     */
868    LDKRetryableSendFailure_Sentinel,
869 } LDKRetryableSendFailure;
870
871 /**
872  * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
873  */
874 typedef enum LDKSecp256k1Error {
875    /**
876     * Signature failed verification
877     */
878    LDKSecp256k1Error_IncorrectSignature,
879    /**
880     * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
881     */
882    LDKSecp256k1Error_InvalidMessage,
883    /**
884     * Bad public key
885     */
886    LDKSecp256k1Error_InvalidPublicKey,
887    /**
888     * Bad signature
889     */
890    LDKSecp256k1Error_InvalidSignature,
891    /**
892     * Bad secret key
893     */
894    LDKSecp256k1Error_InvalidSecretKey,
895    /**
896     * Bad shared secret.
897     */
898    LDKSecp256k1Error_InvalidSharedSecret,
899    /**
900     * Bad recovery id
901     */
902    LDKSecp256k1Error_InvalidRecoveryId,
903    /**
904     * Invalid tweak for add_assign or mul_assign
905     */
906    LDKSecp256k1Error_InvalidTweak,
907    /**
908     * Didn't pass enough memory to context creation with preallocated memory
909     */
910    LDKSecp256k1Error_NotEnoughMemory,
911    /**
912     * Bad set of public keys.
913     */
914    LDKSecp256k1Error_InvalidPublicKeySum,
915    /**
916     * The only valid parity values are 0 or 1.
917     */
918    LDKSecp256k1Error_InvalidParityValue,
919    /**
920     * Must be last for serialization purposes
921     */
922    LDKSecp256k1Error_Sentinel,
923 } LDKSecp256k1Error;
924
925 /**
926  * A `short_channel_id` construction error
927  */
928 typedef enum LDKShortChannelIdError {
929    /**
930     * Block height too high
931     */
932    LDKShortChannelIdError_BlockOverflow,
933    /**
934     * Tx index too high
935     */
936    LDKShortChannelIdError_TxIndexOverflow,
937    /**
938     * Vout index too high
939     */
940    LDKShortChannelIdError_VoutIndexOverflow,
941    /**
942     * Must be last for serialization purposes
943     */
944    LDKShortChannelIdError_Sentinel,
945 } LDKShortChannelIdError;
946
947 /**
948  * SI prefixes for the human readable part
949  */
950 typedef enum LDKSiPrefix {
951    /**
952     * 10^-3
953     */
954    LDKSiPrefix_Milli,
955    /**
956     * 10^-6
957     */
958    LDKSiPrefix_Micro,
959    /**
960     * 10^-9
961     */
962    LDKSiPrefix_Nano,
963    /**
964     * 10^-12
965     */
966    LDKSiPrefix_Pico,
967    /**
968     * Must be last for serialization purposes
969     */
970    LDKSiPrefix_Sentinel,
971 } LDKSiPrefix;
972
973 /**
974  * [`SocketAddress`] error variants
975  */
976 typedef enum LDKSocketAddressParseError {
977    /**
978     * Socket address (IPv4/IPv6) parsing error
979     */
980    LDKSocketAddressParseError_SocketAddrParse,
981    /**
982     * Invalid input format
983     */
984    LDKSocketAddressParseError_InvalidInput,
985    /**
986     * Invalid port
987     */
988    LDKSocketAddressParseError_InvalidPort,
989    /**
990     * Invalid onion v3 address
991     */
992    LDKSocketAddressParseError_InvalidOnionV3,
993    /**
994     * Must be last for serialization purposes
995     */
996    LDKSocketAddressParseError_Sentinel,
997 } LDKSocketAddressParseError;
998
999 /**
1000  * An error when accessing the chain via [`UtxoLookup`].
1001  */
1002 typedef enum LDKUtxoLookupError {
1003    /**
1004     * The requested chain is unknown.
1005     */
1006    LDKUtxoLookupError_UnknownChain,
1007    /**
1008     * The requested transaction doesn't exist or hasn't confirmed.
1009     */
1010    LDKUtxoLookupError_UnknownTx,
1011    /**
1012     * Must be last for serialization purposes
1013     */
1014    LDKUtxoLookupError_Sentinel,
1015 } LDKUtxoLookupError;
1016
1017 /**
1018  * A Rust str object, ie a reference to a UTF8-valid string.
1019  * This is *not* null-terminated so cannot be used directly as a C string!
1020  */
1021 typedef struct LDKStr {
1022    /**
1023     * A pointer to the string's bytes, in UTF8 encoding
1024     */
1025    const uint8_t *chars;
1026    /**
1027     * The number of bytes (not characters!) pointed to by `chars`
1028     */
1029    uintptr_t len;
1030    /**
1031     * Whether the data pointed to by `chars` should be freed or not.
1032     */
1033    bool chars_is_owned;
1034 } LDKStr;
1035
1036 /**
1037  * A 16-byte byte array.
1038  */
1039 typedef struct LDKSixteenBytes {
1040    /**
1041     * The sixteen bytes
1042     */
1043    uint8_t data[16];
1044 } LDKSixteenBytes;
1045
1046 /**
1047  * Unsigned, 128-bit integer.
1048  *
1049  * Because LLVM implements an incorrect ABI for 128-bit integers, a wrapper type is defined here.
1050  * See https://github.com/rust-lang/rust/issues/54341 for more details.
1051  */
1052 typedef struct LDKU128 {
1053    /**
1054     * The 128-bit integer, as 16 little-endian bytes
1055     */
1056    uint8_t le_bytes[16];
1057 } LDKU128;
1058
1059 /**
1060  * Integer in the range `0..=16`
1061  */
1062 typedef struct LDKWitnessVersion {
1063    uint8_t _0;
1064 } LDKWitnessVersion;
1065
1066 /**
1067  * A dynamically-allocated array of u8s of arbitrary size.
1068  * This corresponds to std::vector in C++
1069  */
1070 typedef struct LDKCVec_u8Z {
1071    /**
1072     * The elements in the array.
1073     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1074     */
1075    uint8_t *data;
1076    /**
1077     * The number of elements pointed to by `data`.
1078     */
1079    uintptr_t datalen;
1080 } LDKCVec_u8Z;
1081
1082 /**
1083  * A segregated witness version byte and script bytes
1084  */
1085 typedef struct LDKWitnessProgram {
1086    struct LDKWitnessVersion version;
1087    struct LDKCVec_u8Z program;
1088 } LDKWitnessProgram;
1089
1090 /**
1091  * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
1092  * own the memory pointed to by data.
1093  */
1094 typedef struct LDKu8slice {
1095    /**
1096     * A pointer to the byte buffer
1097     */
1098    const uint8_t *data;
1099    /**
1100     * The number of bytes pointed to by `data`.
1101     */
1102    uintptr_t datalen;
1103 } LDKu8slice;
1104
1105 /**
1106  * Represents a scalar value between zero and the secp256k1 curve order, in big endian.
1107  */
1108 typedef struct LDKBigEndianScalar {
1109    /**
1110     * The bytes of the scalar value.
1111     */
1112    uint8_t big_endian_bytes[32];
1113 } LDKBigEndianScalar;
1114
1115 /**
1116  * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1117  * look up the corresponding function in rust-lightning's docs.
1118  */
1119 typedef struct LDKThirtyTwoBytes {
1120    /**
1121     * The thirty-two bytes
1122     */
1123    uint8_t data[32];
1124 } LDKThirtyTwoBytes;
1125
1126 /**
1127  * Represents an error returned from the bech32 library during validation of some bech32 data
1128  */
1129 typedef enum LDKBech32Error_Tag {
1130    /**
1131     * String does not contain the separator character
1132     */
1133    LDKBech32Error_MissingSeparator,
1134    /**
1135     * The checksum does not match the rest of the data
1136     */
1137    LDKBech32Error_InvalidChecksum,
1138    /**
1139     * The data or human-readable part is too long or too short
1140     */
1141    LDKBech32Error_InvalidLength,
1142    /**
1143     * Some part of the string contains an invalid character
1144     */
1145    LDKBech32Error_InvalidChar,
1146    /**
1147     * Some part of the data has an invalid value
1148     */
1149    LDKBech32Error_InvalidData,
1150    /**
1151     * The bit conversion failed due to a padding issue
1152     */
1153    LDKBech32Error_InvalidPadding,
1154    /**
1155     * The whole string must be of one case
1156     */
1157    LDKBech32Error_MixedCase,
1158    /**
1159     * Must be last for serialization purposes
1160     */
1161    LDKBech32Error_Sentinel,
1162 } LDKBech32Error_Tag;
1163
1164 typedef struct LDKBech32Error {
1165    LDKBech32Error_Tag tag;
1166    union {
1167       struct {
1168          uint32_t invalid_char;
1169       };
1170       struct {
1171          uint8_t invalid_data;
1172       };
1173    };
1174 } LDKBech32Error;
1175
1176 /**
1177  * A serialized transaction, in (pointer, length) form.
1178  *
1179  * This type optionally owns its own memory, and thus the semantics around access change based on
1180  * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
1181  * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
1182  * access to the buffer after the scope in which the object was provided to you is invalid. eg,
1183  * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
1184  * you would be invalid.
1185  *
1186  * Note that, while it may change in the future, because transactions on the Rust side are stored
1187  * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
1188  * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
1189  * `data_is_owned` either set or unset at your discretion.
1190  */
1191 typedef struct LDKTransaction {
1192    /**
1193     * The serialized transaction data.
1194     *
1195     * This is non-const for your convenience, an object passed to Rust is never written to.
1196     */
1197    uint8_t *data;
1198    /**
1199     * The length of the serialized transaction
1200     */
1201    uintptr_t datalen;
1202    /**
1203     * Whether the data pointed to by `data` should be freed or not.
1204     */
1205    bool data_is_owned;
1206 } LDKTransaction;
1207
1208 /**
1209  * A serialized witness.
1210  */
1211 typedef struct LDKWitness {
1212    /**
1213     * The serialized transaction data.
1214     *
1215     * This is non-const for your convenience, an object passed to Rust is never written to.
1216     */
1217    uint8_t *data;
1218    /**
1219     * The length of the serialized transaction
1220     */
1221    uintptr_t datalen;
1222    /**
1223     * Whether the data pointed to by `data` should be freed or not.
1224     */
1225    bool data_is_owned;
1226 } LDKWitness;
1227
1228 /**
1229  * An input to a transaction.
1230  *
1231  * This contains the witness, the scriptSig and the previous outpoint and represents a single
1232  * input to a transaction
1233  */
1234 typedef struct LDKTxIn {
1235    /**
1236     * The witness which includes any signatures required to spend a segwit output.
1237     */
1238    struct LDKWitness witness;
1239    /**
1240     * The script_sig which includes signatures requires to spend a pre-segwit output (or a
1241     * P2SH-wrapped segwit output).
1242     */
1243    struct LDKCVec_u8Z script_sig;
1244    /**
1245     * The sequence number of the transaction input
1246     */
1247    uint32_t sequence;
1248    /**
1249     * The txid of the transaction being spent.
1250     */
1251    struct LDKThirtyTwoBytes previous_txid;
1252    /**
1253     * The output index of the transaction being spent.
1254     */
1255    uint32_t previous_vout;
1256 } LDKTxIn;
1257
1258 /**
1259  * A transaction output including a scriptPubKey and value.
1260  * This type *does* own its own memory, so must be free'd appropriately.
1261  */
1262 typedef struct LDKTxOut {
1263    /**
1264     * The script_pubkey in this output
1265     */
1266    struct LDKCVec_u8Z script_pubkey;
1267    /**
1268     * The value, in satoshis, of this output
1269     */
1270    uint64_t value;
1271 } LDKTxOut;
1272
1273
1274
1275 /**
1276  * Builds a [`Refund`] for the \"offer for money\" flow.
1277  *
1278  * See [module-level documentation] for usage.
1279  *
1280  * [module-level documentation]: self
1281  */
1282 typedef struct MUST_USE_STRUCT LDKRefundMaybeWithDerivedMetadataBuilder {
1283    /**
1284     * A pointer to the opaque Rust object.
1285     * Nearly everywhere, inner must be non-null, however in places where
1286     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1287     */
1288    LDKnativeRefundMaybeWithDerivedMetadataBuilder *inner;
1289    /**
1290     * Indicates that this is the only struct which contains the same pointer.
1291     * Rust functions which take ownership of an object provided via an argument require
1292     * this to be true and invalidate the object pointed to by inner.
1293     */
1294    bool is_owned;
1295 } LDKRefundMaybeWithDerivedMetadataBuilder;
1296
1297 /**
1298  * The contents of CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ
1299  */
1300 typedef union LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZPtr {
1301    /**
1302     * A pointer to the contents in the success state.
1303     * Reading from this pointer when `result_ok` is not set is undefined.
1304     */
1305    struct LDKRefundMaybeWithDerivedMetadataBuilder *result;
1306    /**
1307     * A pointer to the contents in the error state.
1308     * Reading from this pointer when `result_ok` is set is undefined.
1309     */
1310    enum LDKBolt12SemanticError *err;
1311 } LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZPtr;
1312
1313 /**
1314  * A CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
1315  * containing a crate::lightning::offers::refund::RefundMaybeWithDerivedMetadataBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
1316  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1317  */
1318 typedef struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ {
1319    /**
1320     * The contents of this CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ, accessible via either
1321     * `err` or `result` depending on the state of `result_ok`.
1322     */
1323    union LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZPtr contents;
1324    /**
1325     * Whether this CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ represents a success state.
1326     */
1327    bool result_ok;
1328 } LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ;
1329
1330
1331
1332 /**
1333  * A `Refund` is a request to send an [`Bolt12Invoice`] without a preceding [`Offer`].
1334  *
1335  * Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to
1336  * recoup their funds. A refund may be used more generally as an \"offer for money\", such as with a
1337  * bitcoin ATM.
1338  *
1339  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
1340  * [`Offer`]: crate::offers::offer::Offer
1341  */
1342 typedef struct MUST_USE_STRUCT LDKRefund {
1343    /**
1344     * A pointer to the opaque Rust object.
1345     * Nearly everywhere, inner must be non-null, however in places where
1346     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1347     */
1348    LDKnativeRefund *inner;
1349    /**
1350     * Indicates that this is the only struct which contains the same pointer.
1351     * Rust functions which take ownership of an object provided via an argument require
1352     * this to be true and invalidate the object pointed to by inner.
1353     */
1354    bool is_owned;
1355 } LDKRefund;
1356
1357 /**
1358  * The contents of CResult_RefundBolt12SemanticErrorZ
1359  */
1360 typedef union LDKCResult_RefundBolt12SemanticErrorZPtr {
1361    /**
1362     * A pointer to the contents in the success state.
1363     * Reading from this pointer when `result_ok` is not set is undefined.
1364     */
1365    struct LDKRefund *result;
1366    /**
1367     * A pointer to the contents in the error state.
1368     * Reading from this pointer when `result_ok` is set is undefined.
1369     */
1370    enum LDKBolt12SemanticError *err;
1371 } LDKCResult_RefundBolt12SemanticErrorZPtr;
1372
1373 /**
1374  * A CResult_RefundBolt12SemanticErrorZ represents the result of a fallible operation,
1375  * containing a crate::lightning::offers::refund::Refund on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
1376  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1377  */
1378 typedef struct LDKCResult_RefundBolt12SemanticErrorZ {
1379    /**
1380     * The contents of this CResult_RefundBolt12SemanticErrorZ, accessible via either
1381     * `err` or `result` depending on the state of `result_ok`.
1382     */
1383    union LDKCResult_RefundBolt12SemanticErrorZPtr contents;
1384    /**
1385     * Whether this CResult_RefundBolt12SemanticErrorZ represents a success state.
1386     */
1387    bool result_ok;
1388 } LDKCResult_RefundBolt12SemanticErrorZ;
1389
1390 /**
1391  * An enum which can either contain a u64 or not
1392  */
1393 typedef enum LDKCOption_u64Z_Tag {
1394    /**
1395     * When we're in this state, this COption_u64Z contains a u64
1396     */
1397    LDKCOption_u64Z_Some,
1398    /**
1399     * When we're in this state, this COption_u64Z contains nothing
1400     */
1401    LDKCOption_u64Z_None,
1402    /**
1403     * Must be last for serialization purposes
1404     */
1405    LDKCOption_u64Z_Sentinel,
1406 } LDKCOption_u64Z_Tag;
1407
1408 typedef struct LDKCOption_u64Z {
1409    LDKCOption_u64Z_Tag tag;
1410    union {
1411       struct {
1412          uint64_t some;
1413       };
1414    };
1415 } LDKCOption_u64Z;
1416
1417
1418
1419 /**
1420  * Onion messages and payments can be sent and received to blinded paths, which serve to hide the
1421  * identity of the recipient.
1422  */
1423 typedef struct MUST_USE_STRUCT LDKBlindedPath {
1424    /**
1425     * A pointer to the opaque Rust object.
1426     * Nearly everywhere, inner must be non-null, however in places where
1427     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1428     */
1429    LDKnativeBlindedPath *inner;
1430    /**
1431     * Indicates that this is the only struct which contains the same pointer.
1432     * Rust functions which take ownership of an object provided via an argument require
1433     * this to be true and invalidate the object pointed to by inner.
1434     */
1435    bool is_owned;
1436 } LDKBlindedPath;
1437
1438 /**
1439  * A dynamically-allocated array of crate::lightning::blinded_path::BlindedPaths of arbitrary size.
1440  * This corresponds to std::vector in C++
1441  */
1442 typedef struct LDKCVec_BlindedPathZ {
1443    /**
1444     * The elements in the array.
1445     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1446     */
1447    struct LDKBlindedPath *data;
1448    /**
1449     * The number of elements pointed to by `data`.
1450     */
1451    uintptr_t datalen;
1452 } LDKCVec_BlindedPathZ;
1453
1454
1455
1456 /**
1457  * Error when parsing a bech32 encoded message using [`str::parse`].
1458  */
1459 typedef struct MUST_USE_STRUCT LDKBolt12ParseError {
1460    /**
1461     * A pointer to the opaque Rust object.
1462     * Nearly everywhere, inner must be non-null, however in places where
1463     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1464     */
1465    LDKnativeBolt12ParseError *inner;
1466    /**
1467     * Indicates that this is the only struct which contains the same pointer.
1468     * Rust functions which take ownership of an object provided via an argument require
1469     * this to be true and invalidate the object pointed to by inner.
1470     */
1471    bool is_owned;
1472 } LDKBolt12ParseError;
1473
1474 /**
1475  * The contents of CResult_RefundBolt12ParseErrorZ
1476  */
1477 typedef union LDKCResult_RefundBolt12ParseErrorZPtr {
1478    /**
1479     * A pointer to the contents in the success state.
1480     * Reading from this pointer when `result_ok` is not set is undefined.
1481     */
1482    struct LDKRefund *result;
1483    /**
1484     * A pointer to the contents in the error state.
1485     * Reading from this pointer when `result_ok` is set is undefined.
1486     */
1487    struct LDKBolt12ParseError *err;
1488 } LDKCResult_RefundBolt12ParseErrorZPtr;
1489
1490 /**
1491  * A CResult_RefundBolt12ParseErrorZ represents the result of a fallible operation,
1492  * containing a crate::lightning::offers::refund::Refund on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
1493  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1494  */
1495 typedef struct LDKCResult_RefundBolt12ParseErrorZ {
1496    /**
1497     * The contents of this CResult_RefundBolt12ParseErrorZ, accessible via either
1498     * `err` or `result` depending on the state of `result_ok`.
1499     */
1500    union LDKCResult_RefundBolt12ParseErrorZPtr contents;
1501    /**
1502     * Whether this CResult_RefundBolt12ParseErrorZ represents a success state.
1503     */
1504    bool result_ok;
1505 } LDKCResult_RefundBolt12ParseErrorZ;
1506
1507 /**
1508  * Strategies available to retry payment path failures.
1509  */
1510 typedef enum LDKRetry_Tag {
1511    /**
1512     * Max number of attempts to retry payment.
1513     *
1514     * Each attempt may be multiple HTLCs along multiple paths if the router decides to split up a
1515     * retry, and may retry multiple failed HTLCs at once if they failed around the same time and
1516     * were retried along a route from a single call to [`Router::find_route_with_id`].
1517     */
1518    LDKRetry_Attempts,
1519    /**
1520     * Time elapsed before abandoning retries for a payment. At least one attempt at payment is made;
1521     * see [`PaymentParameters::expiry_time`] to avoid any attempt at payment after a specific time.
1522     *
1523     * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
1524     */
1525    LDKRetry_Timeout,
1526    /**
1527     * Must be last for serialization purposes
1528     */
1529    LDKRetry_Sentinel,
1530 } LDKRetry_Tag;
1531
1532 typedef struct MUST_USE_STRUCT LDKRetry {
1533    LDKRetry_Tag tag;
1534    union {
1535       struct {
1536          uint32_t attempts;
1537       };
1538       struct {
1539          uint64_t timeout;
1540       };
1541    };
1542 } LDKRetry;
1543
1544 /**
1545  * An error in decoding a message or struct.
1546  */
1547 typedef enum LDKDecodeError_Tag {
1548    /**
1549     * A version byte specified something we don't know how to handle.
1550     *
1551     * Includes unknown realm byte in an onion hop data packet.
1552     */
1553    LDKDecodeError_UnknownVersion,
1554    /**
1555     * Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)
1556     */
1557    LDKDecodeError_UnknownRequiredFeature,
1558    /**
1559     * Value was invalid.
1560     *
1561     * For example, a byte which was supposed to be a bool was something other than a 0
1562     * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
1563     * syntactically incorrect, etc.
1564     */
1565    LDKDecodeError_InvalidValue,
1566    /**
1567     * The buffer to be read was too short.
1568     */
1569    LDKDecodeError_ShortRead,
1570    /**
1571     * A length descriptor in the packet didn't describe the later data correctly.
1572     */
1573    LDKDecodeError_BadLengthDescriptor,
1574    /**
1575     * Error from [`std::io`].
1576     */
1577    LDKDecodeError_Io,
1578    /**
1579     * The message included zlib-compressed values, which we don't support.
1580     */
1581    LDKDecodeError_UnsupportedCompression,
1582    /**
1583     * Value is validly encoded but is dangerous to use.
1584     *
1585     * This is used for things like [`ChannelManager`] deserialization where we want to ensure
1586     * that we don't use a [`ChannelManager`] which is in out of sync with the [`ChannelMonitor`].
1587     * This indicates that there is a critical implementation flaw in the storage implementation
1588     * and it's unsafe to continue.
1589     *
1590     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
1591     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
1592     */
1593    LDKDecodeError_DangerousValue,
1594    /**
1595     * Must be last for serialization purposes
1596     */
1597    LDKDecodeError_Sentinel,
1598 } LDKDecodeError_Tag;
1599
1600 typedef struct MUST_USE_STRUCT LDKDecodeError {
1601    LDKDecodeError_Tag tag;
1602    union {
1603       struct {
1604          enum LDKIOError io;
1605       };
1606    };
1607 } LDKDecodeError;
1608
1609 /**
1610  * The contents of CResult_RetryDecodeErrorZ
1611  */
1612 typedef union LDKCResult_RetryDecodeErrorZPtr {
1613    /**
1614     * A pointer to the contents in the success state.
1615     * Reading from this pointer when `result_ok` is not set is undefined.
1616     */
1617    struct LDKRetry *result;
1618    /**
1619     * A pointer to the contents in the error state.
1620     * Reading from this pointer when `result_ok` is set is undefined.
1621     */
1622    struct LDKDecodeError *err;
1623 } LDKCResult_RetryDecodeErrorZPtr;
1624
1625 /**
1626  * A CResult_RetryDecodeErrorZ represents the result of a fallible operation,
1627  * containing a crate::lightning::ln::outbound_payment::Retry on success and a crate::lightning::ln::msgs::DecodeError on failure.
1628  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1629  */
1630 typedef struct LDKCResult_RetryDecodeErrorZ {
1631    /**
1632     * The contents of this CResult_RetryDecodeErrorZ, accessible via either
1633     * `err` or `result` depending on the state of `result_ok`.
1634     */
1635    union LDKCResult_RetryDecodeErrorZPtr contents;
1636    /**
1637     * Whether this CResult_RetryDecodeErrorZ represents a success state.
1638     */
1639    bool result_ok;
1640 } LDKCResult_RetryDecodeErrorZ;
1641
1642
1643
1644 /**
1645  * A script pubkey for shutting down a channel as defined by [BOLT #2].
1646  *
1647  * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
1648  */
1649 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1650    /**
1651     * A pointer to the opaque Rust object.
1652     * Nearly everywhere, inner must be non-null, however in places where
1653     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1654     */
1655    LDKnativeShutdownScript *inner;
1656    /**
1657     * Indicates that this is the only struct which contains the same pointer.
1658     * Rust functions which take ownership of an object provided via an argument require
1659     * this to be true and invalidate the object pointed to by inner.
1660     */
1661    bool is_owned;
1662 } LDKShutdownScript;
1663
1664 /**
1665  * Indicates an error on the client's part (usually some variant of attempting to use too-low or
1666  * too-high values)
1667  */
1668 typedef enum LDKAPIError_Tag {
1669    /**
1670     * Indicates the API was wholly misused (see err for more). Cases where these can be returned
1671     * are documented, but generally indicates some precondition of a function was violated.
1672     */
1673    LDKAPIError_APIMisuseError,
1674    /**
1675     * Due to a high feerate, we were unable to complete the request.
1676     * For example, this may be returned if the feerate implies we cannot open a channel at the
1677     * requested value, but opening a larger channel would succeed.
1678     */
1679    LDKAPIError_FeeRateTooHigh,
1680    /**
1681     * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
1682     * too-many-hops, etc).
1683     */
1684    LDKAPIError_InvalidRoute,
1685    /**
1686     * We were unable to complete the request as the Channel required to do so is unable to
1687     * complete the request (or was not found). This can take many forms, including disconnected
1688     * peer, channel at capacity, channel shutting down, etc.
1689     */
1690    LDKAPIError_ChannelUnavailable,
1691    /**
1692     * An attempt to call [`chain::Watch::watch_channel`]/[`chain::Watch::update_channel`]
1693     * returned a [`ChannelMonitorUpdateStatus::InProgress`] indicating the persistence of a
1694     * monitor update is awaiting async resolution. Once it resolves the attempted action should
1695     * complete automatically.
1696     *
1697     * [`chain::Watch::watch_channel`]: crate::chain::Watch::watch_channel
1698     * [`chain::Watch::update_channel`]: crate::chain::Watch::update_channel
1699     * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
1700     */
1701    LDKAPIError_MonitorUpdateInProgress,
1702    /**
1703     * [`SignerProvider::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
1704     * with the channel counterparty as negotiated in [`InitFeatures`].
1705     *
1706     * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
1707     * a channel or cooperatively close one with this peer (and will have to force-close instead).
1708     *
1709     * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
1710     * [`InitFeatures`]: crate::ln::features::InitFeatures
1711     */
1712    LDKAPIError_IncompatibleShutdownScript,
1713    /**
1714     * Must be last for serialization purposes
1715     */
1716    LDKAPIError_Sentinel,
1717 } LDKAPIError_Tag;
1718
1719 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
1720    /**
1721     * A human-readable error message
1722     */
1723    struct LDKStr err;
1724 } LDKAPIError_LDKAPIMisuseError_Body;
1725
1726 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
1727    /**
1728     * A human-readable error message
1729     */
1730    struct LDKStr err;
1731    /**
1732     * The feerate which was too high.
1733     */
1734    uint32_t feerate;
1735 } LDKAPIError_LDKFeeRateTooHigh_Body;
1736
1737 typedef struct LDKAPIError_LDKInvalidRoute_Body {
1738    /**
1739     * A human-readable error message
1740     */
1741    struct LDKStr err;
1742 } LDKAPIError_LDKInvalidRoute_Body;
1743
1744 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
1745    /**
1746     * A human-readable error message
1747     */
1748    struct LDKStr err;
1749 } LDKAPIError_LDKChannelUnavailable_Body;
1750
1751 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
1752    /**
1753     * The incompatible shutdown script.
1754     */
1755    struct LDKShutdownScript script;
1756 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
1757
1758 typedef struct MUST_USE_STRUCT LDKAPIError {
1759    LDKAPIError_Tag tag;
1760    union {
1761       LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
1762       LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
1763       LDKAPIError_LDKInvalidRoute_Body invalid_route;
1764       LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
1765       LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
1766    };
1767 } LDKAPIError;
1768
1769 /**
1770  * The contents of CResult_NoneAPIErrorZ
1771  */
1772 typedef union LDKCResult_NoneAPIErrorZPtr {
1773    /**
1774     * Note that this value is always NULL, as there are no contents in the OK variant
1775     */
1776    void *result;
1777    /**
1778     * A pointer to the contents in the error state.
1779     * Reading from this pointer when `result_ok` is set is undefined.
1780     */
1781    struct LDKAPIError *err;
1782 } LDKCResult_NoneAPIErrorZPtr;
1783
1784 /**
1785  * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
1786  * containing a () on success and a crate::lightning::util::errors::APIError on failure.
1787  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1788  */
1789 typedef struct LDKCResult_NoneAPIErrorZ {
1790    /**
1791     * The contents of this CResult_NoneAPIErrorZ, accessible via either
1792     * `err` or `result` depending on the state of `result_ok`.
1793     */
1794    union LDKCResult_NoneAPIErrorZPtr contents;
1795    /**
1796     * Whether this CResult_NoneAPIErrorZ represents a success state.
1797     */
1798    bool result_ok;
1799 } LDKCResult_NoneAPIErrorZ;
1800
1801 /**
1802  * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
1803  * This corresponds to std::vector in C++
1804  */
1805 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
1806    /**
1807     * The elements in the array.
1808     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1809     */
1810    struct LDKCResult_NoneAPIErrorZ *data;
1811    /**
1812     * The number of elements pointed to by `data`.
1813     */
1814    uintptr_t datalen;
1815 } LDKCVec_CResult_NoneAPIErrorZZ;
1816
1817 /**
1818  * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
1819  * This corresponds to std::vector in C++
1820  */
1821 typedef struct LDKCVec_APIErrorZ {
1822    /**
1823     * The elements in the array.
1824     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1825     */
1826    struct LDKAPIError *data;
1827    /**
1828     * The number of elements pointed to by `data`.
1829     */
1830    uintptr_t datalen;
1831 } LDKCVec_APIErrorZ;
1832
1833 /**
1834  * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not
1835  */
1836 typedef enum LDKCOption_ThirtyTwoBytesZ_Tag {
1837    /**
1838     * When we're in this state, this COption_ThirtyTwoBytesZ contains a crate::c_types::ThirtyTwoBytes
1839     */
1840    LDKCOption_ThirtyTwoBytesZ_Some,
1841    /**
1842     * When we're in this state, this COption_ThirtyTwoBytesZ contains nothing
1843     */
1844    LDKCOption_ThirtyTwoBytesZ_None,
1845    /**
1846     * Must be last for serialization purposes
1847     */
1848    LDKCOption_ThirtyTwoBytesZ_Sentinel,
1849 } LDKCOption_ThirtyTwoBytesZ_Tag;
1850
1851 typedef struct LDKCOption_ThirtyTwoBytesZ {
1852    LDKCOption_ThirtyTwoBytesZ_Tag tag;
1853    union {
1854       struct {
1855          struct LDKThirtyTwoBytes some;
1856       };
1857    };
1858 } LDKCOption_ThirtyTwoBytesZ;
1859
1860 /**
1861  * An enum which can either contain a crate::c_types::derived::CVec_u8Z or not
1862  */
1863 typedef enum LDKCOption_CVec_u8ZZ_Tag {
1864    /**
1865     * When we're in this state, this COption_CVec_u8ZZ contains a crate::c_types::derived::CVec_u8Z
1866     */
1867    LDKCOption_CVec_u8ZZ_Some,
1868    /**
1869     * When we're in this state, this COption_CVec_u8ZZ contains nothing
1870     */
1871    LDKCOption_CVec_u8ZZ_None,
1872    /**
1873     * Must be last for serialization purposes
1874     */
1875    LDKCOption_CVec_u8ZZ_Sentinel,
1876 } LDKCOption_CVec_u8ZZ_Tag;
1877
1878 typedef struct LDKCOption_CVec_u8ZZ {
1879    LDKCOption_CVec_u8ZZ_Tag tag;
1880    union {
1881       struct {
1882          struct LDKCVec_u8Z some;
1883       };
1884    };
1885 } LDKCOption_CVec_u8ZZ;
1886
1887
1888
1889 /**
1890  * Information which is provided, encrypted, to the payment recipient when sending HTLCs.
1891  *
1892  * This should generally be constructed with data communicated to us from the recipient (via a
1893  * BOLT11 or BOLT12 invoice).
1894  */
1895 typedef struct MUST_USE_STRUCT LDKRecipientOnionFields {
1896    /**
1897     * A pointer to the opaque Rust object.
1898     * Nearly everywhere, inner must be non-null, however in places where
1899     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1900     */
1901    LDKnativeRecipientOnionFields *inner;
1902    /**
1903     * Indicates that this is the only struct which contains the same pointer.
1904     * Rust functions which take ownership of an object provided via an argument require
1905     * this to be true and invalidate the object pointed to by inner.
1906     */
1907    bool is_owned;
1908 } LDKRecipientOnionFields;
1909
1910 /**
1911  * The contents of CResult_RecipientOnionFieldsDecodeErrorZ
1912  */
1913 typedef union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr {
1914    /**
1915     * A pointer to the contents in the success state.
1916     * Reading from this pointer when `result_ok` is not set is undefined.
1917     */
1918    struct LDKRecipientOnionFields *result;
1919    /**
1920     * A pointer to the contents in the error state.
1921     * Reading from this pointer when `result_ok` is set is undefined.
1922     */
1923    struct LDKDecodeError *err;
1924 } LDKCResult_RecipientOnionFieldsDecodeErrorZPtr;
1925
1926 /**
1927  * A CResult_RecipientOnionFieldsDecodeErrorZ represents the result of a fallible operation,
1928  * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
1929  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1930  */
1931 typedef struct LDKCResult_RecipientOnionFieldsDecodeErrorZ {
1932    /**
1933     * The contents of this CResult_RecipientOnionFieldsDecodeErrorZ, accessible via either
1934     * `err` or `result` depending on the state of `result_ok`.
1935     */
1936    union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr contents;
1937    /**
1938     * Whether this CResult_RecipientOnionFieldsDecodeErrorZ represents a success state.
1939     */
1940    bool result_ok;
1941 } LDKCResult_RecipientOnionFieldsDecodeErrorZ;
1942
1943 /**
1944  * A tuple of 2 elements. See the individual fields for the types contained.
1945  */
1946 typedef struct LDKC2Tuple_u64CVec_u8ZZ {
1947    /**
1948     * The element at position 0
1949     */
1950    uint64_t a;
1951    /**
1952     * The element at position 1
1953     */
1954    struct LDKCVec_u8Z b;
1955 } LDKC2Tuple_u64CVec_u8ZZ;
1956
1957 /**
1958  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u64CVec_u8ZZs of arbitrary size.
1959  * This corresponds to std::vector in C++
1960  */
1961 typedef struct LDKCVec_C2Tuple_u64CVec_u8ZZZ {
1962    /**
1963     * The elements in the array.
1964     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1965     */
1966    struct LDKC2Tuple_u64CVec_u8ZZ *data;
1967    /**
1968     * The number of elements pointed to by `data`.
1969     */
1970    uintptr_t datalen;
1971 } LDKCVec_C2Tuple_u64CVec_u8ZZZ;
1972
1973 /**
1974  * The contents of CResult_RecipientOnionFieldsNoneZ
1975  */
1976 typedef union LDKCResult_RecipientOnionFieldsNoneZPtr {
1977    /**
1978     * A pointer to the contents in the success state.
1979     * Reading from this pointer when `result_ok` is not set is undefined.
1980     */
1981    struct LDKRecipientOnionFields *result;
1982    /**
1983     * Note that this value is always NULL, as there are no contents in the Err variant
1984     */
1985    void *err;
1986 } LDKCResult_RecipientOnionFieldsNoneZPtr;
1987
1988 /**
1989  * A CResult_RecipientOnionFieldsNoneZ represents the result of a fallible operation,
1990  * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a () on failure.
1991  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1992  */
1993 typedef struct LDKCResult_RecipientOnionFieldsNoneZ {
1994    /**
1995     * The contents of this CResult_RecipientOnionFieldsNoneZ, accessible via either
1996     * `err` or `result` depending on the state of `result_ok`.
1997     */
1998    union LDKCResult_RecipientOnionFieldsNoneZPtr contents;
1999    /**
2000     * Whether this CResult_RecipientOnionFieldsNoneZ represents a success state.
2001     */
2002    bool result_ok;
2003 } LDKCResult_RecipientOnionFieldsNoneZ;
2004
2005
2006
2007 /**
2008  * A semantically valid [`Bolt12Invoice`] that hasn't been signed.
2009  *
2010  * # Serialization
2011  *
2012  * This is serialized as a TLV stream, which includes TLV records from the originating message. As
2013  * such, it may include unknown, odd TLV records.
2014  */
2015 typedef struct MUST_USE_STRUCT LDKUnsignedBolt12Invoice {
2016    /**
2017     * A pointer to the opaque Rust object.
2018     * Nearly everywhere, inner must be non-null, however in places where
2019     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2020     */
2021    LDKnativeUnsignedBolt12Invoice *inner;
2022    /**
2023     * Indicates that this is the only struct which contains the same pointer.
2024     * Rust functions which take ownership of an object provided via an argument require
2025     * this to be true and invalidate the object pointed to by inner.
2026     */
2027    bool is_owned;
2028 } LDKUnsignedBolt12Invoice;
2029
2030 /**
2031  * The contents of CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ
2032  */
2033 typedef union LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZPtr {
2034    /**
2035     * A pointer to the contents in the success state.
2036     * Reading from this pointer when `result_ok` is not set is undefined.
2037     */
2038    struct LDKUnsignedBolt12Invoice *result;
2039    /**
2040     * A pointer to the contents in the error state.
2041     * Reading from this pointer when `result_ok` is set is undefined.
2042     */
2043    enum LDKBolt12SemanticError *err;
2044 } LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZPtr;
2045
2046 /**
2047  * A CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ represents the result of a fallible operation,
2048  * containing a crate::lightning::offers::invoice::UnsignedBolt12Invoice on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
2049  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2050  */
2051 typedef struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ {
2052    /**
2053     * The contents of this CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ, accessible via either
2054     * `err` or `result` depending on the state of `result_ok`.
2055     */
2056    union LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZPtr contents;
2057    /**
2058     * Whether this CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ represents a success state.
2059     */
2060    bool result_ok;
2061 } LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ;
2062
2063
2064
2065 /**
2066  * A `Bolt12Invoice` is a payment request, typically corresponding to an [`Offer`] or a [`Refund`].
2067  *
2068  * An invoice may be sent in response to an [`InvoiceRequest`] in the case of an offer or sent
2069  * directly after scanning a refund. It includes all the information needed to pay a recipient.
2070  *
2071  * [`Offer`]: crate::offers::offer::Offer
2072  * [`Refund`]: crate::offers::refund::Refund
2073  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
2074  */
2075 typedef struct MUST_USE_STRUCT LDKBolt12Invoice {
2076    /**
2077     * A pointer to the opaque Rust object.
2078     * Nearly everywhere, inner must be non-null, however in places where
2079     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2080     */
2081    LDKnativeBolt12Invoice *inner;
2082    /**
2083     * Indicates that this is the only struct which contains the same pointer.
2084     * Rust functions which take ownership of an object provided via an argument require
2085     * this to be true and invalidate the object pointed to by inner.
2086     */
2087    bool is_owned;
2088 } LDKBolt12Invoice;
2089
2090 /**
2091  * The contents of CResult_Bolt12InvoiceBolt12SemanticErrorZ
2092  */
2093 typedef union LDKCResult_Bolt12InvoiceBolt12SemanticErrorZPtr {
2094    /**
2095     * A pointer to the contents in the success state.
2096     * Reading from this pointer when `result_ok` is not set is undefined.
2097     */
2098    struct LDKBolt12Invoice *result;
2099    /**
2100     * A pointer to the contents in the error state.
2101     * Reading from this pointer when `result_ok` is set is undefined.
2102     */
2103    enum LDKBolt12SemanticError *err;
2104 } LDKCResult_Bolt12InvoiceBolt12SemanticErrorZPtr;
2105
2106 /**
2107  * A CResult_Bolt12InvoiceBolt12SemanticErrorZ represents the result of a fallible operation,
2108  * containing a crate::lightning::offers::invoice::Bolt12Invoice on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
2109  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2110  */
2111 typedef struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ {
2112    /**
2113     * The contents of this CResult_Bolt12InvoiceBolt12SemanticErrorZ, accessible via either
2114     * `err` or `result` depending on the state of `result_ok`.
2115     */
2116    union LDKCResult_Bolt12InvoiceBolt12SemanticErrorZPtr contents;
2117    /**
2118     * Whether this CResult_Bolt12InvoiceBolt12SemanticErrorZ represents a success state.
2119     */
2120    bool result_ok;
2121 } LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ;
2122
2123 /**
2124  * Represents a secp256k1 Schnorr signature serialized as two 32-byte numbers
2125  */
2126 typedef struct LDKSchnorrSignature {
2127    /**
2128     * The bytes of the signature as two 32-byte numbers
2129     */
2130    uint8_t compact_form[64];
2131 } LDKSchnorrSignature;
2132
2133 /**
2134  * The contents of CResult_SchnorrSignatureNoneZ
2135  */
2136 typedef union LDKCResult_SchnorrSignatureNoneZPtr {
2137    /**
2138     * A pointer to the contents in the success state.
2139     * Reading from this pointer when `result_ok` is not set is undefined.
2140     */
2141    struct LDKSchnorrSignature *result;
2142    /**
2143     * Note that this value is always NULL, as there are no contents in the Err variant
2144     */
2145    void *err;
2146 } LDKCResult_SchnorrSignatureNoneZPtr;
2147
2148 /**
2149  * A CResult_SchnorrSignatureNoneZ represents the result of a fallible operation,
2150  * containing a crate::c_types::SchnorrSignature on success and a () on failure.
2151  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2152  */
2153 typedef struct LDKCResult_SchnorrSignatureNoneZ {
2154    /**
2155     * The contents of this CResult_SchnorrSignatureNoneZ, accessible via either
2156     * `err` or `result` depending on the state of `result_ok`.
2157     */
2158    union LDKCResult_SchnorrSignatureNoneZPtr contents;
2159    /**
2160     * Whether this CResult_SchnorrSignatureNoneZ represents a success state.
2161     */
2162    bool result_ok;
2163 } LDKCResult_SchnorrSignatureNoneZ;
2164
2165 /**
2166  * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
2167  * This corresponds to std::vector in C++
2168  */
2169 typedef struct LDKCVec_ThirtyTwoBytesZ {
2170    /**
2171     * The elements in the array.
2172     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2173     */
2174    struct LDKThirtyTwoBytes *data;
2175    /**
2176     * The number of elements pointed to by `data`.
2177     */
2178    uintptr_t datalen;
2179 } LDKCVec_ThirtyTwoBytesZ;
2180
2181 /**
2182  * An enum which can either contain a crate::c_types::derived::CVec_ThirtyTwoBytesZ or not
2183  */
2184 typedef enum LDKCOption_CVec_ThirtyTwoBytesZZ_Tag {
2185    /**
2186     * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains a crate::c_types::derived::CVec_ThirtyTwoBytesZ
2187     */
2188    LDKCOption_CVec_ThirtyTwoBytesZZ_Some,
2189    /**
2190     * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains nothing
2191     */
2192    LDKCOption_CVec_ThirtyTwoBytesZZ_None,
2193    /**
2194     * Must be last for serialization purposes
2195     */
2196    LDKCOption_CVec_ThirtyTwoBytesZZ_Sentinel,
2197 } LDKCOption_CVec_ThirtyTwoBytesZZ_Tag;
2198
2199 typedef struct LDKCOption_CVec_ThirtyTwoBytesZZ {
2200    LDKCOption_CVec_ThirtyTwoBytesZZ_Tag tag;
2201    union {
2202       struct {
2203          struct LDKCVec_ThirtyTwoBytesZ some;
2204       };
2205    };
2206 } LDKCOption_CVec_ThirtyTwoBytesZZ;
2207
2208 /**
2209  * A 3-byte byte array.
2210  */
2211 typedef struct LDKThreeBytes {
2212    /**
2213     * The three bytes
2214     */
2215    uint8_t data[3];
2216 } LDKThreeBytes;
2217
2218 /**
2219  * The minimum amount required for an item in an [`Offer`], denominated in either bitcoin or
2220  * another currency.
2221  */
2222 typedef enum LDKAmount_Tag {
2223    /**
2224     * An amount of bitcoin.
2225     */
2226    LDKAmount_Bitcoin,
2227    /**
2228     * An amount of currency specified using ISO 4712.
2229     */
2230    LDKAmount_Currency,
2231    /**
2232     * Must be last for serialization purposes
2233     */
2234    LDKAmount_Sentinel,
2235 } LDKAmount_Tag;
2236
2237 typedef struct LDKAmount_LDKBitcoin_Body {
2238    /**
2239     * The amount in millisatoshi.
2240     */
2241    uint64_t amount_msats;
2242 } LDKAmount_LDKBitcoin_Body;
2243
2244 typedef struct LDKAmount_LDKCurrency_Body {
2245    /**
2246     * The currency that the amount is denominated in.
2247     */
2248    struct LDKThreeBytes iso4217_code;
2249    /**
2250     * The amount in the currency unit adjusted by the ISO 4712 exponent (e.g., USD cents).
2251     */
2252    uint64_t amount;
2253 } LDKAmount_LDKCurrency_Body;
2254
2255 typedef struct MUST_USE_STRUCT LDKAmount {
2256    LDKAmount_Tag tag;
2257    union {
2258       LDKAmount_LDKBitcoin_Body bitcoin;
2259       LDKAmount_LDKCurrency_Body currency;
2260    };
2261 } LDKAmount;
2262
2263 /**
2264  * An enum which can either contain a crate::lightning::offers::offer::Amount or not
2265  */
2266 typedef enum LDKCOption_AmountZ_Tag {
2267    /**
2268     * When we're in this state, this COption_AmountZ contains a crate::lightning::offers::offer::Amount
2269     */
2270    LDKCOption_AmountZ_Some,
2271    /**
2272     * When we're in this state, this COption_AmountZ contains nothing
2273     */
2274    LDKCOption_AmountZ_None,
2275    /**
2276     * Must be last for serialization purposes
2277     */
2278    LDKCOption_AmountZ_Sentinel,
2279 } LDKCOption_AmountZ_Tag;
2280
2281 typedef struct LDKCOption_AmountZ {
2282    LDKCOption_AmountZ_Tag tag;
2283    union {
2284       struct {
2285          struct LDKAmount some;
2286       };
2287    };
2288 } LDKCOption_AmountZ;
2289
2290 /**
2291  * Quantity of items supported by an [`Offer`].
2292  */
2293 typedef enum LDKQuantity_Tag {
2294    /**
2295     * Up to a specific number of items (inclusive). Use when more than one item can be requested
2296     * but is limited (e.g., because of per customer or inventory limits).
2297     *
2298     * May be used with `NonZeroU64::new(1)` but prefer to use [`Quantity::One`] if only one item
2299     * is supported.
2300     */
2301    LDKQuantity_Bounded,
2302    /**
2303     * One or more items. Use when more than one item can be requested without any limit.
2304     */
2305    LDKQuantity_Unbounded,
2306    /**
2307     * Only one item. Use when only a single item can be requested.
2308     */
2309    LDKQuantity_One,
2310    /**
2311     * Must be last for serialization purposes
2312     */
2313    LDKQuantity_Sentinel,
2314 } LDKQuantity_Tag;
2315
2316 typedef struct MUST_USE_STRUCT LDKQuantity {
2317    LDKQuantity_Tag tag;
2318    union {
2319       struct {
2320          uint64_t bounded;
2321       };
2322    };
2323 } LDKQuantity;
2324
2325 /**
2326  * An enum which can either contain a crate::lightning::offers::offer::Quantity or not
2327  */
2328 typedef enum LDKCOption_QuantityZ_Tag {
2329    /**
2330     * When we're in this state, this COption_QuantityZ contains a crate::lightning::offers::offer::Quantity
2331     */
2332    LDKCOption_QuantityZ_Some,
2333    /**
2334     * When we're in this state, this COption_QuantityZ contains nothing
2335     */
2336    LDKCOption_QuantityZ_None,
2337    /**
2338     * Must be last for serialization purposes
2339     */
2340    LDKCOption_QuantityZ_Sentinel,
2341 } LDKCOption_QuantityZ_Tag;
2342
2343 typedef struct LDKCOption_QuantityZ {
2344    LDKCOption_QuantityZ_Tag tag;
2345    union {
2346       struct {
2347          struct LDKQuantity some;
2348       };
2349    };
2350 } LDKCOption_QuantityZ;
2351
2352 /**
2353  * The contents of CResult_ThirtyTwoBytesNoneZ
2354  */
2355 typedef union LDKCResult_ThirtyTwoBytesNoneZPtr {
2356    /**
2357     * A pointer to the contents in the success state.
2358     * Reading from this pointer when `result_ok` is not set is undefined.
2359     */
2360    struct LDKThirtyTwoBytes *result;
2361    /**
2362     * Note that this value is always NULL, as there are no contents in the Err variant
2363     */
2364    void *err;
2365 } LDKCResult_ThirtyTwoBytesNoneZPtr;
2366
2367 /**
2368  * A CResult_ThirtyTwoBytesNoneZ represents the result of a fallible operation,
2369  * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
2370  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2371  */
2372 typedef struct LDKCResult_ThirtyTwoBytesNoneZ {
2373    /**
2374     * The contents of this CResult_ThirtyTwoBytesNoneZ, accessible via either
2375     * `err` or `result` depending on the state of `result_ok`.
2376     */
2377    union LDKCResult_ThirtyTwoBytesNoneZPtr contents;
2378    /**
2379     * Whether this CResult_ThirtyTwoBytesNoneZ represents a success state.
2380     */
2381    bool result_ok;
2382 } LDKCResult_ThirtyTwoBytesNoneZ;
2383
2384
2385
2386 /**
2387  * Information needed to route a payment across a [`BlindedPath`].
2388  */
2389 typedef struct MUST_USE_STRUCT LDKBlindedPayInfo {
2390    /**
2391     * A pointer to the opaque Rust object.
2392     * Nearly everywhere, inner must be non-null, however in places where
2393     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2394     */
2395    LDKnativeBlindedPayInfo *inner;
2396    /**
2397     * Indicates that this is the only struct which contains the same pointer.
2398     * Rust functions which take ownership of an object provided via an argument require
2399     * this to be true and invalidate the object pointed to by inner.
2400     */
2401    bool is_owned;
2402 } LDKBlindedPayInfo;
2403
2404 /**
2405  * The contents of CResult_BlindedPayInfoDecodeErrorZ
2406  */
2407 typedef union LDKCResult_BlindedPayInfoDecodeErrorZPtr {
2408    /**
2409     * A pointer to the contents in the success state.
2410     * Reading from this pointer when `result_ok` is not set is undefined.
2411     */
2412    struct LDKBlindedPayInfo *result;
2413    /**
2414     * A pointer to the contents in the error state.
2415     * Reading from this pointer when `result_ok` is set is undefined.
2416     */
2417    struct LDKDecodeError *err;
2418 } LDKCResult_BlindedPayInfoDecodeErrorZPtr;
2419
2420 /**
2421  * A CResult_BlindedPayInfoDecodeErrorZ represents the result of a fallible operation,
2422  * containing a crate::lightning::offers::invoice::BlindedPayInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
2423  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2424  */
2425 typedef struct LDKCResult_BlindedPayInfoDecodeErrorZ {
2426    /**
2427     * The contents of this CResult_BlindedPayInfoDecodeErrorZ, accessible via either
2428     * `err` or `result` depending on the state of `result_ok`.
2429     */
2430    union LDKCResult_BlindedPayInfoDecodeErrorZPtr contents;
2431    /**
2432     * Whether this CResult_BlindedPayInfoDecodeErrorZ represents a success state.
2433     */
2434    bool result_ok;
2435 } LDKCResult_BlindedPayInfoDecodeErrorZ;
2436
2437
2438
2439 /**
2440  * Information about a spendable output to a P2WSH script.
2441  *
2442  * See [`SpendableOutputDescriptor::DelayedPaymentOutput`] for more details on how to spend this.
2443  */
2444 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
2445    /**
2446     * A pointer to the opaque Rust object.
2447     * Nearly everywhere, inner must be non-null, however in places where
2448     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2449     */
2450    LDKnativeDelayedPaymentOutputDescriptor *inner;
2451    /**
2452     * Indicates that this is the only struct which contains the same pointer.
2453     * Rust functions which take ownership of an object provided via an argument require
2454     * this to be true and invalidate the object pointed to by inner.
2455     */
2456    bool is_owned;
2457 } LDKDelayedPaymentOutputDescriptor;
2458
2459 /**
2460  * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
2461  */
2462 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
2463    /**
2464     * A pointer to the contents in the success state.
2465     * Reading from this pointer when `result_ok` is not set is undefined.
2466     */
2467    struct LDKDelayedPaymentOutputDescriptor *result;
2468    /**
2469     * A pointer to the contents in the error state.
2470     * Reading from this pointer when `result_ok` is set is undefined.
2471     */
2472    struct LDKDecodeError *err;
2473 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
2474
2475 /**
2476  * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2477  * containing a crate::lightning::sign::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2478  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2479  */
2480 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
2481    /**
2482     * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
2483     * `err` or `result` depending on the state of `result_ok`.
2484     */
2485    union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
2486    /**
2487     * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
2488     */
2489    bool result_ok;
2490 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
2491
2492
2493
2494 /**
2495  * Information about a spendable output to our \"payment key\".
2496  *
2497  * See [`SpendableOutputDescriptor::StaticPaymentOutput`] for more details on how to spend this.
2498  */
2499 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
2500    /**
2501     * A pointer to the opaque Rust object.
2502     * Nearly everywhere, inner must be non-null, however in places where
2503     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2504     */
2505    LDKnativeStaticPaymentOutputDescriptor *inner;
2506    /**
2507     * Indicates that this is the only struct which contains the same pointer.
2508     * Rust functions which take ownership of an object provided via an argument require
2509     * this to be true and invalidate the object pointed to by inner.
2510     */
2511    bool is_owned;
2512 } LDKStaticPaymentOutputDescriptor;
2513
2514 /**
2515  * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
2516  */
2517 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
2518    /**
2519     * A pointer to the contents in the success state.
2520     * Reading from this pointer when `result_ok` is not set is undefined.
2521     */
2522    struct LDKStaticPaymentOutputDescriptor *result;
2523    /**
2524     * A pointer to the contents in the error state.
2525     * Reading from this pointer when `result_ok` is set is undefined.
2526     */
2527    struct LDKDecodeError *err;
2528 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
2529
2530 /**
2531  * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2532  * containing a crate::lightning::sign::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2533  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2534  */
2535 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
2536    /**
2537     * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
2538     * `err` or `result` depending on the state of `result_ok`.
2539     */
2540    union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
2541    /**
2542     * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
2543     */
2544    bool result_ok;
2545 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
2546
2547
2548
2549 /**
2550  * A reference to a transaction output.
2551  *
2552  * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
2553  * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
2554  */
2555 typedef struct MUST_USE_STRUCT LDKOutPoint {
2556    /**
2557     * A pointer to the opaque Rust object.
2558     * Nearly everywhere, inner must be non-null, however in places where
2559     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2560     */
2561    LDKnativeOutPoint *inner;
2562    /**
2563     * Indicates that this is the only struct which contains the same pointer.
2564     * Rust functions which take ownership of an object provided via an argument require
2565     * this to be true and invalidate the object pointed to by inner.
2566     */
2567    bool is_owned;
2568 } LDKOutPoint;
2569
2570 /**
2571  * Describes the necessary information to spend a spendable output.
2572  *
2573  * When on-chain outputs are created by LDK (which our counterparty is not able to claim at any
2574  * point in the future) a [`SpendableOutputs`] event is generated which you must track and be able
2575  * to spend on-chain. The information needed to do this is provided in this enum, including the
2576  * outpoint describing which `txid` and output `index` is available, the full output which exists
2577  * at that `txid`/`index`, and any keys or other information required to sign.
2578  *
2579  * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
2580  */
2581 typedef enum LDKSpendableOutputDescriptor_Tag {
2582    /**
2583     * An output to a script which was provided via [`SignerProvider`] directly, either from
2584     * [`get_destination_script`] or [`get_shutdown_scriptpubkey`], thus you should already
2585     * know how to spend it. No secret keys are provided as LDK was never given any key.
2586     * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
2587     * on-chain using the payment preimage or after it has timed out.
2588     *
2589     * [`get_shutdown_scriptpubkey`]: SignerProvider::get_shutdown_scriptpubkey
2590     * [`get_destination_script`]: SignerProvider::get_shutdown_scriptpubkey
2591     */
2592    LDKSpendableOutputDescriptor_StaticOutput,
2593    /**
2594     * An output to a P2WSH script which can be spent with a single signature after an `OP_CSV`
2595     * delay.
2596     *
2597     * The witness in the spending input should be:
2598     * ```bitcoin
2599     * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
2600     * ```
2601     *
2602     * Note that the `nSequence` field in the spending input must be set to
2603     * [`DelayedPaymentOutputDescriptor::to_self_delay`] (which means the transaction is not
2604     * broadcastable until at least [`DelayedPaymentOutputDescriptor::to_self_delay`] blocks after
2605     * the outpoint confirms, see [BIP
2606     * 68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki)). Also note that LDK
2607     * won't generate a [`SpendableOutputDescriptor`] until the corresponding block height
2608     * is reached.
2609     *
2610     * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2611     * it is an output from an old state which we broadcast (which should never happen).
2612     *
2613     * To derive the delayed payment key which is used to sign this input, you must pass the
2614     * holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the
2615     * [`ChannelPublicKeys::delayed_payment_basepoint`] in [`ChannelSigner::pubkeys`]) and the provided
2616     * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The DelayedPaymentKey can be
2617     * generated without the secret key using [`DelayedPaymentKey::from_basepoint`] and only the
2618     * [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`ChannelSigner::pubkeys`].
2619     *
2620     * To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is
2621     * used in the witness script generation), you must pass the counterparty
2622     * [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to
2623     * [`ChannelSigner::provide_channel_parameters`]) and the provided
2624     * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to
2625     * [`RevocationKey`].
2626     *
2627     * The witness script which is hashed and included in the output `script_pubkey` may be
2628     * regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived
2629     * as explained above), our delayed payment pubkey (derived as explained above), and the
2630     * [`DelayedPaymentOutputDescriptor::to_self_delay`] contained here to
2631     * [`chan_utils::get_revokeable_redeemscript`].
2632     */
2633    LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2634    /**
2635     * An output spendable exclusively by our payment key (i.e., the private key that corresponds
2636     * to the `payment_point` in [`ChannelSigner::pubkeys`]). The output type depends on the
2637     * channel type negotiated.
2638     *
2639     * On an anchor outputs channel, the witness in the spending input is:
2640     * ```bitcoin
2641     * <BIP 143 signature> <witness script>
2642     * ```
2643     *
2644     * Otherwise, it is:
2645     * ```bitcoin
2646     * <BIP 143 signature> <payment key>
2647     * ```
2648     *
2649     * These are generally the result of our counterparty having broadcast the current state,
2650     * allowing us to claim the non-HTLC-encumbered outputs immediately, or after one confirmation
2651     * in the case of anchor outputs channels.
2652     */
2653    LDKSpendableOutputDescriptor_StaticPaymentOutput,
2654    /**
2655     * Must be last for serialization purposes
2656     */
2657    LDKSpendableOutputDescriptor_Sentinel,
2658 } LDKSpendableOutputDescriptor_Tag;
2659
2660 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2661    /**
2662     * The outpoint which is spendable.
2663     */
2664    struct LDKOutPoint outpoint;
2665    /**
2666     * The output which is referenced by the given outpoint.
2667     */
2668    struct LDKTxOut output;
2669    /**
2670     * The `channel_keys_id` for the channel which this output came from.
2671     *
2672     * For channels which were generated on LDK 0.0.119 or later, this is the value which was
2673     * passed to the [`SignerProvider::get_destination_script`] call which provided this
2674     * output script.
2675     *
2676     * For channels which were generated prior to LDK 0.0.119, no such argument existed,
2677     * however this field may still be filled in if such data is available.
2678     *
2679     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2680     */
2681    struct LDKThirtyTwoBytes channel_keys_id;
2682 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2683
2684 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2685    LDKSpendableOutputDescriptor_Tag tag;
2686    union {
2687       LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2688       struct {
2689          struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2690       };
2691       struct {
2692          struct LDKStaticPaymentOutputDescriptor static_payment_output;
2693       };
2694    };
2695 } LDKSpendableOutputDescriptor;
2696
2697 /**
2698  * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
2699  */
2700 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
2701    /**
2702     * A pointer to the contents in the success state.
2703     * Reading from this pointer when `result_ok` is not set is undefined.
2704     */
2705    struct LDKSpendableOutputDescriptor *result;
2706    /**
2707     * A pointer to the contents in the error state.
2708     * Reading from this pointer when `result_ok` is set is undefined.
2709     */
2710    struct LDKDecodeError *err;
2711 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
2712
2713 /**
2714  * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2715  * containing a crate::lightning::sign::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2716  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2717  */
2718 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
2719    /**
2720     * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
2721     * `err` or `result` depending on the state of `result_ok`.
2722     */
2723    union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
2724    /**
2725     * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
2726     */
2727    bool result_ok;
2728 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
2729
2730 /**
2731  * A dynamically-allocated array of crate::lightning::sign::SpendableOutputDescriptors of arbitrary size.
2732  * This corresponds to std::vector in C++
2733  */
2734 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2735    /**
2736     * The elements in the array.
2737     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2738     */
2739    struct LDKSpendableOutputDescriptor *data;
2740    /**
2741     * The number of elements pointed to by `data`.
2742     */
2743    uintptr_t datalen;
2744 } LDKCVec_SpendableOutputDescriptorZ;
2745
2746 /**
2747  * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
2748  * This corresponds to std::vector in C++
2749  */
2750 typedef struct LDKCVec_TxOutZ {
2751    /**
2752     * The elements in the array.
2753     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2754     */
2755    struct LDKTxOut *data;
2756    /**
2757     * The number of elements pointed to by `data`.
2758     */
2759    uintptr_t datalen;
2760 } LDKCVec_TxOutZ;
2761
2762 /**
2763  * An enum which can either contain a u32 or not
2764  */
2765 typedef enum LDKCOption_u32Z_Tag {
2766    /**
2767     * When we're in this state, this COption_u32Z contains a u32
2768     */
2769    LDKCOption_u32Z_Some,
2770    /**
2771     * When we're in this state, this COption_u32Z contains nothing
2772     */
2773    LDKCOption_u32Z_None,
2774    /**
2775     * Must be last for serialization purposes
2776     */
2777    LDKCOption_u32Z_Sentinel,
2778 } LDKCOption_u32Z_Tag;
2779
2780 typedef struct LDKCOption_u32Z {
2781    LDKCOption_u32Z_Tag tag;
2782    union {
2783       struct {
2784          uint32_t some;
2785       };
2786    };
2787 } LDKCOption_u32Z;
2788
2789 /**
2790  * A tuple of 2 elements. See the individual fields for the types contained.
2791  */
2792 typedef struct LDKC2Tuple_CVec_u8Zu64Z {
2793    /**
2794     * The element at position 0
2795     */
2796    struct LDKCVec_u8Z a;
2797    /**
2798     * The element at position 1
2799     */
2800    uint64_t b;
2801 } LDKC2Tuple_CVec_u8Zu64Z;
2802
2803 /**
2804  * The contents of CResult_C2Tuple_CVec_u8Zu64ZNoneZ
2805  */
2806 typedef union LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr {
2807    /**
2808     * A pointer to the contents in the success state.
2809     * Reading from this pointer when `result_ok` is not set is undefined.
2810     */
2811    struct LDKC2Tuple_CVec_u8Zu64Z *result;
2812    /**
2813     * Note that this value is always NULL, as there are no contents in the Err variant
2814     */
2815    void *err;
2816 } LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr;
2817
2818 /**
2819  * A CResult_C2Tuple_CVec_u8Zu64ZNoneZ represents the result of a fallible operation,
2820  * containing a crate::c_types::derived::C2Tuple_CVec_u8Zu64Z on success and a () on failure.
2821  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2822  */
2823 typedef struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ {
2824    /**
2825     * The contents of this CResult_C2Tuple_CVec_u8Zu64ZNoneZ, accessible via either
2826     * `err` or `result` depending on the state of `result_ok`.
2827     */
2828    union LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr contents;
2829    /**
2830     * Whether this CResult_C2Tuple_CVec_u8Zu64ZNoneZ represents a success state.
2831     */
2832    bool result_ok;
2833 } LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ;
2834
2835
2836
2837 /**
2838  * The parameters required to derive a channel signer via [`SignerProvider`].
2839  */
2840 typedef struct MUST_USE_STRUCT LDKChannelDerivationParameters {
2841    /**
2842     * A pointer to the opaque Rust object.
2843     * Nearly everywhere, inner must be non-null, however in places where
2844     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2845     */
2846    LDKnativeChannelDerivationParameters *inner;
2847    /**
2848     * Indicates that this is the only struct which contains the same pointer.
2849     * Rust functions which take ownership of an object provided via an argument require
2850     * this to be true and invalidate the object pointed to by inner.
2851     */
2852    bool is_owned;
2853 } LDKChannelDerivationParameters;
2854
2855 /**
2856  * The contents of CResult_ChannelDerivationParametersDecodeErrorZ
2857  */
2858 typedef union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr {
2859    /**
2860     * A pointer to the contents in the success state.
2861     * Reading from this pointer when `result_ok` is not set is undefined.
2862     */
2863    struct LDKChannelDerivationParameters *result;
2864    /**
2865     * A pointer to the contents in the error state.
2866     * Reading from this pointer when `result_ok` is set is undefined.
2867     */
2868    struct LDKDecodeError *err;
2869 } LDKCResult_ChannelDerivationParametersDecodeErrorZPtr;
2870
2871 /**
2872  * A CResult_ChannelDerivationParametersDecodeErrorZ represents the result of a fallible operation,
2873  * containing a crate::lightning::sign::ChannelDerivationParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2874  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2875  */
2876 typedef struct LDKCResult_ChannelDerivationParametersDecodeErrorZ {
2877    /**
2878     * The contents of this CResult_ChannelDerivationParametersDecodeErrorZ, accessible via either
2879     * `err` or `result` depending on the state of `result_ok`.
2880     */
2881    union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr contents;
2882    /**
2883     * Whether this CResult_ChannelDerivationParametersDecodeErrorZ represents a success state.
2884     */
2885    bool result_ok;
2886 } LDKCResult_ChannelDerivationParametersDecodeErrorZ;
2887
2888
2889
2890 /**
2891  * A descriptor used to sign for a commitment transaction's HTLC output.
2892  */
2893 typedef struct MUST_USE_STRUCT LDKHTLCDescriptor {
2894    /**
2895     * A pointer to the opaque Rust object.
2896     * Nearly everywhere, inner must be non-null, however in places where
2897     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2898     */
2899    LDKnativeHTLCDescriptor *inner;
2900    /**
2901     * Indicates that this is the only struct which contains the same pointer.
2902     * Rust functions which take ownership of an object provided via an argument require
2903     * this to be true and invalidate the object pointed to by inner.
2904     */
2905    bool is_owned;
2906 } LDKHTLCDescriptor;
2907
2908 /**
2909  * The contents of CResult_HTLCDescriptorDecodeErrorZ
2910  */
2911 typedef union LDKCResult_HTLCDescriptorDecodeErrorZPtr {
2912    /**
2913     * A pointer to the contents in the success state.
2914     * Reading from this pointer when `result_ok` is not set is undefined.
2915     */
2916    struct LDKHTLCDescriptor *result;
2917    /**
2918     * A pointer to the contents in the error state.
2919     * Reading from this pointer when `result_ok` is set is undefined.
2920     */
2921    struct LDKDecodeError *err;
2922 } LDKCResult_HTLCDescriptorDecodeErrorZPtr;
2923
2924 /**
2925  * A CResult_HTLCDescriptorDecodeErrorZ represents the result of a fallible operation,
2926  * containing a crate::lightning::sign::HTLCDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2927  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2928  */
2929 typedef struct LDKCResult_HTLCDescriptorDecodeErrorZ {
2930    /**
2931     * The contents of this CResult_HTLCDescriptorDecodeErrorZ, accessible via either
2932     * `err` or `result` depending on the state of `result_ok`.
2933     */
2934    union LDKCResult_HTLCDescriptorDecodeErrorZPtr contents;
2935    /**
2936     * Whether this CResult_HTLCDescriptorDecodeErrorZ represents a success state.
2937     */
2938    bool result_ok;
2939 } LDKCResult_HTLCDescriptorDecodeErrorZ;
2940
2941 /**
2942  * The contents of CResult_NoneNoneZ
2943  */
2944 typedef union LDKCResult_NoneNoneZPtr {
2945    /**
2946     * Note that this value is always NULL, as there are no contents in the OK variant
2947     */
2948    void *result;
2949    /**
2950     * Note that this value is always NULL, as there are no contents in the Err variant
2951     */
2952    void *err;
2953 } LDKCResult_NoneNoneZPtr;
2954
2955 /**
2956  * A CResult_NoneNoneZ represents the result of a fallible operation,
2957  * containing a () on success and a () on failure.
2958  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2959  */
2960 typedef struct LDKCResult_NoneNoneZ {
2961    /**
2962     * The contents of this CResult_NoneNoneZ, accessible via either
2963     * `err` or `result` depending on the state of `result_ok`.
2964     */
2965    union LDKCResult_NoneNoneZPtr contents;
2966    /**
2967     * Whether this CResult_NoneNoneZ represents a success state.
2968     */
2969    bool result_ok;
2970 } LDKCResult_NoneNoneZ;
2971
2972 /**
2973  * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
2974  */
2975 typedef struct LDKPublicKey {
2976    /**
2977     * The bytes of the public key
2978     */
2979    uint8_t compressed_form[33];
2980 } LDKPublicKey;
2981
2982 /**
2983  * The contents of CResult_PublicKeyNoneZ
2984  */
2985 typedef union LDKCResult_PublicKeyNoneZPtr {
2986    /**
2987     * A pointer to the contents in the success state.
2988     * Reading from this pointer when `result_ok` is not set is undefined.
2989     */
2990    struct LDKPublicKey *result;
2991    /**
2992     * Note that this value is always NULL, as there are no contents in the Err variant
2993     */
2994    void *err;
2995 } LDKCResult_PublicKeyNoneZPtr;
2996
2997 /**
2998  * A CResult_PublicKeyNoneZ represents the result of a fallible operation,
2999  * containing a crate::c_types::PublicKey on success and a () on failure.
3000  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3001  */
3002 typedef struct LDKCResult_PublicKeyNoneZ {
3003    /**
3004     * The contents of this CResult_PublicKeyNoneZ, accessible via either
3005     * `err` or `result` depending on the state of `result_ok`.
3006     */
3007    union LDKCResult_PublicKeyNoneZPtr contents;
3008    /**
3009     * Whether this CResult_PublicKeyNoneZ represents a success state.
3010     */
3011    bool result_ok;
3012 } LDKCResult_PublicKeyNoneZ;
3013
3014 /**
3015  * An enum which can either contain a crate::c_types::BigEndianScalar or not
3016  */
3017 typedef enum LDKCOption_BigEndianScalarZ_Tag {
3018    /**
3019     * When we're in this state, this COption_BigEndianScalarZ contains a crate::c_types::BigEndianScalar
3020     */
3021    LDKCOption_BigEndianScalarZ_Some,
3022    /**
3023     * When we're in this state, this COption_BigEndianScalarZ contains nothing
3024     */
3025    LDKCOption_BigEndianScalarZ_None,
3026    /**
3027     * Must be last for serialization purposes
3028     */
3029    LDKCOption_BigEndianScalarZ_Sentinel,
3030 } LDKCOption_BigEndianScalarZ_Tag;
3031
3032 typedef struct LDKCOption_BigEndianScalarZ {
3033    LDKCOption_BigEndianScalarZ_Tag tag;
3034    union {
3035       struct {
3036          struct LDKBigEndianScalar some;
3037       };
3038    };
3039 } LDKCOption_BigEndianScalarZ;
3040
3041 /**
3042  * Integer in the range `0..32`
3043  */
3044 typedef struct LDKU5 {
3045    uint8_t _0;
3046 } LDKU5;
3047
3048 /**
3049  * A dynamically-allocated array of crate::c_types::U5s of arbitrary size.
3050  * This corresponds to std::vector in C++
3051  */
3052 typedef struct LDKCVec_U5Z {
3053    /**
3054     * The elements in the array.
3055     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3056     */
3057    struct LDKU5 *data;
3058    /**
3059     * The number of elements pointed to by `data`.
3060     */
3061    uintptr_t datalen;
3062 } LDKCVec_U5Z;
3063
3064 /**
3065  * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
3066  * allows recovering the exact public key which created the signature given the message.
3067  */
3068 typedef struct LDKRecoverableSignature {
3069    /**
3070     * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
3071     * recovery.
3072     */
3073    uint8_t serialized_form[68];
3074 } LDKRecoverableSignature;
3075
3076 /**
3077  * The contents of CResult_RecoverableSignatureNoneZ
3078  */
3079 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
3080    /**
3081     * A pointer to the contents in the success state.
3082     * Reading from this pointer when `result_ok` is not set is undefined.
3083     */
3084    struct LDKRecoverableSignature *result;
3085    /**
3086     * Note that this value is always NULL, as there are no contents in the Err variant
3087     */
3088    void *err;
3089 } LDKCResult_RecoverableSignatureNoneZPtr;
3090
3091 /**
3092  * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
3093  * containing a crate::c_types::RecoverableSignature on success and a () on failure.
3094  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3095  */
3096 typedef struct LDKCResult_RecoverableSignatureNoneZ {
3097    /**
3098     * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
3099     * `err` or `result` depending on the state of `result_ok`.
3100     */
3101    union LDKCResult_RecoverableSignatureNoneZPtr contents;
3102    /**
3103     * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
3104     */
3105    bool result_ok;
3106 } LDKCResult_RecoverableSignatureNoneZ;
3107
3108 /**
3109  * Represents a secp256k1 ECDSA signature serialized as two 32-byte numbers
3110  */
3111 typedef struct LDKECDSASignature {
3112    /**
3113     * The bytes of the signature in "compact" form
3114     */
3115    uint8_t compact_form[64];
3116 } LDKECDSASignature;
3117
3118 /**
3119  * The contents of CResult_ECDSASignatureNoneZ
3120  */
3121 typedef union LDKCResult_ECDSASignatureNoneZPtr {
3122    /**
3123     * A pointer to the contents in the success state.
3124     * Reading from this pointer when `result_ok` is not set is undefined.
3125     */
3126    struct LDKECDSASignature *result;
3127    /**
3128     * Note that this value is always NULL, as there are no contents in the Err variant
3129     */
3130    void *err;
3131 } LDKCResult_ECDSASignatureNoneZPtr;
3132
3133 /**
3134  * A CResult_ECDSASignatureNoneZ represents the result of a fallible operation,
3135  * containing a crate::c_types::ECDSASignature on success and a () on failure.
3136  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3137  */
3138 typedef struct LDKCResult_ECDSASignatureNoneZ {
3139    /**
3140     * The contents of this CResult_ECDSASignatureNoneZ, accessible via either
3141     * `err` or `result` depending on the state of `result_ok`.
3142     */
3143    union LDKCResult_ECDSASignatureNoneZPtr contents;
3144    /**
3145     * Whether this CResult_ECDSASignatureNoneZ represents a success state.
3146     */
3147    bool result_ok;
3148 } LDKCResult_ECDSASignatureNoneZ;
3149
3150 /**
3151  * The contents of CResult_TransactionNoneZ
3152  */
3153 typedef union LDKCResult_TransactionNoneZPtr {
3154    /**
3155     * A pointer to the contents in the success state.
3156     * Reading from this pointer when `result_ok` is not set is undefined.
3157     */
3158    struct LDKTransaction *result;
3159    /**
3160     * Note that this value is always NULL, as there are no contents in the Err variant
3161     */
3162    void *err;
3163 } LDKCResult_TransactionNoneZPtr;
3164
3165 /**
3166  * A CResult_TransactionNoneZ represents the result of a fallible operation,
3167  * containing a crate::c_types::Transaction on success and a () on failure.
3168  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3169  */
3170 typedef struct LDKCResult_TransactionNoneZ {
3171    /**
3172     * The contents of this CResult_TransactionNoneZ, accessible via either
3173     * `err` or `result` depending on the state of `result_ok`.
3174     */
3175    union LDKCResult_TransactionNoneZPtr contents;
3176    /**
3177     * Whether this CResult_TransactionNoneZ represents a success state.
3178     */
3179    bool result_ok;
3180 } LDKCResult_TransactionNoneZ;
3181
3182 /**
3183  * A dynamically-allocated array of crate::c_types::ECDSASignatures of arbitrary size.
3184  * This corresponds to std::vector in C++
3185  */
3186 typedef struct LDKCVec_ECDSASignatureZ {
3187    /**
3188     * The elements in the array.
3189     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3190     */
3191    struct LDKECDSASignature *data;
3192    /**
3193     * The number of elements pointed to by `data`.
3194     */
3195    uintptr_t datalen;
3196 } LDKCVec_ECDSASignatureZ;
3197
3198 /**
3199  * A tuple of 2 elements. See the individual fields for the types contained.
3200  */
3201 typedef struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ {
3202    /**
3203     * The element at position 0
3204     */
3205    struct LDKECDSASignature a;
3206    /**
3207     * The element at position 1
3208     */
3209    struct LDKCVec_ECDSASignatureZ b;
3210 } LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ;
3211
3212 /**
3213  * The contents of CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ
3214  */
3215 typedef union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr {
3216    /**
3217     * A pointer to the contents in the success state.
3218     * Reading from this pointer when `result_ok` is not set is undefined.
3219     */
3220    struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *result;
3221    /**
3222     * Note that this value is always NULL, as there are no contents in the Err variant
3223     */
3224    void *err;
3225 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr;
3226
3227 /**
3228  * A CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents the result of a fallible operation,
3229  * containing a crate::c_types::derived::C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ on success and a () on failure.
3230  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3231  */
3232 typedef struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ {
3233    /**
3234     * The contents of this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ, accessible via either
3235     * `err` or `result` depending on the state of `result_ok`.
3236     */
3237    union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr contents;
3238    /**
3239     * Whether this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents a success state.
3240     */
3241    bool result_ok;
3242 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ;
3243
3244
3245
3246 /**
3247  * This class tracks the per-transaction information needed to build a commitment transaction and will
3248  * actually build it and sign.  It is used for holder transactions that we sign only when needed
3249  * and for transactions we sign for the counterparty.
3250  *
3251  * This class can be used inside a signer implementation to generate a signature given the relevant
3252  * secret key.
3253  */
3254 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
3255    /**
3256     * A pointer to the opaque Rust object.
3257     * Nearly everywhere, inner must be non-null, however in places where
3258     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3259     */
3260    LDKnativeCommitmentTransaction *inner;
3261    /**
3262     * Indicates that this is the only struct which contains the same pointer.
3263     * Rust functions which take ownership of an object provided via an argument require
3264     * this to be true and invalidate the object pointed to by inner.
3265     */
3266    bool is_owned;
3267 } LDKCommitmentTransaction;
3268
3269
3270
3271 /**
3272  * Information needed to build and sign a holder's commitment transaction.
3273  *
3274  * The transaction is only signed once we are ready to broadcast.
3275  */
3276 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
3277    /**
3278     * A pointer to the opaque Rust object.
3279     * Nearly everywhere, inner must be non-null, however in places where
3280     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3281     */
3282    LDKnativeHolderCommitmentTransaction *inner;
3283    /**
3284     * Indicates that this is the only struct which contains the same pointer.
3285     * Rust functions which take ownership of an object provided via an argument require
3286     * this to be true and invalidate the object pointed to by inner.
3287     */
3288    bool is_owned;
3289 } LDKHolderCommitmentTransaction;
3290
3291
3292
3293 /**
3294  * Information about an HTLC as it appears in a commitment transaction
3295  */
3296 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
3297    /**
3298     * A pointer to the opaque Rust object.
3299     * Nearly everywhere, inner must be non-null, however in places where
3300     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3301     */
3302    LDKnativeHTLCOutputInCommitment *inner;
3303    /**
3304     * Indicates that this is the only struct which contains the same pointer.
3305     * Rust functions which take ownership of an object provided via an argument require
3306     * this to be true and invalidate the object pointed to by inner.
3307     */
3308    bool is_owned;
3309 } LDKHTLCOutputInCommitment;
3310
3311
3312
3313 /**
3314  * This class tracks the per-transaction information needed to build a closing transaction and will
3315  * actually build it and sign.
3316  *
3317  * This class can be used inside a signer implementation to generate a signature given the relevant
3318  * secret key.
3319  */
3320 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
3321    /**
3322     * A pointer to the opaque Rust object.
3323     * Nearly everywhere, inner must be non-null, however in places where
3324     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3325     */
3326    LDKnativeClosingTransaction *inner;
3327    /**
3328     * Indicates that this is the only struct which contains the same pointer.
3329     * Rust functions which take ownership of an object provided via an argument require
3330     * this to be true and invalidate the object pointed to by inner.
3331     */
3332    bool is_owned;
3333 } LDKClosingTransaction;
3334
3335
3336
3337 /**
3338  * The unsigned part of a [`channel_announcement`] message.
3339  *
3340  * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
3341  */
3342 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
3343    /**
3344     * A pointer to the opaque Rust object.
3345     * Nearly everywhere, inner must be non-null, however in places where
3346     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3347     */
3348    LDKnativeUnsignedChannelAnnouncement *inner;
3349    /**
3350     * Indicates that this is the only struct which contains the same pointer.
3351     * Rust functions which take ownership of an object provided via an argument require
3352     * this to be true and invalidate the object pointed to by inner.
3353     */
3354    bool is_owned;
3355 } LDKUnsignedChannelAnnouncement;
3356
3357
3358
3359 /**
3360  * One counterparty's public keys which do not change over the life of a channel.
3361  */
3362 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
3363    /**
3364     * A pointer to the opaque Rust object.
3365     * Nearly everywhere, inner must be non-null, however in places where
3366     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3367     */
3368    LDKnativeChannelPublicKeys *inner;
3369    /**
3370     * Indicates that this is the only struct which contains the same pointer.
3371     * Rust functions which take ownership of an object provided via an argument require
3372     * this to be true and invalidate the object pointed to by inner.
3373     */
3374    bool is_owned;
3375 } LDKChannelPublicKeys;
3376
3377
3378
3379 /**
3380  * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
3381  * The fields are organized by holder/counterparty.
3382  *
3383  * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
3384  * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
3385  */
3386 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
3387    /**
3388     * A pointer to the opaque Rust object.
3389     * Nearly everywhere, inner must be non-null, however in places where
3390     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3391     */
3392    LDKnativeChannelTransactionParameters *inner;
3393    /**
3394     * Indicates that this is the only struct which contains the same pointer.
3395     * Rust functions which take ownership of an object provided via an argument require
3396     * this to be true and invalidate the object pointed to by inner.
3397     */
3398    bool is_owned;
3399 } LDKChannelTransactionParameters;
3400
3401 /**
3402  * A trait to handle Lightning channel key material without concretizing the channel type or
3403  * the signature mechanism.
3404  */
3405 typedef struct LDKChannelSigner {
3406    /**
3407     * An opaque pointer which is passed to your function implementations as an argument.
3408     * This has no meaning in the LDK, and can be NULL or any other value.
3409     */
3410    void *this_arg;
3411    /**
3412     * Gets the per-commitment point for a specific commitment number
3413     *
3414     * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
3415     */
3416    struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
3417    /**
3418     * Gets the commitment secret for a specific commitment number as part of the revocation process
3419     *
3420     * An external signer implementation should error here if the commitment was already signed
3421     * and should refuse to sign it in the future.
3422     *
3423     * May be called more than once for the same index.
3424     *
3425     * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
3426     */
3427    struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
3428    /**
3429     * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
3430     *
3431     * This is required in order for the signer to make sure that releasing a commitment
3432     * secret won't leave us without a broadcastable holder transaction.
3433     * Policy checks should be implemented in this function, including checking the amount
3434     * sent to us and checking the HTLCs.
3435     *
3436     * The preimages of outbound HTLCs that were fulfilled since the last commitment are provided.
3437     * A validating signer should ensure that an HTLC output is removed only when the matching
3438     * preimage is provided, or when the value to holder is restored.
3439     *
3440     * Note that all the relevant preimages will be provided, but there may also be additional
3441     * irrelevant or duplicate preimages.
3442     */
3443    struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages);
3444    /**
3445     * Validate the counterparty's revocation.
3446     *
3447     * This is required in order for the signer to make sure that the state has moved
3448     * forward and it is safe to sign the next counterparty commitment.
3449     */
3450    struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
3451    /**
3452     * Returns the holder's channel public keys and basepoints.
3453     */
3454    struct LDKChannelPublicKeys pubkeys;
3455    /**
3456     * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
3457     * Note that this takes a pointer to this object, not the this_ptr like other methods do
3458     * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
3459     */
3460    void (*set_pubkeys)(const struct LDKChannelSigner*NONNULL_PTR );
3461    /**
3462     * Returns an arbitrary identifier describing the set of keys which are provided back to you in
3463     * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this
3464     * [`EcdsaChannelSigner`] object uniquely and lookup or re-derive its keys.
3465     */
3466    struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
3467    /**
3468     * Set the counterparty static channel data, including basepoints,
3469     * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint.
3470     *
3471     * This data is static, and will never change for a channel once set. For a given [`ChannelSigner`]
3472     * instance, LDK will call this method exactly once - either immediately after construction
3473     * (not including if done via [`SignerProvider::read_chan_signer`]) or when the funding
3474     * information has been generated.
3475     *
3476     * channel_parameters.is_populated() MUST be true.
3477     */
3478    void (*provide_channel_parameters)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
3479    /**
3480     * Frees any resources associated with this object given its this_arg pointer.
3481     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3482     */
3483    void (*free)(void *this_arg);
3484 } LDKChannelSigner;
3485
3486 /**
3487  * A trait to sign Lightning channel transactions as described in
3488  * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md).
3489  *
3490  * Signing services could be implemented on a hardware wallet and should implement signing
3491  * policies in order to be secure. Please refer to the [VLS Policy
3492  * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md)
3493  * for an example of such policies.
3494  */
3495 typedef struct LDKEcdsaChannelSigner {
3496    /**
3497     * An opaque pointer which is passed to your function implementations as an argument.
3498     * This has no meaning in the LDK, and can be NULL or any other value.
3499     */
3500    void *this_arg;
3501    /**
3502     * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
3503     *
3504     * Note that if signing fails or is rejected, the channel will be force-closed.
3505     *
3506     * Policy checks should be implemented in this function, including checking the amount
3507     * sent to us and checking the HTLCs.
3508     *
3509     * The preimages of outbound and inbound HTLCs that were fulfilled since the last commitment
3510     * are provided. A validating signer should ensure that an outbound HTLC output is removed
3511     * only when the matching preimage is provided and after the corresponding inbound HTLC has
3512     * been removed for forwarded payments.
3513     *
3514     * Note that all the relevant preimages will be provided, but there may also be additional
3515     * irrelevant or duplicate preimages.
3516     */
3517    struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_ThirtyTwoBytesZ inbound_htlc_preimages, struct LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages);
3518    /**
3519     * Creates a signature for a holder's commitment transaction.
3520     *
3521     * This will be called
3522     * - with a non-revoked `commitment_tx`.
3523     * - with the latest `commitment_tx` when we initiate a force-close.
3524     *
3525     * This may be called multiple times for the same transaction.
3526     *
3527     * An external signer implementation should check that the commitment has not been revoked.
3528     *
3529     * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3530     * signature and should be retried later. Once the signer is ready to provide a signature after
3531     * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3532     * monitor.
3533     *
3534     * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3535     */
3536    struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
3537    /**
3538     * Create a signature for the given input in a transaction spending an HTLC transaction output
3539     * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
3540     *
3541     * A justice transaction may claim multiple outputs at the same time if timelocks are
3542     * similar, but only a signature for the input at index `input` should be signed for here.
3543     * It may be called multiple times for same output(s) if a fee-bump is needed with regards
3544     * to an upcoming timelock expiration.
3545     *
3546     * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3547     *
3548     * `per_commitment_key` is revocation secret which was provided by our counterparty when they
3549     * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3550     * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
3551     * so).
3552     *
3553     * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3554     * signature and should be retried later. Once the signer is ready to provide a signature after
3555     * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3556     * monitor.
3557     *
3558     * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3559     */
3560    struct LDKCResult_ECDSASignatureNoneZ (*sign_justice_revoked_output)(const void *this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32]);
3561    /**
3562     * Create a signature for the given input in a transaction spending a commitment transaction
3563     * HTLC output when our counterparty broadcasts an old state.
3564     *
3565     * A justice transaction may claim multiple outputs at the same time if timelocks are
3566     * similar, but only a signature for the input at index `input` should be signed for here.
3567     * It may be called multiple times for same output(s) if a fee-bump is needed with regards
3568     * to an upcoming timelock expiration.
3569     *
3570     * `amount` is the value of the output spent by this input, committed to in the BIP 143
3571     * signature.
3572     *
3573     * `per_commitment_key` is revocation secret which was provided by our counterparty when they
3574     * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3575     * not allow the spending of any funds by itself (you need our holder revocation_secret to do
3576     * so).
3577     *
3578     * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
3579     * (which is committed to in the BIP 143 signatures).
3580     *
3581     * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3582     * signature and should be retried later. Once the signer is ready to provide a signature after
3583     * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3584     * monitor.
3585     *
3586     * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3587     */
3588    struct LDKCResult_ECDSASignatureNoneZ (*sign_justice_revoked_htlc)(const void *this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc);
3589    /**
3590     * Computes the signature for a commitment transaction's HTLC output used as an input within
3591     * `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
3592     * must be be computed using [`EcdsaSighashType::All`].
3593     *
3594     * Note that this may be called for HTLCs in the penultimate commitment transaction if a
3595     * [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
3596     * broadcasts it before receiving the update for the latest commitment transaction.
3597     *
3598     * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3599     * signature and should be retried later. Once the signer is ready to provide a signature after
3600     * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3601     * monitor.
3602     *
3603     * [`EcdsaSighashType::All`]: bitcoin::sighash::EcdsaSighashType::All
3604     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
3605     * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3606     */
3607    struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_htlc_transaction)(const void *this_arg, struct LDKTransaction htlc_tx, uintptr_t input, const struct LDKHTLCDescriptor *NONNULL_PTR htlc_descriptor);
3608    /**
3609     * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
3610     * transaction, either offered or received.
3611     *
3612     * Such a transaction may claim multiples offered outputs at same time if we know the
3613     * preimage for each when we create it, but only the input at index `input` should be
3614     * signed for here. It may be called multiple times for same output(s) if a fee-bump is
3615     * needed with regards to an upcoming timelock expiration.
3616     *
3617     * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
3618     * outputs.
3619     *
3620     * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
3621     *
3622     * `per_commitment_point` is the dynamic point corresponding to the channel state
3623     * detected onchain. It has been generated by our counterparty and is used to derive
3624     * channel state keys, which are then included in the witness script and committed to in the
3625     * BIP 143 signature.
3626     *
3627     * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3628     * signature and should be retried later. Once the signer is ready to provide a signature after
3629     * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3630     * monitor.
3631     *
3632     * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3633     */
3634    struct LDKCResult_ECDSASignatureNoneZ (*sign_counterparty_htlc_transaction)(const void *this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc);
3635    /**
3636     * Create a signature for a (proposed) closing transaction.
3637     *
3638     * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
3639     * chosen to forgo their output as dust.
3640     */
3641    struct LDKCResult_ECDSASignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
3642    /**
3643     * Computes the signature for a commitment transaction's anchor output used as an
3644     * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
3645     *
3646     * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3647     * signature and should be retried later. Once the signer is ready to provide a signature after
3648     * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3649     * monitor.
3650     *
3651     * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3652     */
3653    struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_anchor_input)(const void *this_arg, struct LDKTransaction anchor_tx, uintptr_t input);
3654    /**
3655     * Signs a channel announcement message with our funding key proving it comes from one of the
3656     * channel participants.
3657     *
3658     * Channel announcements also require a signature from each node's network key. Our node
3659     * signature is computed through [`NodeSigner::sign_gossip_message`].
3660     *
3661     * Note that if this fails or is rejected, the channel will not be publicly announced and
3662     * our counterparty may (though likely will not) close the channel on us for violating the
3663     * protocol.
3664     *
3665     * [`NodeSigner::sign_gossip_message`]: crate::sign::NodeSigner::sign_gossip_message
3666     */
3667    struct LDKCResult_ECDSASignatureNoneZ (*sign_channel_announcement_with_funding_key)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
3668    /**
3669     * Implementation of ChannelSigner for this object.
3670     */
3671    struct LDKChannelSigner ChannelSigner;
3672    /**
3673     * Frees any resources associated with this object given its this_arg pointer.
3674     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3675     */
3676    void (*free)(void *this_arg);
3677 } LDKEcdsaChannelSigner;
3678
3679 /**
3680  * A writeable signer.
3681  *
3682  * There will always be two instances of a signer per channel, one occupied by the
3683  * [`ChannelManager`] and another by the channel's [`ChannelMonitor`].
3684  *
3685  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3686  * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
3687  */
3688 typedef struct LDKWriteableEcdsaChannelSigner {
3689    /**
3690     * An opaque pointer which is passed to your function implementations as an argument.
3691     * This has no meaning in the LDK, and can be NULL or any other value.
3692     */
3693    void *this_arg;
3694    /**
3695     * Implementation of EcdsaChannelSigner for this object.
3696     */
3697    struct LDKEcdsaChannelSigner EcdsaChannelSigner;
3698    /**
3699     * Serialize the object into a byte array
3700     */
3701    struct LDKCVec_u8Z (*write)(const void *this_arg);
3702    /**
3703     * Called, if set, after this WriteableEcdsaChannelSigner has been cloned into a duplicate object.
3704     * The new WriteableEcdsaChannelSigner is provided, and should be mutated as needed to perform a
3705     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
3706     */
3707    void (*cloned)(struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR new_WriteableEcdsaChannelSigner);
3708    /**
3709     * Frees any resources associated with this object given its this_arg pointer.
3710     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3711     */
3712    void (*free)(void *this_arg);
3713 } LDKWriteableEcdsaChannelSigner;
3714
3715 /**
3716  * The contents of CResult_WriteableEcdsaChannelSignerDecodeErrorZ
3717  */
3718 typedef union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr {
3719    /**
3720     * A pointer to the contents in the success state.
3721     * Reading from this pointer when `result_ok` is not set is undefined.
3722     */
3723    struct LDKWriteableEcdsaChannelSigner *result;
3724    /**
3725     * A pointer to the contents in the error state.
3726     * Reading from this pointer when `result_ok` is set is undefined.
3727     */
3728    struct LDKDecodeError *err;
3729 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr;
3730
3731 /**
3732  * A CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents the result of a fallible operation,
3733  * containing a crate::lightning::sign::ecdsa::WriteableEcdsaChannelSigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3734  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3735  */
3736 typedef struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ {
3737    /**
3738     * The contents of this CResult_WriteableEcdsaChannelSignerDecodeErrorZ, accessible via either
3739     * `err` or `result` depending on the state of `result_ok`.
3740     */
3741    union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr contents;
3742    /**
3743     * Whether this CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents a success state.
3744     */
3745    bool result_ok;
3746 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ;
3747
3748 /**
3749  * The contents of CResult_CVec_u8ZNoneZ
3750  */
3751 typedef union LDKCResult_CVec_u8ZNoneZPtr {
3752    /**
3753     * A pointer to the contents in the success state.
3754     * Reading from this pointer when `result_ok` is not set is undefined.
3755     */
3756    struct LDKCVec_u8Z *result;
3757    /**
3758     * Note that this value is always NULL, as there are no contents in the Err variant
3759     */
3760    void *err;
3761 } LDKCResult_CVec_u8ZNoneZPtr;
3762
3763 /**
3764  * A CResult_CVec_u8ZNoneZ represents the result of a fallible operation,
3765  * containing a crate::c_types::derived::CVec_u8Z on success and a () on failure.
3766  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3767  */
3768 typedef struct LDKCResult_CVec_u8ZNoneZ {
3769    /**
3770     * The contents of this CResult_CVec_u8ZNoneZ, accessible via either
3771     * `err` or `result` depending on the state of `result_ok`.
3772     */
3773    union LDKCResult_CVec_u8ZNoneZPtr contents;
3774    /**
3775     * Whether this CResult_CVec_u8ZNoneZ represents a success state.
3776     */
3777    bool result_ok;
3778 } LDKCResult_CVec_u8ZNoneZ;
3779
3780 /**
3781  * The contents of CResult_ShutdownScriptNoneZ
3782  */
3783 typedef union LDKCResult_ShutdownScriptNoneZPtr {
3784    /**
3785     * A pointer to the contents in the success state.
3786     * Reading from this pointer when `result_ok` is not set is undefined.
3787     */
3788    struct LDKShutdownScript *result;
3789    /**
3790     * Note that this value is always NULL, as there are no contents in the Err variant
3791     */
3792    void *err;
3793 } LDKCResult_ShutdownScriptNoneZPtr;
3794
3795 /**
3796  * A CResult_ShutdownScriptNoneZ represents the result of a fallible operation,
3797  * containing a crate::lightning::ln::script::ShutdownScript on success and a () on failure.
3798  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3799  */
3800 typedef struct LDKCResult_ShutdownScriptNoneZ {
3801    /**
3802     * The contents of this CResult_ShutdownScriptNoneZ, accessible via either
3803     * `err` or `result` depending on the state of `result_ok`.
3804     */
3805    union LDKCResult_ShutdownScriptNoneZPtr contents;
3806    /**
3807     * Whether this CResult_ShutdownScriptNoneZ represents a success state.
3808     */
3809    bool result_ok;
3810 } LDKCResult_ShutdownScriptNoneZ;
3811
3812 /**
3813  * An enum which can either contain a u16 or not
3814  */
3815 typedef enum LDKCOption_u16Z_Tag {
3816    /**
3817     * When we're in this state, this COption_u16Z contains a u16
3818     */
3819    LDKCOption_u16Z_Some,
3820    /**
3821     * When we're in this state, this COption_u16Z contains nothing
3822     */
3823    LDKCOption_u16Z_None,
3824    /**
3825     * Must be last for serialization purposes
3826     */
3827    LDKCOption_u16Z_Sentinel,
3828 } LDKCOption_u16Z_Tag;
3829
3830 typedef struct LDKCOption_u16Z {
3831    LDKCOption_u16Z_Tag tag;
3832    union {
3833       struct {
3834          uint16_t some;
3835       };
3836    };
3837 } LDKCOption_u16Z;
3838
3839 /**
3840  * An enum which can either contain a bool or not
3841  */
3842 typedef enum LDKCOption_boolZ_Tag {
3843    /**
3844     * When we're in this state, this COption_boolZ contains a bool
3845     */
3846    LDKCOption_boolZ_Some,
3847    /**
3848     * When we're in this state, this COption_boolZ contains nothing
3849     */
3850    LDKCOption_boolZ_None,
3851    /**
3852     * Must be last for serialization purposes
3853     */
3854    LDKCOption_boolZ_Sentinel,
3855 } LDKCOption_boolZ_Tag;
3856
3857 typedef struct LDKCOption_boolZ {
3858    LDKCOption_boolZ_Tag tag;
3859    union {
3860       struct {
3861          bool some;
3862       };
3863    };
3864 } LDKCOption_boolZ;
3865
3866 /**
3867  * The contents of CResult_WitnessNoneZ
3868  */
3869 typedef union LDKCResult_WitnessNoneZPtr {
3870    /**
3871     * A pointer to the contents in the success state.
3872     * Reading from this pointer when `result_ok` is not set is undefined.
3873     */
3874    struct LDKWitness *result;
3875    /**
3876     * Note that this value is always NULL, as there are no contents in the Err variant
3877     */
3878    void *err;
3879 } LDKCResult_WitnessNoneZPtr;
3880
3881 /**
3882  * A CResult_WitnessNoneZ represents the result of a fallible operation,
3883  * containing a crate::c_types::Witness on success and a () on failure.
3884  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3885  */
3886 typedef struct LDKCResult_WitnessNoneZ {
3887    /**
3888     * The contents of this CResult_WitnessNoneZ, accessible via either
3889     * `err` or `result` depending on the state of `result_ok`.
3890     */
3891    union LDKCResult_WitnessNoneZPtr contents;
3892    /**
3893     * Whether this CResult_WitnessNoneZ represents a success state.
3894     */
3895    bool result_ok;
3896 } LDKCResult_WitnessNoneZ;
3897
3898
3899
3900 /**
3901  * A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory.
3902  *
3903  * This implementation performs no policy checks and is insufficient by itself as
3904  * a secure external signer.
3905  */
3906 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
3907    /**
3908     * A pointer to the opaque Rust object.
3909     * Nearly everywhere, inner must be non-null, however in places where
3910     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3911     */
3912    LDKnativeInMemorySigner *inner;
3913    /**
3914     * Indicates that this is the only struct which contains the same pointer.
3915     * Rust functions which take ownership of an object provided via an argument require
3916     * this to be true and invalidate the object pointed to by inner.
3917     */
3918    bool is_owned;
3919 } LDKInMemorySigner;
3920
3921 /**
3922  * The contents of CResult_InMemorySignerDecodeErrorZ
3923  */
3924 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
3925    /**
3926     * A pointer to the contents in the success state.
3927     * Reading from this pointer when `result_ok` is not set is undefined.
3928     */
3929    struct LDKInMemorySigner *result;
3930    /**
3931     * A pointer to the contents in the error state.
3932     * Reading from this pointer when `result_ok` is set is undefined.
3933     */
3934    struct LDKDecodeError *err;
3935 } LDKCResult_InMemorySignerDecodeErrorZPtr;
3936
3937 /**
3938  * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
3939  * containing a crate::lightning::sign::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3940  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3941  */
3942 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
3943    /**
3944     * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
3945     * `err` or `result` depending on the state of `result_ok`.
3946     */
3947    union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
3948    /**
3949     * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
3950     */
3951    bool result_ok;
3952 } LDKCResult_InMemorySignerDecodeErrorZ;
3953
3954
3955
3956 /**
3957  * A [`CandidateRouteHop::FirstHop`] entry.
3958  */
3959 typedef struct MUST_USE_STRUCT LDKFirstHopCandidate {
3960    /**
3961     * A pointer to the opaque Rust object.
3962     * Nearly everywhere, inner must be non-null, however in places where
3963     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3964     */
3965    LDKnativeFirstHopCandidate *inner;
3966    /**
3967     * Indicates that this is the only struct which contains the same pointer.
3968     * Rust functions which take ownership of an object provided via an argument require
3969     * this to be true and invalidate the object pointed to by inner.
3970     */
3971    bool is_owned;
3972 } LDKFirstHopCandidate;
3973
3974
3975
3976 /**
3977  * A [`CandidateRouteHop::PublicHop`] entry.
3978  */
3979 typedef struct MUST_USE_STRUCT LDKPublicHopCandidate {
3980    /**
3981     * A pointer to the opaque Rust object.
3982     * Nearly everywhere, inner must be non-null, however in places where
3983     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3984     */
3985    LDKnativePublicHopCandidate *inner;
3986    /**
3987     * Indicates that this is the only struct which contains the same pointer.
3988     * Rust functions which take ownership of an object provided via an argument require
3989     * this to be true and invalidate the object pointed to by inner.
3990     */
3991    bool is_owned;
3992 } LDKPublicHopCandidate;
3993
3994
3995
3996 /**
3997  * A [`CandidateRouteHop::PrivateHop`] entry.
3998  */
3999 typedef struct MUST_USE_STRUCT LDKPrivateHopCandidate {
4000    /**
4001     * A pointer to the opaque Rust object.
4002     * Nearly everywhere, inner must be non-null, however in places where
4003     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4004     */
4005    LDKnativePrivateHopCandidate *inner;
4006    /**
4007     * Indicates that this is the only struct which contains the same pointer.
4008     * Rust functions which take ownership of an object provided via an argument require
4009     * this to be true and invalidate the object pointed to by inner.
4010     */
4011    bool is_owned;
4012 } LDKPrivateHopCandidate;
4013
4014
4015
4016 /**
4017  * A [`CandidateRouteHop::Blinded`] entry.
4018  */
4019 typedef struct MUST_USE_STRUCT LDKBlindedPathCandidate {
4020    /**
4021     * A pointer to the opaque Rust object.
4022     * Nearly everywhere, inner must be non-null, however in places where
4023     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4024     */
4025    LDKnativeBlindedPathCandidate *inner;
4026    /**
4027     * Indicates that this is the only struct which contains the same pointer.
4028     * Rust functions which take ownership of an object provided via an argument require
4029     * this to be true and invalidate the object pointed to by inner.
4030     */
4031    bool is_owned;
4032 } LDKBlindedPathCandidate;
4033
4034
4035
4036 /**
4037  * A [`CandidateRouteHop::OneHopBlinded`] entry.
4038  */
4039 typedef struct MUST_USE_STRUCT LDKOneHopBlindedPathCandidate {
4040    /**
4041     * A pointer to the opaque Rust object.
4042     * Nearly everywhere, inner must be non-null, however in places where
4043     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4044     */
4045    LDKnativeOneHopBlindedPathCandidate *inner;
4046    /**
4047     * Indicates that this is the only struct which contains the same pointer.
4048     * Rust functions which take ownership of an object provided via an argument require
4049     * this to be true and invalidate the object pointed to by inner.
4050     */
4051    bool is_owned;
4052 } LDKOneHopBlindedPathCandidate;
4053
4054 /**
4055  * A wrapper around the various hop representations.
4056  *
4057  * Can be used to examine the properties of a hop,
4058  * potentially to decide whether to include it in a route.
4059  */
4060 typedef enum LDKCandidateRouteHop_Tag {
4061    /**
4062     * A hop from the payer, where the outbound liquidity is known.
4063     */
4064    LDKCandidateRouteHop_FirstHop,
4065    /**
4066     * A hop found in the [`ReadOnlyNetworkGraph`].
4067     */
4068    LDKCandidateRouteHop_PublicHop,
4069    /**
4070     * A private hop communicated by the payee, generally via a BOLT 11 invoice.
4071     *
4072     * Because BOLT 11 route hints can take multiple hops to get to the destination, this may not
4073     * terminate at the payee.
4074     */
4075    LDKCandidateRouteHop_PrivateHop,
4076    /**
4077     * A blinded path which starts with an introduction point and ultimately terminates with the
4078     * payee.
4079     *
4080     * Because we don't know the payee's identity, [`CandidateRouteHop::target`] will return
4081     * `None` in this state.
4082     *
4083     * Because blinded paths are \"all or nothing\", and we cannot use just one part of a blinded
4084     * path, the full path is treated as a single [`CandidateRouteHop`].
4085     */
4086    LDKCandidateRouteHop_Blinded,
4087    /**
4088     * Similar to [`Self::Blinded`], but the path here only has one hop.
4089     *
4090     * While we treat this similarly to [`CandidateRouteHop::Blinded`] in many respects (e.g.
4091     * returning `None` from [`CandidateRouteHop::target`]), in this case we do actually know the
4092     * payee's identity - it's the introduction point!
4093     *
4094     * [`BlindedPayInfo`] provided for 1-hop blinded paths is ignored because it is meant to apply
4095     * to the hops *between* the introduction node and the destination.
4096     *
4097     * This primarily exists to track that we need to included a blinded path at the end of our
4098     * [`Route`], even though it doesn't actually add an additional hop in the payment.
4099     */
4100    LDKCandidateRouteHop_OneHopBlinded,
4101    /**
4102     * Must be last for serialization purposes
4103     */
4104    LDKCandidateRouteHop_Sentinel,
4105 } LDKCandidateRouteHop_Tag;
4106
4107 typedef struct MUST_USE_STRUCT LDKCandidateRouteHop {
4108    LDKCandidateRouteHop_Tag tag;
4109    union {
4110       struct {
4111          struct LDKFirstHopCandidate first_hop;
4112       };
4113       struct {
4114          struct LDKPublicHopCandidate public_hop;
4115       };
4116       struct {
4117          struct LDKPrivateHopCandidate private_hop;
4118       };
4119       struct {
4120          struct LDKBlindedPathCandidate blinded;
4121       };
4122       struct {
4123          struct LDKOneHopBlindedPathCandidate one_hop_blinded;
4124       };
4125    };
4126 } LDKCandidateRouteHop;
4127
4128
4129
4130 /**
4131  * Proposed use of a channel passed as a parameter to [`ScoreLookUp::channel_penalty_msat`].
4132  */
4133 typedef struct MUST_USE_STRUCT LDKChannelUsage {
4134    /**
4135     * A pointer to the opaque Rust object.
4136     * Nearly everywhere, inner must be non-null, however in places where
4137     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4138     */
4139    LDKnativeChannelUsage *inner;
4140    /**
4141     * Indicates that this is the only struct which contains the same pointer.
4142     * Rust functions which take ownership of an object provided via an argument require
4143     * this to be true and invalidate the object pointed to by inner.
4144     */
4145    bool is_owned;
4146 } LDKChannelUsage;
4147
4148
4149
4150 /**
4151  * Parameters for configuring [`ProbabilisticScorer`].
4152  *
4153  * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
4154  * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
4155  *
4156  * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
4157  * parameters here.
4158  */
4159 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringFeeParameters {
4160    /**
4161     * A pointer to the opaque Rust object.
4162     * Nearly everywhere, inner must be non-null, however in places where
4163     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4164     */
4165    LDKnativeProbabilisticScoringFeeParameters *inner;
4166    /**
4167     * Indicates that this is the only struct which contains the same pointer.
4168     * Rust functions which take ownership of an object provided via an argument require
4169     * this to be true and invalidate the object pointed to by inner.
4170     */
4171    bool is_owned;
4172 } LDKProbabilisticScoringFeeParameters;
4173
4174 /**
4175  * An interface used to score payment channels for path finding.
4176  *
4177  * `ScoreLookUp` is used to determine the penalty for a given channel.
4178  *
4179  * Scoring is in terms of fees willing to be paid in order to avoid routing through a channel.
4180  */
4181 typedef struct LDKScoreLookUp {
4182    /**
4183     * An opaque pointer which is passed to your function implementations as an argument.
4184     * This has no meaning in the LDK, and can be NULL or any other value.
4185     */
4186    void *this_arg;
4187    /**
4188     * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
4189     * given channel in the direction from `source` to `target`.
4190     *
4191     * The channel's capacity (less any other MPP parts that are also being considered for use in
4192     * the same payment) is given by `capacity_msat`. It may be determined from various sources
4193     * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
4194     * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
4195     * Thus, implementations should be overflow-safe.
4196     */
4197    uint64_t (*channel_penalty_msat)(const void *this_arg, const struct LDKCandidateRouteHop *NONNULL_PTR candidate, struct LDKChannelUsage usage, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR score_params);
4198    /**
4199     * Frees any resources associated with this object given its this_arg pointer.
4200     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4201     */
4202    void (*free)(void *this_arg);
4203 } LDKScoreLookUp;
4204
4205
4206
4207 /**
4208  * A path in a [`Route`] to the payment recipient. Must always be at least length one.
4209  * If no [`Path::blinded_tail`] is present, then [`Path::hops`] length may be up to 19.
4210  */
4211 typedef struct MUST_USE_STRUCT LDKPath {
4212    /**
4213     * A pointer to the opaque Rust object.
4214     * Nearly everywhere, inner must be non-null, however in places where
4215     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4216     */
4217    LDKnativePath *inner;
4218    /**
4219     * Indicates that this is the only struct which contains the same pointer.
4220     * Rust functions which take ownership of an object provided via an argument require
4221     * this to be true and invalidate the object pointed to by inner.
4222     */
4223    bool is_owned;
4224 } LDKPath;
4225
4226 /**
4227  * `ScoreUpdate` is used to update the scorer's internal state after a payment attempt.
4228  */
4229 typedef struct LDKScoreUpdate {
4230    /**
4231     * An opaque pointer which is passed to your function implementations as an argument.
4232     * This has no meaning in the LDK, and can be NULL or any other value.
4233     */
4234    void *this_arg;
4235    /**
4236     * Handles updating channel penalties after failing to route through a channel.
4237     */
4238    void (*payment_path_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id, uint64_t duration_since_epoch);
4239    /**
4240     * Handles updating channel penalties after successfully routing along a path.
4241     */
4242    void (*payment_path_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t duration_since_epoch);
4243    /**
4244     * Handles updating channel penalties after a probe over the given path failed.
4245     */
4246    void (*probe_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id, uint64_t duration_since_epoch);
4247    /**
4248     * Handles updating channel penalties after a probe over the given path succeeded.
4249     */
4250    void (*probe_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t duration_since_epoch);
4251    /**
4252     * Scorers may wish to reduce their certainty of channel liquidity information over time.
4253     * Thus, this method is provided to allow scorers to observe the passage of time - the holder
4254     * of this object should call this method regularly (generally via the
4255     * `lightning-background-processor` crate).
4256     */
4257    void (*time_passed)(void *this_arg, uint64_t duration_since_epoch);
4258    /**
4259     * Frees any resources associated with this object given its this_arg pointer.
4260     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4261     */
4262    void (*free)(void *this_arg);
4263 } LDKScoreUpdate;
4264
4265 /**
4266  * A scorer that is accessed under a lock.
4267  *
4268  * Needed so that calls to [`ScoreLookUp::channel_penalty_msat`] in [`find_route`] can be made while
4269  * having shared ownership of a scorer but without requiring internal locking in [`ScoreUpdate`]
4270  * implementations. Internal locking would be detrimental to route finding performance and could
4271  * result in [`ScoreLookUp::channel_penalty_msat`] returning a different value for the same channel.
4272  *
4273  * [`find_route`]: crate::routing::router::find_route
4274  */
4275 typedef struct LDKLockableScore {
4276    /**
4277     * An opaque pointer which is passed to your function implementations as an argument.
4278     * This has no meaning in the LDK, and can be NULL or any other value.
4279     */
4280    void *this_arg;
4281    /**
4282     * Returns read locked scorer.
4283     */
4284    struct LDKScoreLookUp (*read_lock)(const void *this_arg);
4285    /**
4286     * Returns write locked scorer.
4287     */
4288    struct LDKScoreUpdate (*write_lock)(const void *this_arg);
4289    /**
4290     * Frees any resources associated with this object given its this_arg pointer.
4291     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4292     */
4293    void (*free)(void *this_arg);
4294 } LDKLockableScore;
4295
4296 /**
4297  * Refers to a scorer that is accessible under lock and also writeable to disk
4298  *
4299  * We need this trait to be able to pass in a scorer to `lightning-background-processor` that will enable us to
4300  * use the Persister to persist it.
4301  */
4302 typedef struct LDKWriteableScore {
4303    /**
4304     * An opaque pointer which is passed to your function implementations as an argument.
4305     * This has no meaning in the LDK, and can be NULL or any other value.
4306     */
4307    void *this_arg;
4308    /**
4309     * Implementation of LockableScore for this object.
4310     */
4311    struct LDKLockableScore LockableScore;
4312    /**
4313     * Serialize the object into a byte array
4314     */
4315    struct LDKCVec_u8Z (*write)(const void *this_arg);
4316    /**
4317     * Frees any resources associated with this object given its this_arg pointer.
4318     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4319     */
4320    void (*free)(void *this_arg);
4321 } LDKWriteableScore;
4322
4323 /**
4324  * An enum which can either contain a crate::lightning::routing::scoring::WriteableScore or not
4325  */
4326 typedef enum LDKCOption_WriteableScoreZ_Tag {
4327    /**
4328     * When we're in this state, this COption_WriteableScoreZ contains a crate::lightning::routing::scoring::WriteableScore
4329     */
4330    LDKCOption_WriteableScoreZ_Some,
4331    /**
4332     * When we're in this state, this COption_WriteableScoreZ contains nothing
4333     */
4334    LDKCOption_WriteableScoreZ_None,
4335    /**
4336     * Must be last for serialization purposes
4337     */
4338    LDKCOption_WriteableScoreZ_Sentinel,
4339 } LDKCOption_WriteableScoreZ_Tag;
4340
4341 typedef struct LDKCOption_WriteableScoreZ {
4342    LDKCOption_WriteableScoreZ_Tag tag;
4343    union {
4344       struct {
4345          struct LDKWriteableScore some;
4346       };
4347    };
4348 } LDKCOption_WriteableScoreZ;
4349
4350 /**
4351  * The contents of CResult_NoneIOErrorZ
4352  */
4353 typedef union LDKCResult_NoneIOErrorZPtr {
4354    /**
4355     * Note that this value is always NULL, as there are no contents in the OK variant
4356     */
4357    void *result;
4358    /**
4359     * A pointer to the contents in the error state.
4360     * Reading from this pointer when `result_ok` is set is undefined.
4361     */
4362    enum LDKIOError *err;
4363 } LDKCResult_NoneIOErrorZPtr;
4364
4365 /**
4366  * A CResult_NoneIOErrorZ represents the result of a fallible operation,
4367  * containing a () on success and a crate::c_types::IOError on failure.
4368  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4369  */
4370 typedef struct LDKCResult_NoneIOErrorZ {
4371    /**
4372     * The contents of this CResult_NoneIOErrorZ, accessible via either
4373     * `err` or `result` depending on the state of `result_ok`.
4374     */
4375    union LDKCResult_NoneIOErrorZPtr contents;
4376    /**
4377     * Whether this CResult_NoneIOErrorZ represents a success state.
4378     */
4379    bool result_ok;
4380 } LDKCResult_NoneIOErrorZ;
4381
4382
4383
4384 /**
4385  * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
4386  *
4387  * [`ChannelManager::list_channels`]: crate::ln::channelmanager::ChannelManager::list_channels
4388  * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
4389  */
4390 typedef struct MUST_USE_STRUCT LDKChannelDetails {
4391    /**
4392     * A pointer to the opaque Rust object.
4393     * Nearly everywhere, inner must be non-null, however in places where
4394     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4395     */
4396    LDKnativeChannelDetails *inner;
4397    /**
4398     * Indicates that this is the only struct which contains the same pointer.
4399     * Rust functions which take ownership of an object provided via an argument require
4400     * this to be true and invalidate the object pointed to by inner.
4401     */
4402    bool is_owned;
4403 } LDKChannelDetails;
4404
4405 /**
4406  * A dynamically-allocated array of crate::lightning::ln::channel_state::ChannelDetailss of arbitrary size.
4407  * This corresponds to std::vector in C++
4408  */
4409 typedef struct LDKCVec_ChannelDetailsZ {
4410    /**
4411     * The elements in the array.
4412     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4413     */
4414    struct LDKChannelDetails *data;
4415    /**
4416     * The number of elements pointed to by `data`.
4417     */
4418    uintptr_t datalen;
4419 } LDKCVec_ChannelDetailsZ;
4420
4421
4422
4423 /**
4424  * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
4425  * it can take multiple paths. Each path is composed of one or more hops through the network.
4426  */
4427 typedef struct MUST_USE_STRUCT LDKRoute {
4428    /**
4429     * A pointer to the opaque Rust object.
4430     * Nearly everywhere, inner must be non-null, however in places where
4431     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4432     */
4433    LDKnativeRoute *inner;
4434    /**
4435     * Indicates that this is the only struct which contains the same pointer.
4436     * Rust functions which take ownership of an object provided via an argument require
4437     * this to be true and invalidate the object pointed to by inner.
4438     */
4439    bool is_owned;
4440 } LDKRoute;
4441
4442
4443
4444 /**
4445  * An Err type for failure to process messages.
4446  */
4447 typedef struct MUST_USE_STRUCT LDKLightningError {
4448    /**
4449     * A pointer to the opaque Rust object.
4450     * Nearly everywhere, inner must be non-null, however in places where
4451     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4452     */
4453    LDKnativeLightningError *inner;
4454    /**
4455     * Indicates that this is the only struct which contains the same pointer.
4456     * Rust functions which take ownership of an object provided via an argument require
4457     * this to be true and invalidate the object pointed to by inner.
4458     */
4459    bool is_owned;
4460 } LDKLightningError;
4461
4462 /**
4463  * The contents of CResult_RouteLightningErrorZ
4464  */
4465 typedef union LDKCResult_RouteLightningErrorZPtr {
4466    /**
4467     * A pointer to the contents in the success state.
4468     * Reading from this pointer when `result_ok` is not set is undefined.
4469     */
4470    struct LDKRoute *result;
4471    /**
4472     * A pointer to the contents in the error state.
4473     * Reading from this pointer when `result_ok` is set is undefined.
4474     */
4475    struct LDKLightningError *err;
4476 } LDKCResult_RouteLightningErrorZPtr;
4477
4478 /**
4479  * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
4480  * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
4481  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4482  */
4483 typedef struct LDKCResult_RouteLightningErrorZ {
4484    /**
4485     * The contents of this CResult_RouteLightningErrorZ, accessible via either
4486     * `err` or `result` depending on the state of `result_ok`.
4487     */
4488    union LDKCResult_RouteLightningErrorZPtr contents;
4489    /**
4490     * Whether this CResult_RouteLightningErrorZ represents a success state.
4491     */
4492    bool result_ok;
4493 } LDKCResult_RouteLightningErrorZ;
4494
4495 /**
4496  * A tuple of 2 elements. See the individual fields for the types contained.
4497  */
4498 typedef struct LDKC2Tuple_BlindedPayInfoBlindedPathZ {
4499    /**
4500     * The element at position 0
4501     */
4502    struct LDKBlindedPayInfo a;
4503    /**
4504     * The element at position 1
4505     */
4506    struct LDKBlindedPath b;
4507 } LDKC2Tuple_BlindedPayInfoBlindedPathZ;
4508
4509 /**
4510  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZs of arbitrary size.
4511  * This corresponds to std::vector in C++
4512  */
4513 typedef struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ {
4514    /**
4515     * The elements in the array.
4516     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4517     */
4518    struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *data;
4519    /**
4520     * The number of elements pointed to by `data`.
4521     */
4522    uintptr_t datalen;
4523 } LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ;
4524
4525 /**
4526  * The contents of CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ
4527  */
4528 typedef union LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr {
4529    /**
4530     * A pointer to the contents in the success state.
4531     * Reading from this pointer when `result_ok` is not set is undefined.
4532     */
4533    struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ *result;
4534    /**
4535     * Note that this value is always NULL, as there are no contents in the Err variant
4536     */
4537    void *err;
4538 } LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr;
4539
4540 /**
4541  * A CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ represents the result of a fallible operation,
4542  * containing a crate::c_types::derived::CVec_C2Tuple_BlindedPayInfoBlindedPathZZ on success and a () on failure.
4543  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4544  */
4545 typedef struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ {
4546    /**
4547     * The contents of this CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ, accessible via either
4548     * `err` or `result` depending on the state of `result_ok`.
4549     */
4550    union LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr contents;
4551    /**
4552     * Whether this CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ represents a success state.
4553     */
4554    bool result_ok;
4555 } LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ;
4556
4557 /**
4558  * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
4559  * This corresponds to std::vector in C++
4560  */
4561 typedef struct LDKCVec_PublicKeyZ {
4562    /**
4563     * The elements in the array.
4564     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4565     */
4566    struct LDKPublicKey *data;
4567    /**
4568     * The number of elements pointed to by `data`.
4569     */
4570    uintptr_t datalen;
4571 } LDKCVec_PublicKeyZ;
4572
4573
4574
4575 /**
4576  * A path for sending an [`OnionMessage`].
4577  */
4578 typedef struct MUST_USE_STRUCT LDKOnionMessagePath {
4579    /**
4580     * A pointer to the opaque Rust object.
4581     * Nearly everywhere, inner must be non-null, however in places where
4582     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4583     */
4584    LDKnativeOnionMessagePath *inner;
4585    /**
4586     * Indicates that this is the only struct which contains the same pointer.
4587     * Rust functions which take ownership of an object provided via an argument require
4588     * this to be true and invalidate the object pointed to by inner.
4589     */
4590    bool is_owned;
4591 } LDKOnionMessagePath;
4592
4593 /**
4594  * The contents of CResult_OnionMessagePathNoneZ
4595  */
4596 typedef union LDKCResult_OnionMessagePathNoneZPtr {
4597    /**
4598     * A pointer to the contents in the success state.
4599     * Reading from this pointer when `result_ok` is not set is undefined.
4600     */
4601    struct LDKOnionMessagePath *result;
4602    /**
4603     * Note that this value is always NULL, as there are no contents in the Err variant
4604     */
4605    void *err;
4606 } LDKCResult_OnionMessagePathNoneZPtr;
4607
4608 /**
4609  * A CResult_OnionMessagePathNoneZ represents the result of a fallible operation,
4610  * containing a crate::lightning::onion_message::messenger::OnionMessagePath on success and a () on failure.
4611  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4612  */
4613 typedef struct LDKCResult_OnionMessagePathNoneZ {
4614    /**
4615     * The contents of this CResult_OnionMessagePathNoneZ, accessible via either
4616     * `err` or `result` depending on the state of `result_ok`.
4617     */
4618    union LDKCResult_OnionMessagePathNoneZPtr contents;
4619    /**
4620     * Whether this CResult_OnionMessagePathNoneZ represents a success state.
4621     */
4622    bool result_ok;
4623 } LDKCResult_OnionMessagePathNoneZ;
4624
4625 /**
4626  * The contents of CResult_CVec_BlindedPathZNoneZ
4627  */
4628 typedef union LDKCResult_CVec_BlindedPathZNoneZPtr {
4629    /**
4630     * A pointer to the contents in the success state.
4631     * Reading from this pointer when `result_ok` is not set is undefined.
4632     */
4633    struct LDKCVec_BlindedPathZ *result;
4634    /**
4635     * Note that this value is always NULL, as there are no contents in the Err variant
4636     */
4637    void *err;
4638 } LDKCResult_CVec_BlindedPathZNoneZPtr;
4639
4640 /**
4641  * A CResult_CVec_BlindedPathZNoneZ represents the result of a fallible operation,
4642  * containing a crate::c_types::derived::CVec_BlindedPathZ on success and a () on failure.
4643  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4644  */
4645 typedef struct LDKCResult_CVec_BlindedPathZNoneZ {
4646    /**
4647     * The contents of this CResult_CVec_BlindedPathZNoneZ, accessible via either
4648     * `err` or `result` depending on the state of `result_ok`.
4649     */
4650    union LDKCResult_CVec_BlindedPathZNoneZPtr contents;
4651    /**
4652     * Whether this CResult_CVec_BlindedPathZNoneZ represents a success state.
4653     */
4654    bool result_ok;
4655 } LDKCResult_CVec_BlindedPathZNoneZ;
4656
4657
4658
4659 /**
4660  * A data structure for tracking in-flight HTLCs. May be used during pathfinding to account for
4661  * in-use channel liquidity.
4662  */
4663 typedef struct MUST_USE_STRUCT LDKInFlightHtlcs {
4664    /**
4665     * A pointer to the opaque Rust object.
4666     * Nearly everywhere, inner must be non-null, however in places where
4667     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4668     */
4669    LDKnativeInFlightHtlcs *inner;
4670    /**
4671     * Indicates that this is the only struct which contains the same pointer.
4672     * Rust functions which take ownership of an object provided via an argument require
4673     * this to be true and invalidate the object pointed to by inner.
4674     */
4675    bool is_owned;
4676 } LDKInFlightHtlcs;
4677
4678 /**
4679  * The contents of CResult_InFlightHtlcsDecodeErrorZ
4680  */
4681 typedef union LDKCResult_InFlightHtlcsDecodeErrorZPtr {
4682    /**
4683     * A pointer to the contents in the success state.
4684     * Reading from this pointer when `result_ok` is not set is undefined.
4685     */
4686    struct LDKInFlightHtlcs *result;
4687    /**
4688     * A pointer to the contents in the error state.
4689     * Reading from this pointer when `result_ok` is set is undefined.
4690     */
4691    struct LDKDecodeError *err;
4692 } LDKCResult_InFlightHtlcsDecodeErrorZPtr;
4693
4694 /**
4695  * A CResult_InFlightHtlcsDecodeErrorZ represents the result of a fallible operation,
4696  * containing a crate::lightning::routing::router::InFlightHtlcs on success and a crate::lightning::ln::msgs::DecodeError on failure.
4697  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4698  */
4699 typedef struct LDKCResult_InFlightHtlcsDecodeErrorZ {
4700    /**
4701     * The contents of this CResult_InFlightHtlcsDecodeErrorZ, accessible via either
4702     * `err` or `result` depending on the state of `result_ok`.
4703     */
4704    union LDKCResult_InFlightHtlcsDecodeErrorZPtr contents;
4705    /**
4706     * Whether this CResult_InFlightHtlcsDecodeErrorZ represents a success state.
4707     */
4708    bool result_ok;
4709 } LDKCResult_InFlightHtlcsDecodeErrorZ;
4710
4711
4712
4713 /**
4714  * A hop in a route, and additional metadata about it. \"Hop\" is defined as a node and the channel
4715  * that leads to it.
4716  */
4717 typedef struct MUST_USE_STRUCT LDKRouteHop {
4718    /**
4719     * A pointer to the opaque Rust object.
4720     * Nearly everywhere, inner must be non-null, however in places where
4721     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4722     */
4723    LDKnativeRouteHop *inner;
4724    /**
4725     * Indicates that this is the only struct which contains the same pointer.
4726     * Rust functions which take ownership of an object provided via an argument require
4727     * this to be true and invalidate the object pointed to by inner.
4728     */
4729    bool is_owned;
4730 } LDKRouteHop;
4731
4732 /**
4733  * The contents of CResult_RouteHopDecodeErrorZ
4734  */
4735 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
4736    /**
4737     * A pointer to the contents in the success state.
4738     * Reading from this pointer when `result_ok` is not set is undefined.
4739     */
4740    struct LDKRouteHop *result;
4741    /**
4742     * A pointer to the contents in the error state.
4743     * Reading from this pointer when `result_ok` is set is undefined.
4744     */
4745    struct LDKDecodeError *err;
4746 } LDKCResult_RouteHopDecodeErrorZPtr;
4747
4748 /**
4749  * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
4750  * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
4751  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4752  */
4753 typedef struct LDKCResult_RouteHopDecodeErrorZ {
4754    /**
4755     * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
4756     * `err` or `result` depending on the state of `result_ok`.
4757     */
4758    union LDKCResult_RouteHopDecodeErrorZPtr contents;
4759    /**
4760     * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
4761     */
4762    bool result_ok;
4763 } LDKCResult_RouteHopDecodeErrorZ;
4764
4765
4766
4767 /**
4768  * An encrypted payload and node id corresponding to a hop in a payment or onion message path, to
4769  * be encoded in the sender's onion packet. These hops cannot be identified by outside observers
4770  * and thus can be used to hide the identity of the recipient.
4771  */
4772 typedef struct MUST_USE_STRUCT LDKBlindedHop {
4773    /**
4774     * A pointer to the opaque Rust object.
4775     * Nearly everywhere, inner must be non-null, however in places where
4776     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4777     */
4778    LDKnativeBlindedHop *inner;
4779    /**
4780     * Indicates that this is the only struct which contains the same pointer.
4781     * Rust functions which take ownership of an object provided via an argument require
4782     * this to be true and invalidate the object pointed to by inner.
4783     */
4784    bool is_owned;
4785 } LDKBlindedHop;
4786
4787 /**
4788  * A dynamically-allocated array of crate::lightning::blinded_path::BlindedHops of arbitrary size.
4789  * This corresponds to std::vector in C++
4790  */
4791 typedef struct LDKCVec_BlindedHopZ {
4792    /**
4793     * The elements in the array.
4794     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4795     */
4796    struct LDKBlindedHop *data;
4797    /**
4798     * The number of elements pointed to by `data`.
4799     */
4800    uintptr_t datalen;
4801 } LDKCVec_BlindedHopZ;
4802
4803
4804
4805 /**
4806  * The blinded portion of a [`Path`], if we're routing to a recipient who provided blinded paths in
4807  * their [`Bolt12Invoice`].
4808  *
4809  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
4810  */
4811 typedef struct MUST_USE_STRUCT LDKBlindedTail {
4812    /**
4813     * A pointer to the opaque Rust object.
4814     * Nearly everywhere, inner must be non-null, however in places where
4815     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4816     */
4817    LDKnativeBlindedTail *inner;
4818    /**
4819     * Indicates that this is the only struct which contains the same pointer.
4820     * Rust functions which take ownership of an object provided via an argument require
4821     * this to be true and invalidate the object pointed to by inner.
4822     */
4823    bool is_owned;
4824 } LDKBlindedTail;
4825
4826 /**
4827  * The contents of CResult_BlindedTailDecodeErrorZ
4828  */
4829 typedef union LDKCResult_BlindedTailDecodeErrorZPtr {
4830    /**
4831     * A pointer to the contents in the success state.
4832     * Reading from this pointer when `result_ok` is not set is undefined.
4833     */
4834    struct LDKBlindedTail *result;
4835    /**
4836     * A pointer to the contents in the error state.
4837     * Reading from this pointer when `result_ok` is set is undefined.
4838     */
4839    struct LDKDecodeError *err;
4840 } LDKCResult_BlindedTailDecodeErrorZPtr;
4841
4842 /**
4843  * A CResult_BlindedTailDecodeErrorZ represents the result of a fallible operation,
4844  * containing a crate::lightning::routing::router::BlindedTail on success and a crate::lightning::ln::msgs::DecodeError on failure.
4845  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4846  */
4847 typedef struct LDKCResult_BlindedTailDecodeErrorZ {
4848    /**
4849     * The contents of this CResult_BlindedTailDecodeErrorZ, accessible via either
4850     * `err` or `result` depending on the state of `result_ok`.
4851     */
4852    union LDKCResult_BlindedTailDecodeErrorZPtr contents;
4853    /**
4854     * Whether this CResult_BlindedTailDecodeErrorZ represents a success state.
4855     */
4856    bool result_ok;
4857 } LDKCResult_BlindedTailDecodeErrorZ;
4858
4859 /**
4860  * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
4861  * This corresponds to std::vector in C++
4862  */
4863 typedef struct LDKCVec_RouteHopZ {
4864    /**
4865     * The elements in the array.
4866     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4867     */
4868    struct LDKRouteHop *data;
4869    /**
4870     * The number of elements pointed to by `data`.
4871     */
4872    uintptr_t datalen;
4873 } LDKCVec_RouteHopZ;
4874
4875 /**
4876  * A dynamically-allocated array of crate::lightning::routing::router::Paths of arbitrary size.
4877  * This corresponds to std::vector in C++
4878  */
4879 typedef struct LDKCVec_PathZ {
4880    /**
4881     * The elements in the array.
4882     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4883     */
4884    struct LDKPath *data;
4885    /**
4886     * The number of elements pointed to by `data`.
4887     */
4888    uintptr_t datalen;
4889 } LDKCVec_PathZ;
4890
4891 /**
4892  * The contents of CResult_RouteDecodeErrorZ
4893  */
4894 typedef union LDKCResult_RouteDecodeErrorZPtr {
4895    /**
4896     * A pointer to the contents in the success state.
4897     * Reading from this pointer when `result_ok` is not set is undefined.
4898     */
4899    struct LDKRoute *result;
4900    /**
4901     * A pointer to the contents in the error state.
4902     * Reading from this pointer when `result_ok` is set is undefined.
4903     */
4904    struct LDKDecodeError *err;
4905 } LDKCResult_RouteDecodeErrorZPtr;
4906
4907 /**
4908  * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
4909  * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
4910  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4911  */
4912 typedef struct LDKCResult_RouteDecodeErrorZ {
4913    /**
4914     * The contents of this CResult_RouteDecodeErrorZ, accessible via either
4915     * `err` or `result` depending on the state of `result_ok`.
4916     */
4917    union LDKCResult_RouteDecodeErrorZPtr contents;
4918    /**
4919     * Whether this CResult_RouteDecodeErrorZ represents a success state.
4920     */
4921    bool result_ok;
4922 } LDKCResult_RouteDecodeErrorZ;
4923
4924
4925
4926 /**
4927  * Parameters needed to find a [`Route`].
4928  *
4929  * Passed to [`find_route`] and [`build_route_from_hops`].
4930  */
4931 typedef struct MUST_USE_STRUCT LDKRouteParameters {
4932    /**
4933     * A pointer to the opaque Rust object.
4934     * Nearly everywhere, inner must be non-null, however in places where
4935     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4936     */
4937    LDKnativeRouteParameters *inner;
4938    /**
4939     * Indicates that this is the only struct which contains the same pointer.
4940     * Rust functions which take ownership of an object provided via an argument require
4941     * this to be true and invalidate the object pointed to by inner.
4942     */
4943    bool is_owned;
4944 } LDKRouteParameters;
4945
4946 /**
4947  * The contents of CResult_RouteParametersDecodeErrorZ
4948  */
4949 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
4950    /**
4951     * A pointer to the contents in the success state.
4952     * Reading from this pointer when `result_ok` is not set is undefined.
4953     */
4954    struct LDKRouteParameters *result;
4955    /**
4956     * A pointer to the contents in the error state.
4957     * Reading from this pointer when `result_ok` is set is undefined.
4958     */
4959    struct LDKDecodeError *err;
4960 } LDKCResult_RouteParametersDecodeErrorZPtr;
4961
4962 /**
4963  * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
4964  * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
4965  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4966  */
4967 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
4968    /**
4969     * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
4970     * `err` or `result` depending on the state of `result_ok`.
4971     */
4972    union LDKCResult_RouteParametersDecodeErrorZPtr contents;
4973    /**
4974     * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
4975     */
4976    bool result_ok;
4977 } LDKCResult_RouteParametersDecodeErrorZ;
4978
4979 /**
4980  * A dynamically-allocated array of u64s of arbitrary size.
4981  * This corresponds to std::vector in C++
4982  */
4983 typedef struct LDKCVec_u64Z {
4984    /**
4985     * The elements in the array.
4986     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4987     */
4988    uint64_t *data;
4989    /**
4990     * The number of elements pointed to by `data`.
4991     */
4992    uintptr_t datalen;
4993 } LDKCVec_u64Z;
4994
4995
4996
4997 /**
4998  * Information used to route a payment.
4999  */
5000 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
5001    /**
5002     * A pointer to the opaque Rust object.
5003     * Nearly everywhere, inner must be non-null, however in places where
5004     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5005     */
5006    LDKnativePaymentParameters *inner;
5007    /**
5008     * Indicates that this is the only struct which contains the same pointer.
5009     * Rust functions which take ownership of an object provided via an argument require
5010     * this to be true and invalidate the object pointed to by inner.
5011     */
5012    bool is_owned;
5013 } LDKPaymentParameters;
5014
5015 /**
5016  * The contents of CResult_PaymentParametersDecodeErrorZ
5017  */
5018 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
5019    /**
5020     * A pointer to the contents in the success state.
5021     * Reading from this pointer when `result_ok` is not set is undefined.
5022     */
5023    struct LDKPaymentParameters *result;
5024    /**
5025     * A pointer to the contents in the error state.
5026     * Reading from this pointer when `result_ok` is set is undefined.
5027     */
5028    struct LDKDecodeError *err;
5029 } LDKCResult_PaymentParametersDecodeErrorZPtr;
5030
5031 /**
5032  * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
5033  * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
5034  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5035  */
5036 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
5037    /**
5038     * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
5039     * `err` or `result` depending on the state of `result_ok`.
5040     */
5041    union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
5042    /**
5043     * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
5044     */
5045    bool result_ok;
5046 } LDKCResult_PaymentParametersDecodeErrorZ;
5047
5048
5049
5050 /**
5051  * A list of hops along a payment path terminating with a channel to the recipient.
5052  */
5053 typedef struct MUST_USE_STRUCT LDKRouteHint {
5054    /**
5055     * A pointer to the opaque Rust object.
5056     * Nearly everywhere, inner must be non-null, however in places where
5057     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5058     */
5059    LDKnativeRouteHint *inner;
5060    /**
5061     * Indicates that this is the only struct which contains the same pointer.
5062     * Rust functions which take ownership of an object provided via an argument require
5063     * this to be true and invalidate the object pointed to by inner.
5064     */
5065    bool is_owned;
5066 } LDKRouteHint;
5067
5068 /**
5069  * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
5070  * This corresponds to std::vector in C++
5071  */
5072 typedef struct LDKCVec_RouteHintZ {
5073    /**
5074     * The elements in the array.
5075     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5076     */
5077    struct LDKRouteHint *data;
5078    /**
5079     * The number of elements pointed to by `data`.
5080     */
5081    uintptr_t datalen;
5082 } LDKCVec_RouteHintZ;
5083
5084
5085
5086 /**
5087  * A channel descriptor for a hop along a payment path.
5088  *
5089  * While this generally comes from BOLT 11's `r` field, this struct includes more fields than are
5090  * available in BOLT 11. Thus, encoding and decoding this via `lightning-invoice` is lossy, as
5091  * fields not supported in BOLT 11 will be stripped.
5092  */
5093 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
5094    /**
5095     * A pointer to the opaque Rust object.
5096     * Nearly everywhere, inner must be non-null, however in places where
5097     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5098     */
5099    LDKnativeRouteHintHop *inner;
5100    /**
5101     * Indicates that this is the only struct which contains the same pointer.
5102     * Rust functions which take ownership of an object provided via an argument require
5103     * this to be true and invalidate the object pointed to by inner.
5104     */
5105    bool is_owned;
5106 } LDKRouteHintHop;
5107
5108 /**
5109  * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
5110  * This corresponds to std::vector in C++
5111  */
5112 typedef struct LDKCVec_RouteHintHopZ {
5113    /**
5114     * The elements in the array.
5115     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5116     */
5117    struct LDKRouteHintHop *data;
5118    /**
5119     * The number of elements pointed to by `data`.
5120     */
5121    uintptr_t datalen;
5122 } LDKCVec_RouteHintHopZ;
5123
5124 /**
5125  * The contents of CResult_RouteHintDecodeErrorZ
5126  */
5127 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
5128    /**
5129     * A pointer to the contents in the success state.
5130     * Reading from this pointer when `result_ok` is not set is undefined.
5131     */
5132    struct LDKRouteHint *result;
5133    /**
5134     * A pointer to the contents in the error state.
5135     * Reading from this pointer when `result_ok` is set is undefined.
5136     */
5137    struct LDKDecodeError *err;
5138 } LDKCResult_RouteHintDecodeErrorZPtr;
5139
5140 /**
5141  * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
5142  * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
5143  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5144  */
5145 typedef struct LDKCResult_RouteHintDecodeErrorZ {
5146    /**
5147     * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
5148     * `err` or `result` depending on the state of `result_ok`.
5149     */
5150    union LDKCResult_RouteHintDecodeErrorZPtr contents;
5151    /**
5152     * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
5153     */
5154    bool result_ok;
5155 } LDKCResult_RouteHintDecodeErrorZ;
5156
5157 /**
5158  * The contents of CResult_RouteHintHopDecodeErrorZ
5159  */
5160 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
5161    /**
5162     * A pointer to the contents in the success state.
5163     * Reading from this pointer when `result_ok` is not set is undefined.
5164     */
5165    struct LDKRouteHintHop *result;
5166    /**
5167     * A pointer to the contents in the error state.
5168     * Reading from this pointer when `result_ok` is set is undefined.
5169     */
5170    struct LDKDecodeError *err;
5171 } LDKCResult_RouteHintHopDecodeErrorZPtr;
5172
5173 /**
5174  * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
5175  * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
5176  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5177  */
5178 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
5179    /**
5180     * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
5181     * `err` or `result` depending on the state of `result_ok`.
5182     */
5183    union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
5184    /**
5185     * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
5186     */
5187    bool result_ok;
5188 } LDKCResult_RouteHintHopDecodeErrorZ;
5189
5190
5191
5192 /**
5193  * [`ScoreLookUp`] implementation that uses a fixed penalty.
5194  */
5195 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
5196    /**
5197     * A pointer to the opaque Rust object.
5198     * Nearly everywhere, inner must be non-null, however in places where
5199     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5200     */
5201    LDKnativeFixedPenaltyScorer *inner;
5202    /**
5203     * Indicates that this is the only struct which contains the same pointer.
5204     * Rust functions which take ownership of an object provided via an argument require
5205     * this to be true and invalidate the object pointed to by inner.
5206     */
5207    bool is_owned;
5208 } LDKFixedPenaltyScorer;
5209
5210 /**
5211  * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
5212  */
5213 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
5214    /**
5215     * A pointer to the contents in the success state.
5216     * Reading from this pointer when `result_ok` is not set is undefined.
5217     */
5218    struct LDKFixedPenaltyScorer *result;
5219    /**
5220     * A pointer to the contents in the error state.
5221     * Reading from this pointer when `result_ok` is set is undefined.
5222     */
5223    struct LDKDecodeError *err;
5224 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
5225
5226 /**
5227  * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
5228  * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
5229  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5230  */
5231 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
5232    /**
5233     * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
5234     * `err` or `result` depending on the state of `result_ok`.
5235     */
5236    union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
5237    /**
5238     * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
5239     */
5240    bool result_ok;
5241 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
5242
5243
5244
5245 /**
5246  * Represents the compressed public key of a node
5247  */
5248 typedef struct MUST_USE_STRUCT LDKNodeId {
5249    /**
5250     * A pointer to the opaque Rust object.
5251     * Nearly everywhere, inner must be non-null, however in places where
5252     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5253     */
5254    LDKnativeNodeId *inner;
5255    /**
5256     * Indicates that this is the only struct which contains the same pointer.
5257     * Rust functions which take ownership of an object provided via an argument require
5258     * this to be true and invalidate the object pointed to by inner.
5259     */
5260    bool is_owned;
5261 } LDKNodeId;
5262
5263 /**
5264  * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
5265  * This corresponds to std::vector in C++
5266  */
5267 typedef struct LDKCVec_NodeIdZ {
5268    /**
5269     * The elements in the array.
5270     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5271     */
5272    struct LDKNodeId *data;
5273    /**
5274     * The number of elements pointed to by `data`.
5275     */
5276    uintptr_t datalen;
5277 } LDKCVec_NodeIdZ;
5278
5279 /**
5280  * A tuple of 2 elements. See the individual fields for the types contained.
5281  */
5282 typedef struct LDKC2Tuple_u64u64Z {
5283    /**
5284     * The element at position 0
5285     */
5286    uint64_t a;
5287    /**
5288     * The element at position 1
5289     */
5290    uint64_t b;
5291 } LDKC2Tuple_u64u64Z;
5292
5293 /**
5294  * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
5295  */
5296 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
5297    /**
5298     * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
5299     */
5300    LDKCOption_C2Tuple_u64u64ZZ_Some,
5301    /**
5302     * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
5303     */
5304    LDKCOption_C2Tuple_u64u64ZZ_None,
5305    /**
5306     * Must be last for serialization purposes
5307     */
5308    LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
5309 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
5310
5311 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
5312    LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
5313    union {
5314       struct {
5315          struct LDKC2Tuple_u64u64Z some;
5316       };
5317    };
5318 } LDKCOption_C2Tuple_u64u64ZZ;
5319
5320 /**
5321  * 32 u16s
5322  */
5323 typedef struct LDKThirtyTwoU16s {
5324    /**
5325     * The thirty-two 16-bit integers
5326     */
5327    uint16_t data[32];
5328 } LDKThirtyTwoU16s;
5329
5330 /**
5331  * A tuple of 2 elements. See the individual fields for the types contained.
5332  */
5333 typedef struct LDKC2Tuple_Z {
5334    /**
5335     * The element at position 0
5336     */
5337    struct LDKThirtyTwoU16s a;
5338    /**
5339     * The element at position 1
5340     */
5341    struct LDKThirtyTwoU16s b;
5342 } LDKC2Tuple_Z;
5343
5344 /**
5345  * A tuple of 2 elements. See the individual fields for the types contained.
5346  */
5347 typedef struct LDKC2Tuple__u1632_u1632Z {
5348    /**
5349     * The element at position 0
5350     */
5351    struct LDKThirtyTwoU16s a;
5352    /**
5353     * The element at position 1
5354     */
5355    struct LDKThirtyTwoU16s b;
5356 } LDKC2Tuple__u1632_u1632Z;
5357
5358 /**
5359  * An enum which can either contain a crate::c_types::derived::C2Tuple__u1632_u1632Z or not
5360  */
5361 typedef enum LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag {
5362    /**
5363     * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains a crate::c_types::derived::C2Tuple__u1632_u1632Z
5364     */
5365    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Some,
5366    /**
5367     * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains nothing
5368     */
5369    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_None,
5370    /**
5371     * Must be last for serialization purposes
5372     */
5373    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Sentinel,
5374 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag;
5375
5376 typedef struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ {
5377    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag tag;
5378    union {
5379       struct {
5380          struct LDKC2Tuple__u1632_u1632Z some;
5381       };
5382    };
5383 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ;
5384
5385 /**
5386  * An enum which can either contain a f64 or not
5387  */
5388 typedef enum LDKCOption_f64Z_Tag {
5389    /**
5390     * When we're in this state, this COption_f64Z contains a f64
5391     */
5392    LDKCOption_f64Z_Some,
5393    /**
5394     * When we're in this state, this COption_f64Z contains nothing
5395     */
5396    LDKCOption_f64Z_None,
5397    /**
5398     * Must be last for serialization purposes
5399     */
5400    LDKCOption_f64Z_Sentinel,
5401 } LDKCOption_f64Z_Tag;
5402
5403 typedef struct LDKCOption_f64Z {
5404    LDKCOption_f64Z_Tag tag;
5405    union {
5406       struct {
5407          double some;
5408       };
5409    };
5410 } LDKCOption_f64Z;
5411
5412
5413
5414 /**
5415  * A Record, unit of logging output with Metadata to enable filtering
5416  * Module_path, file, line to inform on log's source
5417  */
5418 typedef struct MUST_USE_STRUCT LDKRecord {
5419    /**
5420     * A pointer to the opaque Rust object.
5421     * Nearly everywhere, inner must be non-null, however in places where
5422     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5423     */
5424    LDKnativeRecord *inner;
5425    /**
5426     * Indicates that this is the only struct which contains the same pointer.
5427     * Rust functions which take ownership of an object provided via an argument require
5428     * this to be true and invalidate the object pointed to by inner.
5429     */
5430    bool is_owned;
5431 } LDKRecord;
5432
5433 /**
5434  * A trait encapsulating the operations required of a logger.
5435  */
5436 typedef struct LDKLogger {
5437    /**
5438     * An opaque pointer which is passed to your function implementations as an argument.
5439     * This has no meaning in the LDK, and can be NULL or any other value.
5440     */
5441    void *this_arg;
5442    /**
5443     * Logs the [`Record`].
5444     */
5445    void (*log)(const void *this_arg, struct LDKRecord record);
5446    /**
5447     * Frees any resources associated with this object given its this_arg pointer.
5448     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5449     */
5450    void (*free)(void *this_arg);
5451 } LDKLogger;
5452
5453
5454
5455 /**
5456  * Represents the network as nodes and channels between them
5457  */
5458 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
5459    /**
5460     * A pointer to the opaque Rust object.
5461     * Nearly everywhere, inner must be non-null, however in places where
5462     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5463     */
5464    LDKnativeNetworkGraph *inner;
5465    /**
5466     * Indicates that this is the only struct which contains the same pointer.
5467     * Rust functions which take ownership of an object provided via an argument require
5468     * this to be true and invalidate the object pointed to by inner.
5469     */
5470    bool is_owned;
5471 } LDKNetworkGraph;
5472
5473
5474
5475 /**
5476  * [`ScoreLookUp`] implementation using channel success probability distributions.
5477  *
5478  * Channels are tracked with upper and lower liquidity bounds - when an HTLC fails at a channel,
5479  * we learn that the upper-bound on the available liquidity is lower than the amount of the HTLC.
5480  * When a payment is forwarded through a channel (but fails later in the route), we learn the
5481  * lower-bound on the channel's available liquidity must be at least the value of the HTLC.
5482  *
5483  * These bounds are then used to determine a success probability using the formula from
5484  * *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
5485  * and Stefan Richter [[1]] (i.e. `(upper_bound - payment_amount) / (upper_bound - lower_bound)`).
5486  *
5487  * This probability is combined with the [`liquidity_penalty_multiplier_msat`] and
5488  * [`liquidity_penalty_amount_multiplier_msat`] parameters to calculate a concrete penalty in
5489  * milli-satoshis. The penalties, when added across all hops, have the property of being linear in
5490  * terms of the entire path's success probability. This allows the router to directly compare
5491  * penalties for different paths. See the documentation of those parameters for the exact formulas.
5492  *
5493  * The liquidity bounds are decayed by halving them every [`liquidity_offset_half_life`].
5494  *
5495  * Further, we track the history of our upper and lower liquidity bounds for each channel,
5496  * allowing us to assign a second penalty (using [`historical_liquidity_penalty_multiplier_msat`]
5497  * and [`historical_liquidity_penalty_amount_multiplier_msat`]) based on the same probability
5498  * formula, but using the history of a channel rather than our latest estimates for the liquidity
5499  * bounds.
5500  *
5501  * [1]: https://arxiv.org/abs/2107.05322
5502  * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_multiplier_msat
5503  * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_amount_multiplier_msat
5504  * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
5505  * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_multiplier_msat
5506  * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_amount_multiplier_msat
5507  */
5508 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
5509    /**
5510     * A pointer to the opaque Rust object.
5511     * Nearly everywhere, inner must be non-null, however in places where
5512     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5513     */
5514    LDKnativeProbabilisticScorer *inner;
5515    /**
5516     * Indicates that this is the only struct which contains the same pointer.
5517     * Rust functions which take ownership of an object provided via an argument require
5518     * this to be true and invalidate the object pointed to by inner.
5519     */
5520    bool is_owned;
5521 } LDKProbabilisticScorer;
5522
5523 /**
5524  * The contents of CResult_ProbabilisticScorerDecodeErrorZ
5525  */
5526 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
5527    /**
5528     * A pointer to the contents in the success state.
5529     * Reading from this pointer when `result_ok` is not set is undefined.
5530     */
5531    struct LDKProbabilisticScorer *result;
5532    /**
5533     * A pointer to the contents in the error state.
5534     * Reading from this pointer when `result_ok` is set is undefined.
5535     */
5536    struct LDKDecodeError *err;
5537 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
5538
5539 /**
5540  * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
5541  * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
5542  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5543  */
5544 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
5545    /**
5546     * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
5547     * `err` or `result` depending on the state of `result_ok`.
5548     */
5549    union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
5550    /**
5551     * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
5552     */
5553    bool result_ok;
5554 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
5555
5556
5557
5558 /**
5559  * The best known block as identified by its hash and height.
5560  */
5561 typedef struct MUST_USE_STRUCT LDKBestBlock {
5562    /**
5563     * A pointer to the opaque Rust object.
5564     * Nearly everywhere, inner must be non-null, however in places where
5565     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5566     */
5567    LDKnativeBestBlock *inner;
5568    /**
5569     * Indicates that this is the only struct which contains the same pointer.
5570     * Rust functions which take ownership of an object provided via an argument require
5571     * this to be true and invalidate the object pointed to by inner.
5572     */
5573    bool is_owned;
5574 } LDKBestBlock;
5575
5576 /**
5577  * The contents of CResult_BestBlockDecodeErrorZ
5578  */
5579 typedef union LDKCResult_BestBlockDecodeErrorZPtr {
5580    /**
5581     * A pointer to the contents in the success state.
5582     * Reading from this pointer when `result_ok` is not set is undefined.
5583     */
5584    struct LDKBestBlock *result;
5585    /**
5586     * A pointer to the contents in the error state.
5587     * Reading from this pointer when `result_ok` is set is undefined.
5588     */
5589    struct LDKDecodeError *err;
5590 } LDKCResult_BestBlockDecodeErrorZPtr;
5591
5592 /**
5593  * A CResult_BestBlockDecodeErrorZ represents the result of a fallible operation,
5594  * containing a crate::lightning::chain::BestBlock on success and a crate::lightning::ln::msgs::DecodeError on failure.
5595  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5596  */
5597 typedef struct LDKCResult_BestBlockDecodeErrorZ {
5598    /**
5599     * The contents of this CResult_BestBlockDecodeErrorZ, accessible via either
5600     * `err` or `result` depending on the state of `result_ok`.
5601     */
5602    union LDKCResult_BestBlockDecodeErrorZPtr contents;
5603    /**
5604     * Whether this CResult_BestBlockDecodeErrorZ represents a success state.
5605     */
5606    bool result_ok;
5607 } LDKCResult_BestBlockDecodeErrorZ;
5608
5609 /**
5610  * A tuple of 2 elements. See the individual fields for the types contained.
5611  */
5612 typedef struct LDKC2Tuple_usizeTransactionZ {
5613    /**
5614     * The element at position 0
5615     */
5616    uintptr_t a;
5617    /**
5618     * The element at position 1
5619     */
5620    struct LDKTransaction b;
5621 } LDKC2Tuple_usizeTransactionZ;
5622
5623 /**
5624  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
5625  * This corresponds to std::vector in C++
5626  */
5627 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
5628    /**
5629     * The elements in the array.
5630     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5631     */
5632    struct LDKC2Tuple_usizeTransactionZ *data;
5633    /**
5634     * The number of elements pointed to by `data`.
5635     */
5636    uintptr_t datalen;
5637 } LDKCVec_C2Tuple_usizeTransactionZZ;
5638
5639 /**
5640  * A tuple of 3 elements. See the individual fields for the types contained.
5641  */
5642 typedef struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ {
5643    /**
5644     * The element at position 0
5645     */
5646    struct LDKThirtyTwoBytes a;
5647    /**
5648     * The element at position 1
5649     */
5650    uint32_t b;
5651    /**
5652     * The element at position 2
5653     */
5654    struct LDKCOption_ThirtyTwoBytesZ c;
5655 } LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ;
5656
5657 /**
5658  * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZs of arbitrary size.
5659  * This corresponds to std::vector in C++
5660  */
5661 typedef struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ {
5662    /**
5663     * The elements in the array.
5664     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5665     */
5666    struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *data;
5667    /**
5668     * The number of elements pointed to by `data`.
5669     */
5670    uintptr_t datalen;
5671 } LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ;
5672
5673 /**
5674  * The contents of CResult_ChannelMonitorUpdateStatusNoneZ
5675  */
5676 typedef union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr {
5677    /**
5678     * A pointer to the contents in the success state.
5679     * Reading from this pointer when `result_ok` is not set is undefined.
5680     */
5681    enum LDKChannelMonitorUpdateStatus *result;
5682    /**
5683     * Note that this value is always NULL, as there are no contents in the Err variant
5684     */
5685    void *err;
5686 } LDKCResult_ChannelMonitorUpdateStatusNoneZPtr;
5687
5688 /**
5689  * A CResult_ChannelMonitorUpdateStatusNoneZ represents the result of a fallible operation,
5690  * containing a crate::lightning::chain::ChannelMonitorUpdateStatus on success and a () on failure.
5691  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5692  */
5693 typedef struct LDKCResult_ChannelMonitorUpdateStatusNoneZ {
5694    /**
5695     * The contents of this CResult_ChannelMonitorUpdateStatusNoneZ, accessible via either
5696     * `err` or `result` depending on the state of `result_ok`.
5697     */
5698    union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr contents;
5699    /**
5700     * Whether this CResult_ChannelMonitorUpdateStatusNoneZ represents a success state.
5701     */
5702    bool result_ok;
5703 } LDKCResult_ChannelMonitorUpdateStatusNoneZ;
5704
5705
5706
5707 /**
5708  * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
5709  * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
5710  * preimage claim backward will lead to loss of funds.
5711  */
5712 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
5713    /**
5714     * A pointer to the opaque Rust object.
5715     * Nearly everywhere, inner must be non-null, however in places where
5716     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5717     */
5718    LDKnativeHTLCUpdate *inner;
5719    /**
5720     * Indicates that this is the only struct which contains the same pointer.
5721     * Rust functions which take ownership of an object provided via an argument require
5722     * this to be true and invalidate the object pointed to by inner.
5723     */
5724    bool is_owned;
5725 } LDKHTLCUpdate;
5726
5727
5728
5729 /**
5730  * Struct to `Display` fields in a safe way using `PrintableString`
5731  */
5732 typedef struct MUST_USE_STRUCT LDKUntrustedString {
5733    /**
5734     * A pointer to the opaque Rust object.
5735     * Nearly everywhere, inner must be non-null, however in places where
5736     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5737     */
5738    LDKnativeUntrustedString *inner;
5739    /**
5740     * Indicates that this is the only struct which contains the same pointer.
5741     * Rust functions which take ownership of an object provided via an argument require
5742     * this to be true and invalidate the object pointed to by inner.
5743     */
5744    bool is_owned;
5745 } LDKUntrustedString;
5746
5747 /**
5748  * The reason the channel was closed. See individual variants for more details.
5749  */
5750 typedef enum LDKClosureReason_Tag {
5751    /**
5752     * Closure generated from receiving a peer error message.
5753     *
5754     * Our counterparty may have broadcasted their latest commitment state, and we have
5755     * as well.
5756     */
5757    LDKClosureReason_CounterpartyForceClosed,
5758    /**
5759     * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
5760     *
5761     * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
5762     */
5763    LDKClosureReason_HolderForceClosed,
5764    /**
5765     * The channel was closed after negotiating a cooperative close and we've now broadcasted
5766     * the cooperative close transaction. Note the shutdown may have been initiated by us.
5767     *
5768     * This was only set in versions of LDK prior to 0.0.122.
5769     */
5770    LDKClosureReason_LegacyCooperativeClosure,
5771    /**
5772     * The channel was closed after negotiating a cooperative close and we've now broadcasted
5773     * the cooperative close transaction. This indicates that the shutdown was initiated by our
5774     * counterparty.
5775     *
5776     * In rare cases where we initiated closure immediately prior to shutting down without
5777     * persisting, this value may be provided for channels we initiated closure for.
5778     */
5779    LDKClosureReason_CounterpartyInitiatedCooperativeClosure,
5780    /**
5781     * The channel was closed after negotiating a cooperative close and we've now broadcasted
5782     * the cooperative close transaction. This indicates that the shutdown was initiated by us.
5783     */
5784    LDKClosureReason_LocallyInitiatedCooperativeClosure,
5785    /**
5786     * A commitment transaction was confirmed on chain, closing the channel. Most likely this
5787     * commitment transaction came from our counterparty, but it may also have come from
5788     * a copy of our own `ChannelMonitor`.
5789     */
5790    LDKClosureReason_CommitmentTxConfirmed,
5791    /**
5792     * The funding transaction failed to confirm in a timely manner on an inbound channel.
5793     */
5794    LDKClosureReason_FundingTimedOut,
5795    /**
5796     * Closure generated from processing an event, likely a HTLC forward/relay/reception.
5797     */
5798    LDKClosureReason_ProcessingError,
5799    /**
5800     * The peer disconnected prior to funding completing. In this case the spec mandates that we
5801     * forget the channel entirely - we can attempt again if the peer reconnects.
5802     *
5803     * This includes cases where we restarted prior to funding completion, including prior to the
5804     * initial [`ChannelMonitor`] persistence completing.
5805     *
5806     * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
5807     * peer because of mutual incompatibility between us and our channel counterparty.
5808     *
5809     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
5810     */
5811    LDKClosureReason_DisconnectedPeer,
5812    /**
5813     * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
5814     * the [`ChannelManager`] deserialized.
5815     *
5816     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
5817     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
5818     */
5819    LDKClosureReason_OutdatedChannelManager,
5820    /**
5821     * The counterparty requested a cooperative close of a channel that had not been funded yet.
5822     * The channel has been immediately closed.
5823     */
5824    LDKClosureReason_CounterpartyCoopClosedUnfundedChannel,
5825    /**
5826     * Another channel in the same funding batch closed before the funding transaction
5827     * was ready to be broadcast.
5828     */
5829    LDKClosureReason_FundingBatchClosure,
5830    /**
5831     * One of our HTLCs timed out in a channel, causing us to force close the channel.
5832     */
5833    LDKClosureReason_HTLCsTimedOut,
5834    /**
5835     * Must be last for serialization purposes
5836     */
5837    LDKClosureReason_Sentinel,
5838 } LDKClosureReason_Tag;
5839
5840 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
5841    /**
5842     * The error which the peer sent us.
5843     *
5844     * Be careful about printing the peer_msg, a well-crafted message could exploit
5845     * a security vulnerability in the terminal emulator or the logging subsystem.
5846     * To be safe, use `Display` on `UntrustedString`
5847     *
5848     * [`UntrustedString`]: crate::util::string::UntrustedString
5849     */
5850    struct LDKUntrustedString peer_msg;
5851 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
5852
5853 typedef struct LDKClosureReason_LDKProcessingError_Body {
5854    /**
5855     * A developer-readable error message which we generated.
5856     */
5857    struct LDKStr err;
5858 } LDKClosureReason_LDKProcessingError_Body;
5859
5860 typedef struct MUST_USE_STRUCT LDKClosureReason {
5861    LDKClosureReason_Tag tag;
5862    union {
5863       LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
5864       LDKClosureReason_LDKProcessingError_Body processing_error;
5865    };
5866 } LDKClosureReason;
5867
5868
5869
5870 /**
5871  * A unique 32-byte identifier for a channel.
5872  * Depending on how the ID is generated, several varieties are distinguished
5873  * (but all are stored as 32 bytes):
5874  *   _v1_ and _temporary_.
5875  * A _v1_ channel ID is generated based on funding tx outpoint (txid & index).
5876  * A _temporary_ ID is generated randomly.
5877  * (Later revocation-point-based _v2_ is a possibility.)
5878  * The variety (context) is not stored, it is relevant only at creation.
5879  */
5880 typedef struct MUST_USE_STRUCT LDKChannelId {
5881    /**
5882     * A pointer to the opaque Rust object.
5883     * Nearly everywhere, inner must be non-null, however in places where
5884     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5885     */
5886    LDKnativeChannelId *inner;
5887    /**
5888     * Indicates that this is the only struct which contains the same pointer.
5889     * Rust functions which take ownership of an object provided via an argument require
5890     * this to be true and invalidate the object pointed to by inner.
5891     */
5892    bool is_owned;
5893 } LDKChannelId;
5894
5895 /**
5896  * An event to be processed by the ChannelManager.
5897  */
5898 typedef enum LDKMonitorEvent_Tag {
5899    /**
5900     * A monitor event containing an HTLCUpdate.
5901     */
5902    LDKMonitorEvent_HTLCEvent,
5903    /**
5904     * Indicates we broadcasted the channel's latest commitment transaction and thus closed the
5905     * channel. Holds information about the channel and why it was closed.
5906     */
5907    LDKMonitorEvent_HolderForceClosedWithInfo,
5908    /**
5909     * Indicates we broadcasted the channel's latest commitment transaction and thus closed the
5910     * channel.
5911     */
5912    LDKMonitorEvent_HolderForceClosed,
5913    /**
5914     * Indicates a [`ChannelMonitor`] update has completed. See
5915     * [`ChannelMonitorUpdateStatus::InProgress`] for more information on how this is used.
5916     *
5917     * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
5918     */
5919    LDKMonitorEvent_Completed,
5920    /**
5921     * Must be last for serialization purposes
5922     */
5923    LDKMonitorEvent_Sentinel,
5924 } LDKMonitorEvent_Tag;
5925
5926 typedef struct LDKMonitorEvent_LDKHolderForceClosedWithInfo_Body {
5927    /**
5928     * The reason the channel was closed.
5929     */
5930    struct LDKClosureReason reason;
5931    /**
5932     * The funding outpoint of the channel.
5933     */
5934    struct LDKOutPoint outpoint;
5935    /**
5936     * The channel ID of the channel.
5937     */
5938    struct LDKChannelId channel_id;
5939 } LDKMonitorEvent_LDKHolderForceClosedWithInfo_Body;
5940
5941 typedef struct LDKMonitorEvent_LDKCompleted_Body {
5942    /**
5943     * The funding outpoint of the [`ChannelMonitor`] that was updated
5944     */
5945    struct LDKOutPoint funding_txo;
5946    /**
5947     * The channel ID of the channel associated with the [`ChannelMonitor`]
5948     */
5949    struct LDKChannelId channel_id;
5950    /**
5951     * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
5952     * [`ChannelMonitor::get_latest_update_id`].
5953     *
5954     * Note that this should only be set to a given update's ID if all previous updates for the
5955     * same [`ChannelMonitor`] have been applied and persisted.
5956     */
5957    uint64_t monitor_update_id;
5958 } LDKMonitorEvent_LDKCompleted_Body;
5959
5960 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
5961    LDKMonitorEvent_Tag tag;
5962    union {
5963       struct {
5964          struct LDKHTLCUpdate htlc_event;
5965       };
5966       LDKMonitorEvent_LDKHolderForceClosedWithInfo_Body holder_force_closed_with_info;
5967       struct {
5968          struct LDKOutPoint holder_force_closed;
5969       };
5970       LDKMonitorEvent_LDKCompleted_Body completed;
5971    };
5972 } LDKMonitorEvent;
5973
5974 /**
5975  * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
5976  * This corresponds to std::vector in C++
5977  */
5978 typedef struct LDKCVec_MonitorEventZ {
5979    /**
5980     * The elements in the array.
5981     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5982     */
5983    struct LDKMonitorEvent *data;
5984    /**
5985     * The number of elements pointed to by `data`.
5986     */
5987    uintptr_t datalen;
5988 } LDKCVec_MonitorEventZ;
5989
5990 /**
5991  * A tuple of 4 elements. See the individual fields for the types contained.
5992  */
5993 typedef struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ {
5994    /**
5995     * The element at position 0
5996     */
5997    struct LDKOutPoint a;
5998    /**
5999     * The element at position 1
6000     */
6001    struct LDKChannelId b;
6002    /**
6003     * The element at position 2
6004     */
6005    struct LDKCVec_MonitorEventZ c;
6006    /**
6007     * The element at position 3
6008     */
6009    struct LDKPublicKey d;
6010 } LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ;
6011
6012 /**
6013  * A dynamically-allocated array of crate::c_types::derived::C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZs of arbitrary size.
6014  * This corresponds to std::vector in C++
6015  */
6016 typedef struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ {
6017    /**
6018     * The elements in the array.
6019     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6020     */
6021    struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *data;
6022    /**
6023     * The number of elements pointed to by `data`.
6024     */
6025    uintptr_t datalen;
6026 } LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ;
6027
6028
6029
6030 /**
6031  * Features used within an `init` message.
6032  */
6033 typedef struct MUST_USE_STRUCT LDKInitFeatures {
6034    /**
6035     * A pointer to the opaque Rust object.
6036     * Nearly everywhere, inner must be non-null, however in places where
6037     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6038     */
6039    LDKnativeInitFeatures *inner;
6040    /**
6041     * Indicates that this is the only struct which contains the same pointer.
6042     * Rust functions which take ownership of an object provided via an argument require
6043     * this to be true and invalidate the object pointed to by inner.
6044     */
6045    bool is_owned;
6046 } LDKInitFeatures;
6047
6048 /**
6049  * The contents of CResult_InitFeaturesDecodeErrorZ
6050  */
6051 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
6052    /**
6053     * A pointer to the contents in the success state.
6054     * Reading from this pointer when `result_ok` is not set is undefined.
6055     */
6056    struct LDKInitFeatures *result;
6057    /**
6058     * A pointer to the contents in the error state.
6059     * Reading from this pointer when `result_ok` is set is undefined.
6060     */
6061    struct LDKDecodeError *err;
6062 } LDKCResult_InitFeaturesDecodeErrorZPtr;
6063
6064 /**
6065  * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
6066  * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6067  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6068  */
6069 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
6070    /**
6071     * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
6072     * `err` or `result` depending on the state of `result_ok`.
6073     */
6074    union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
6075    /**
6076     * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
6077     */
6078    bool result_ok;
6079 } LDKCResult_InitFeaturesDecodeErrorZ;
6080
6081
6082
6083 /**
6084  * Features used within a `channel_announcement` message.
6085  */
6086 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
6087    /**
6088     * A pointer to the opaque Rust object.
6089     * Nearly everywhere, inner must be non-null, however in places where
6090     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6091     */
6092    LDKnativeChannelFeatures *inner;
6093    /**
6094     * Indicates that this is the only struct which contains the same pointer.
6095     * Rust functions which take ownership of an object provided via an argument require
6096     * this to be true and invalidate the object pointed to by inner.
6097     */
6098    bool is_owned;
6099 } LDKChannelFeatures;
6100
6101 /**
6102  * The contents of CResult_ChannelFeaturesDecodeErrorZ
6103  */
6104 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
6105    /**
6106     * A pointer to the contents in the success state.
6107     * Reading from this pointer when `result_ok` is not set is undefined.
6108     */
6109    struct LDKChannelFeatures *result;
6110    /**
6111     * A pointer to the contents in the error state.
6112     * Reading from this pointer when `result_ok` is set is undefined.
6113     */
6114    struct LDKDecodeError *err;
6115 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
6116
6117 /**
6118  * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
6119  * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6120  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6121  */
6122 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
6123    /**
6124     * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
6125     * `err` or `result` depending on the state of `result_ok`.
6126     */
6127    union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
6128    /**
6129     * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
6130     */
6131    bool result_ok;
6132 } LDKCResult_ChannelFeaturesDecodeErrorZ;
6133
6134
6135
6136 /**
6137  * Features used within a `node_announcement` message.
6138  */
6139 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
6140    /**
6141     * A pointer to the opaque Rust object.
6142     * Nearly everywhere, inner must be non-null, however in places where
6143     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6144     */
6145    LDKnativeNodeFeatures *inner;
6146    /**
6147     * Indicates that this is the only struct which contains the same pointer.
6148     * Rust functions which take ownership of an object provided via an argument require
6149     * this to be true and invalidate the object pointed to by inner.
6150     */
6151    bool is_owned;
6152 } LDKNodeFeatures;
6153
6154 /**
6155  * The contents of CResult_NodeFeaturesDecodeErrorZ
6156  */
6157 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
6158    /**
6159     * A pointer to the contents in the success state.
6160     * Reading from this pointer when `result_ok` is not set is undefined.
6161     */
6162    struct LDKNodeFeatures *result;
6163    /**
6164     * A pointer to the contents in the error state.
6165     * Reading from this pointer when `result_ok` is set is undefined.
6166     */
6167    struct LDKDecodeError *err;
6168 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
6169
6170 /**
6171  * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
6172  * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6173  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6174  */
6175 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
6176    /**
6177     * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
6178     * `err` or `result` depending on the state of `result_ok`.
6179     */
6180    union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
6181    /**
6182     * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
6183     */
6184    bool result_ok;
6185 } LDKCResult_NodeFeaturesDecodeErrorZ;
6186
6187
6188
6189 /**
6190  * Features used within an invoice.
6191  */
6192 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceFeatures {
6193    /**
6194     * A pointer to the opaque Rust object.
6195     * Nearly everywhere, inner must be non-null, however in places where
6196     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6197     */
6198    LDKnativeBolt11InvoiceFeatures *inner;
6199    /**
6200     * Indicates that this is the only struct which contains the same pointer.
6201     * Rust functions which take ownership of an object provided via an argument require
6202     * this to be true and invalidate the object pointed to by inner.
6203     */
6204    bool is_owned;
6205 } LDKBolt11InvoiceFeatures;
6206
6207 /**
6208  * The contents of CResult_Bolt11InvoiceFeaturesDecodeErrorZ
6209  */
6210 typedef union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr {
6211    /**
6212     * A pointer to the contents in the success state.
6213     * Reading from this pointer when `result_ok` is not set is undefined.
6214     */
6215    struct LDKBolt11InvoiceFeatures *result;
6216    /**
6217     * A pointer to the contents in the error state.
6218     * Reading from this pointer when `result_ok` is set is undefined.
6219     */
6220    struct LDKDecodeError *err;
6221 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr;
6222
6223 /**
6224  * A CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
6225  * containing a crate::lightning::ln::features::Bolt11InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6226  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6227  */
6228 typedef struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ {
6229    /**
6230     * The contents of this CResult_Bolt11InvoiceFeaturesDecodeErrorZ, accessible via either
6231     * `err` or `result` depending on the state of `result_ok`.
6232     */
6233    union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr contents;
6234    /**
6235     * Whether this CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents a success state.
6236     */
6237    bool result_ok;
6238 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ;
6239
6240
6241
6242 /**
6243  * Features used within an `invoice`.
6244  */
6245 typedef struct MUST_USE_STRUCT LDKBolt12InvoiceFeatures {
6246    /**
6247     * A pointer to the opaque Rust object.
6248     * Nearly everywhere, inner must be non-null, however in places where
6249     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6250     */
6251    LDKnativeBolt12InvoiceFeatures *inner;
6252    /**
6253     * Indicates that this is the only struct which contains the same pointer.
6254     * Rust functions which take ownership of an object provided via an argument require
6255     * this to be true and invalidate the object pointed to by inner.
6256     */
6257    bool is_owned;
6258 } LDKBolt12InvoiceFeatures;
6259
6260 /**
6261  * The contents of CResult_Bolt12InvoiceFeaturesDecodeErrorZ
6262  */
6263 typedef union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr {
6264    /**
6265     * A pointer to the contents in the success state.
6266     * Reading from this pointer when `result_ok` is not set is undefined.
6267     */
6268    struct LDKBolt12InvoiceFeatures *result;
6269    /**
6270     * A pointer to the contents in the error state.
6271     * Reading from this pointer when `result_ok` is set is undefined.
6272     */
6273    struct LDKDecodeError *err;
6274 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr;
6275
6276 /**
6277  * A CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
6278  * containing a crate::lightning::ln::features::Bolt12InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6279  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6280  */
6281 typedef struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ {
6282    /**
6283     * The contents of this CResult_Bolt12InvoiceFeaturesDecodeErrorZ, accessible via either
6284     * `err` or `result` depending on the state of `result_ok`.
6285     */
6286    union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr contents;
6287    /**
6288     * Whether this CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents a success state.
6289     */
6290    bool result_ok;
6291 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ;
6292
6293
6294
6295 /**
6296  * Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
6297  */
6298 typedef struct MUST_USE_STRUCT LDKBlindedHopFeatures {
6299    /**
6300     * A pointer to the opaque Rust object.
6301     * Nearly everywhere, inner must be non-null, however in places where
6302     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6303     */
6304    LDKnativeBlindedHopFeatures *inner;
6305    /**
6306     * Indicates that this is the only struct which contains the same pointer.
6307     * Rust functions which take ownership of an object provided via an argument require
6308     * this to be true and invalidate the object pointed to by inner.
6309     */
6310    bool is_owned;
6311 } LDKBlindedHopFeatures;
6312
6313 /**
6314  * The contents of CResult_BlindedHopFeaturesDecodeErrorZ
6315  */
6316 typedef union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr {
6317    /**
6318     * A pointer to the contents in the success state.
6319     * Reading from this pointer when `result_ok` is not set is undefined.
6320     */
6321    struct LDKBlindedHopFeatures *result;
6322    /**
6323     * A pointer to the contents in the error state.
6324     * Reading from this pointer when `result_ok` is set is undefined.
6325     */
6326    struct LDKDecodeError *err;
6327 } LDKCResult_BlindedHopFeaturesDecodeErrorZPtr;
6328
6329 /**
6330  * A CResult_BlindedHopFeaturesDecodeErrorZ represents the result of a fallible operation,
6331  * containing a crate::lightning::ln::features::BlindedHopFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6332  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6333  */
6334 typedef struct LDKCResult_BlindedHopFeaturesDecodeErrorZ {
6335    /**
6336     * The contents of this CResult_BlindedHopFeaturesDecodeErrorZ, accessible via either
6337     * `err` or `result` depending on the state of `result_ok`.
6338     */
6339    union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr contents;
6340    /**
6341     * Whether this CResult_BlindedHopFeaturesDecodeErrorZ represents a success state.
6342     */
6343    bool result_ok;
6344 } LDKCResult_BlindedHopFeaturesDecodeErrorZ;
6345
6346
6347
6348 /**
6349  * Features used within the channel_type field in an OpenChannel message.
6350  *
6351  * A channel is always of some known \"type\", describing the transaction formats used and the exact
6352  * semantics of our interaction with our peer.
6353  *
6354  * Note that because a channel is a specific type which is proposed by the opener and accepted by
6355  * the counterparty, only required features are allowed here.
6356  *
6357  * This is serialized differently from other feature types - it is not prefixed by a length, and
6358  * thus must only appear inside a TLV where its length is known in advance.
6359  */
6360 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
6361    /**
6362     * A pointer to the opaque Rust object.
6363     * Nearly everywhere, inner must be non-null, however in places where
6364     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6365     */
6366    LDKnativeChannelTypeFeatures *inner;
6367    /**
6368     * Indicates that this is the only struct which contains the same pointer.
6369     * Rust functions which take ownership of an object provided via an argument require
6370     * this to be true and invalidate the object pointed to by inner.
6371     */
6372    bool is_owned;
6373 } LDKChannelTypeFeatures;
6374
6375 /**
6376  * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
6377  */
6378 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
6379    /**
6380     * A pointer to the contents in the success state.
6381     * Reading from this pointer when `result_ok` is not set is undefined.
6382     */
6383    struct LDKChannelTypeFeatures *result;
6384    /**
6385     * A pointer to the contents in the error state.
6386     * Reading from this pointer when `result_ok` is set is undefined.
6387     */
6388    struct LDKDecodeError *err;
6389 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
6390
6391 /**
6392  * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
6393  * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6394  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6395  */
6396 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
6397    /**
6398     * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
6399     * `err` or `result` depending on the state of `result_ok`.
6400     */
6401    union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
6402    /**
6403     * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
6404     */
6405    bool result_ok;
6406 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
6407
6408
6409
6410 /**
6411  * An identifier for an [`Offer`] built using [`DerivedMetadata`].
6412  */
6413 typedef struct MUST_USE_STRUCT LDKOfferId {
6414    /**
6415     * A pointer to the opaque Rust object.
6416     * Nearly everywhere, inner must be non-null, however in places where
6417     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6418     */
6419    LDKnativeOfferId *inner;
6420    /**
6421     * Indicates that this is the only struct which contains the same pointer.
6422     * Rust functions which take ownership of an object provided via an argument require
6423     * this to be true and invalidate the object pointed to by inner.
6424     */
6425    bool is_owned;
6426 } LDKOfferId;
6427
6428 /**
6429  * The contents of CResult_OfferIdDecodeErrorZ
6430  */
6431 typedef union LDKCResult_OfferIdDecodeErrorZPtr {
6432    /**
6433     * A pointer to the contents in the success state.
6434     * Reading from this pointer when `result_ok` is not set is undefined.
6435     */
6436    struct LDKOfferId *result;
6437    /**
6438     * A pointer to the contents in the error state.
6439     * Reading from this pointer when `result_ok` is set is undefined.
6440     */
6441    struct LDKDecodeError *err;
6442 } LDKCResult_OfferIdDecodeErrorZPtr;
6443
6444 /**
6445  * A CResult_OfferIdDecodeErrorZ represents the result of a fallible operation,
6446  * containing a crate::lightning::offers::offer::OfferId on success and a crate::lightning::ln::msgs::DecodeError on failure.
6447  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6448  */
6449 typedef struct LDKCResult_OfferIdDecodeErrorZ {
6450    /**
6451     * The contents of this CResult_OfferIdDecodeErrorZ, accessible via either
6452     * `err` or `result` depending on the state of `result_ok`.
6453     */
6454    union LDKCResult_OfferIdDecodeErrorZPtr contents;
6455    /**
6456     * Whether this CResult_OfferIdDecodeErrorZ represents a success state.
6457     */
6458    bool result_ok;
6459 } LDKCResult_OfferIdDecodeErrorZ;
6460
6461 /**
6462  * The contents of CResult_NoneBolt12SemanticErrorZ
6463  */
6464 typedef union LDKCResult_NoneBolt12SemanticErrorZPtr {
6465    /**
6466     * Note that this value is always NULL, as there are no contents in the OK variant
6467     */
6468    void *result;
6469    /**
6470     * A pointer to the contents in the error state.
6471     * Reading from this pointer when `result_ok` is set is undefined.
6472     */
6473    enum LDKBolt12SemanticError *err;
6474 } LDKCResult_NoneBolt12SemanticErrorZPtr;
6475
6476 /**
6477  * A CResult_NoneBolt12SemanticErrorZ represents the result of a fallible operation,
6478  * containing a () on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
6479  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6480  */
6481 typedef struct LDKCResult_NoneBolt12SemanticErrorZ {
6482    /**
6483     * The contents of this CResult_NoneBolt12SemanticErrorZ, accessible via either
6484     * `err` or `result` depending on the state of `result_ok`.
6485     */
6486    union LDKCResult_NoneBolt12SemanticErrorZPtr contents;
6487    /**
6488     * Whether this CResult_NoneBolt12SemanticErrorZ represents a success state.
6489     */
6490    bool result_ok;
6491 } LDKCResult_NoneBolt12SemanticErrorZ;
6492
6493
6494
6495 /**
6496  * An `Offer` is a potentially long-lived proposal for payment of a good or service.
6497  *
6498  * An offer is a precursor to an [`InvoiceRequest`]. A merchant publishes an offer from which a
6499  * customer may request an [`Bolt12Invoice`] for a specific quantity and using an amount sufficient
6500  * to cover that quantity (i.e., at least `quantity * amount`). See [`Offer::amount`].
6501  *
6502  * Offers may be denominated in currency other than bitcoin but are ultimately paid using the
6503  * latter.
6504  *
6505  * Through the use of [`BlindedPath`]s, offers provide recipient privacy.
6506  *
6507  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
6508  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
6509  */
6510 typedef struct MUST_USE_STRUCT LDKOffer {
6511    /**
6512     * A pointer to the opaque Rust object.
6513     * Nearly everywhere, inner must be non-null, however in places where
6514     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6515     */
6516    LDKnativeOffer *inner;
6517    /**
6518     * Indicates that this is the only struct which contains the same pointer.
6519     * Rust functions which take ownership of an object provided via an argument require
6520     * this to be true and invalidate the object pointed to by inner.
6521     */
6522    bool is_owned;
6523 } LDKOffer;
6524
6525 /**
6526  * The contents of CResult_OfferBolt12SemanticErrorZ
6527  */
6528 typedef union LDKCResult_OfferBolt12SemanticErrorZPtr {
6529    /**
6530     * A pointer to the contents in the success state.
6531     * Reading from this pointer when `result_ok` is not set is undefined.
6532     */
6533    struct LDKOffer *result;
6534    /**
6535     * A pointer to the contents in the error state.
6536     * Reading from this pointer when `result_ok` is set is undefined.
6537     */
6538    enum LDKBolt12SemanticError *err;
6539 } LDKCResult_OfferBolt12SemanticErrorZPtr;
6540
6541 /**
6542  * A CResult_OfferBolt12SemanticErrorZ represents the result of a fallible operation,
6543  * containing a crate::lightning::offers::offer::Offer on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
6544  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6545  */
6546 typedef struct LDKCResult_OfferBolt12SemanticErrorZ {
6547    /**
6548     * The contents of this CResult_OfferBolt12SemanticErrorZ, accessible via either
6549     * `err` or `result` depending on the state of `result_ok`.
6550     */
6551    union LDKCResult_OfferBolt12SemanticErrorZPtr contents;
6552    /**
6553     * Whether this CResult_OfferBolt12SemanticErrorZ represents a success state.
6554     */
6555    bool result_ok;
6556 } LDKCResult_OfferBolt12SemanticErrorZ;
6557
6558
6559
6560 /**
6561  * Builds an [`InvoiceRequest`] from an [`Offer`] for the \"offer to be paid\" flow.
6562  *
6563  * See [module-level documentation] for usage.
6564  *
6565  * [module-level documentation]: self
6566  */
6567 typedef struct MUST_USE_STRUCT LDKInvoiceRequestWithDerivedPayerIdBuilder {
6568    /**
6569     * A pointer to the opaque Rust object.
6570     * Nearly everywhere, inner must be non-null, however in places where
6571     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6572     */
6573    LDKnativeInvoiceRequestWithDerivedPayerIdBuilder *inner;
6574    /**
6575     * Indicates that this is the only struct which contains the same pointer.
6576     * Rust functions which take ownership of an object provided via an argument require
6577     * this to be true and invalidate the object pointed to by inner.
6578     */
6579    bool is_owned;
6580 } LDKInvoiceRequestWithDerivedPayerIdBuilder;
6581
6582 /**
6583  * The contents of CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ
6584  */
6585 typedef union LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZPtr {
6586    /**
6587     * A pointer to the contents in the success state.
6588     * Reading from this pointer when `result_ok` is not set is undefined.
6589     */
6590    struct LDKInvoiceRequestWithDerivedPayerIdBuilder *result;
6591    /**
6592     * A pointer to the contents in the error state.
6593     * Reading from this pointer when `result_ok` is set is undefined.
6594     */
6595    enum LDKBolt12SemanticError *err;
6596 } LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZPtr;
6597
6598 /**
6599  * A CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
6600  * containing a crate::lightning::offers::invoice_request::InvoiceRequestWithDerivedPayerIdBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
6601  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6602  */
6603 typedef struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ {
6604    /**
6605     * The contents of this CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ, accessible via either
6606     * `err` or `result` depending on the state of `result_ok`.
6607     */
6608    union LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZPtr contents;
6609    /**
6610     * Whether this CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ represents a success state.
6611     */
6612    bool result_ok;
6613 } LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ;
6614
6615
6616
6617 /**
6618  * Builds an [`InvoiceRequest`] from an [`Offer`] for the \"offer to be paid\" flow.
6619  *
6620  * See [module-level documentation] for usage.
6621  *
6622  * [module-level documentation]: self
6623  */
6624 typedef struct MUST_USE_STRUCT LDKInvoiceRequestWithExplicitPayerIdBuilder {
6625    /**
6626     * A pointer to the opaque Rust object.
6627     * Nearly everywhere, inner must be non-null, however in places where
6628     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6629     */
6630    LDKnativeInvoiceRequestWithExplicitPayerIdBuilder *inner;
6631    /**
6632     * Indicates that this is the only struct which contains the same pointer.
6633     * Rust functions which take ownership of an object provided via an argument require
6634     * this to be true and invalidate the object pointed to by inner.
6635     */
6636    bool is_owned;
6637 } LDKInvoiceRequestWithExplicitPayerIdBuilder;
6638
6639 /**
6640  * The contents of CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ
6641  */
6642 typedef union LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZPtr {
6643    /**
6644     * A pointer to the contents in the success state.
6645     * Reading from this pointer when `result_ok` is not set is undefined.
6646     */
6647    struct LDKInvoiceRequestWithExplicitPayerIdBuilder *result;
6648    /**
6649     * A pointer to the contents in the error state.
6650     * Reading from this pointer when `result_ok` is set is undefined.
6651     */
6652    enum LDKBolt12SemanticError *err;
6653 } LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZPtr;
6654
6655 /**
6656  * A CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
6657  * containing a crate::lightning::offers::invoice_request::InvoiceRequestWithExplicitPayerIdBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
6658  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6659  */
6660 typedef struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ {
6661    /**
6662     * The contents of this CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ, accessible via either
6663     * `err` or `result` depending on the state of `result_ok`.
6664     */
6665    union LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZPtr contents;
6666    /**
6667     * Whether this CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ represents a success state.
6668     */
6669    bool result_ok;
6670 } LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ;
6671
6672 /**
6673  * The contents of CResult_OfferBolt12ParseErrorZ
6674  */
6675 typedef union LDKCResult_OfferBolt12ParseErrorZPtr {
6676    /**
6677     * A pointer to the contents in the success state.
6678     * Reading from this pointer when `result_ok` is not set is undefined.
6679     */
6680    struct LDKOffer *result;
6681    /**
6682     * A pointer to the contents in the error state.
6683     * Reading from this pointer when `result_ok` is set is undefined.
6684     */
6685    struct LDKBolt12ParseError *err;
6686 } LDKCResult_OfferBolt12ParseErrorZPtr;
6687
6688 /**
6689  * A CResult_OfferBolt12ParseErrorZ represents the result of a fallible operation,
6690  * containing a crate::lightning::offers::offer::Offer on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
6691  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6692  */
6693 typedef struct LDKCResult_OfferBolt12ParseErrorZ {
6694    /**
6695     * The contents of this CResult_OfferBolt12ParseErrorZ, accessible via either
6696     * `err` or `result` depending on the state of `result_ok`.
6697     */
6698    union LDKCResult_OfferBolt12ParseErrorZPtr contents;
6699    /**
6700     * Whether this CResult_OfferBolt12ParseErrorZ represents a success state.
6701     */
6702    bool result_ok;
6703 } LDKCResult_OfferBolt12ParseErrorZ;
6704
6705 /**
6706  * The contents of CResult_NodeIdDecodeErrorZ
6707  */
6708 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
6709    /**
6710     * A pointer to the contents in the success state.
6711     * Reading from this pointer when `result_ok` is not set is undefined.
6712     */
6713    struct LDKNodeId *result;
6714    /**
6715     * A pointer to the contents in the error state.
6716     * Reading from this pointer when `result_ok` is set is undefined.
6717     */
6718    struct LDKDecodeError *err;
6719 } LDKCResult_NodeIdDecodeErrorZPtr;
6720
6721 /**
6722  * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
6723  * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
6724  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6725  */
6726 typedef struct LDKCResult_NodeIdDecodeErrorZ {
6727    /**
6728     * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
6729     * `err` or `result` depending on the state of `result_ok`.
6730     */
6731    union LDKCResult_NodeIdDecodeErrorZPtr contents;
6732    /**
6733     * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
6734     */
6735    bool result_ok;
6736 } LDKCResult_NodeIdDecodeErrorZ;
6737
6738 /**
6739  * The contents of CResult_PublicKeySecp256k1ErrorZ
6740  */
6741 typedef union LDKCResult_PublicKeySecp256k1ErrorZPtr {
6742    /**
6743     * A pointer to the contents in the success state.
6744     * Reading from this pointer when `result_ok` is not set is undefined.
6745     */
6746    struct LDKPublicKey *result;
6747    /**
6748     * A pointer to the contents in the error state.
6749     * Reading from this pointer when `result_ok` is set is undefined.
6750     */
6751    enum LDKSecp256k1Error *err;
6752 } LDKCResult_PublicKeySecp256k1ErrorZPtr;
6753
6754 /**
6755  * A CResult_PublicKeySecp256k1ErrorZ represents the result of a fallible operation,
6756  * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
6757  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6758  */
6759 typedef struct LDKCResult_PublicKeySecp256k1ErrorZ {
6760    /**
6761     * The contents of this CResult_PublicKeySecp256k1ErrorZ, accessible via either
6762     * `err` or `result` depending on the state of `result_ok`.
6763     */
6764    union LDKCResult_PublicKeySecp256k1ErrorZPtr contents;
6765    /**
6766     * Whether this CResult_PublicKeySecp256k1ErrorZ represents a success state.
6767     */
6768    bool result_ok;
6769 } LDKCResult_PublicKeySecp256k1ErrorZ;
6770
6771
6772
6773 /**
6774  * A [`channel_update`] message to be sent to or received from a peer.
6775  *
6776  * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
6777  */
6778 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
6779    /**
6780     * A pointer to the opaque Rust object.
6781     * Nearly everywhere, inner must be non-null, however in places where
6782     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6783     */
6784    LDKnativeChannelUpdate *inner;
6785    /**
6786     * Indicates that this is the only struct which contains the same pointer.
6787     * Rust functions which take ownership of an object provided via an argument require
6788     * this to be true and invalidate the object pointed to by inner.
6789     */
6790    bool is_owned;
6791 } LDKChannelUpdate;
6792
6793 /**
6794  * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
6795  * return packet by a node along the route. See [BOLT #4] for details.
6796  *
6797  * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
6798  */
6799 typedef enum LDKNetworkUpdate_Tag {
6800    /**
6801     * An error indicating a `channel_update` messages should be applied via
6802     * [`NetworkGraph::update_channel`].
6803     */
6804    LDKNetworkUpdate_ChannelUpdateMessage,
6805    /**
6806     * An error indicating that a channel failed to route a payment, which should be applied via
6807     * [`NetworkGraph::channel_failed_permanent`] if permanent.
6808     */
6809    LDKNetworkUpdate_ChannelFailure,
6810    /**
6811     * An error indicating that a node failed to route a payment, which should be applied via
6812     * [`NetworkGraph::node_failed_permanent`] if permanent.
6813     */
6814    LDKNetworkUpdate_NodeFailure,
6815    /**
6816     * Must be last for serialization purposes
6817     */
6818    LDKNetworkUpdate_Sentinel,
6819 } LDKNetworkUpdate_Tag;
6820
6821 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
6822    /**
6823     * The update to apply via [`NetworkGraph::update_channel`].
6824     */
6825    struct LDKChannelUpdate msg;
6826 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
6827
6828 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
6829    /**
6830     * The short channel id of the closed channel.
6831     */
6832    uint64_t short_channel_id;
6833    /**
6834     * Whether the channel should be permanently removed or temporarily disabled until a new
6835     * `channel_update` message is received.
6836     */
6837    bool is_permanent;
6838 } LDKNetworkUpdate_LDKChannelFailure_Body;
6839
6840 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
6841    /**
6842     * The node id of the failed node.
6843     */
6844    struct LDKPublicKey node_id;
6845    /**
6846     * Whether the node should be permanently removed from consideration or can be restored
6847     * when a new `channel_update` message is received.
6848     */
6849    bool is_permanent;
6850 } LDKNetworkUpdate_LDKNodeFailure_Body;
6851
6852 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
6853    LDKNetworkUpdate_Tag tag;
6854    union {
6855       LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
6856       LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
6857       LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
6858    };
6859 } LDKNetworkUpdate;
6860
6861 /**
6862  * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
6863  */
6864 typedef enum LDKCOption_NetworkUpdateZ_Tag {
6865    /**
6866     * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
6867     */
6868    LDKCOption_NetworkUpdateZ_Some,
6869    /**
6870     * When we're in this state, this COption_NetworkUpdateZ contains nothing
6871     */
6872    LDKCOption_NetworkUpdateZ_None,
6873    /**
6874     * Must be last for serialization purposes
6875     */
6876    LDKCOption_NetworkUpdateZ_Sentinel,
6877 } LDKCOption_NetworkUpdateZ_Tag;
6878
6879 typedef struct LDKCOption_NetworkUpdateZ {
6880    LDKCOption_NetworkUpdateZ_Tag tag;
6881    union {
6882       struct {
6883          struct LDKNetworkUpdate some;
6884       };
6885    };
6886 } LDKCOption_NetworkUpdateZ;
6887
6888 /**
6889  * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
6890  */
6891 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
6892    /**
6893     * A pointer to the contents in the success state.
6894     * Reading from this pointer when `result_ok` is not set is undefined.
6895     */
6896    struct LDKCOption_NetworkUpdateZ *result;
6897    /**
6898     * A pointer to the contents in the error state.
6899     * Reading from this pointer when `result_ok` is set is undefined.
6900     */
6901    struct LDKDecodeError *err;
6902 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
6903
6904 /**
6905  * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
6906  * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
6907  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6908  */
6909 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
6910    /**
6911     * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
6912     * `err` or `result` depending on the state of `result_ok`.
6913     */
6914    union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
6915    /**
6916     * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
6917     */
6918    bool result_ok;
6919 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
6920
6921 /**
6922  * The contents of CResult_TxOutUtxoLookupErrorZ
6923  */
6924 typedef union LDKCResult_TxOutUtxoLookupErrorZPtr {
6925    /**
6926     * A pointer to the contents in the success state.
6927     * Reading from this pointer when `result_ok` is not set is undefined.
6928     */
6929    struct LDKTxOut *result;
6930    /**
6931     * A pointer to the contents in the error state.
6932     * Reading from this pointer when `result_ok` is set is undefined.
6933     */
6934    enum LDKUtxoLookupError *err;
6935 } LDKCResult_TxOutUtxoLookupErrorZPtr;
6936
6937 /**
6938  * A CResult_TxOutUtxoLookupErrorZ represents the result of a fallible operation,
6939  * containing a crate::c_types::TxOut on success and a crate::lightning::routing::utxo::UtxoLookupError on failure.
6940  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6941  */
6942 typedef struct LDKCResult_TxOutUtxoLookupErrorZ {
6943    /**
6944     * The contents of this CResult_TxOutUtxoLookupErrorZ, accessible via either
6945     * `err` or `result` depending on the state of `result_ok`.
6946     */
6947    union LDKCResult_TxOutUtxoLookupErrorZPtr contents;
6948    /**
6949     * Whether this CResult_TxOutUtxoLookupErrorZ represents a success state.
6950     */
6951    bool result_ok;
6952 } LDKCResult_TxOutUtxoLookupErrorZ;
6953
6954
6955
6956 /**
6957  * Represents a future resolution of a [`UtxoLookup::get_utxo`] query resolving async.
6958  *
6959  * See [`UtxoResult::Async`] and [`UtxoFuture::resolve`] for more info.
6960  */
6961 typedef struct MUST_USE_STRUCT LDKUtxoFuture {
6962    /**
6963     * A pointer to the opaque Rust object.
6964     * Nearly everywhere, inner must be non-null, however in places where
6965     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6966     */
6967    LDKnativeUtxoFuture *inner;
6968    /**
6969     * Indicates that this is the only struct which contains the same pointer.
6970     * Rust functions which take ownership of an object provided via an argument require
6971     * this to be true and invalidate the object pointed to by inner.
6972     */
6973    bool is_owned;
6974 } LDKUtxoFuture;
6975
6976 /**
6977  * The result of a [`UtxoLookup::get_utxo`] call. A call may resolve either synchronously,
6978  * returning the `Sync` variant, or asynchronously, returning an [`UtxoFuture`] in the `Async`
6979  * variant.
6980  */
6981 typedef enum LDKUtxoResult_Tag {
6982    /**
6983     * A result which was resolved synchronously. It either includes a [`TxOut`] for the output
6984     * requested or a [`UtxoLookupError`].
6985     */
6986    LDKUtxoResult_Sync,
6987    /**
6988     * A result which will be resolved asynchronously. It includes a [`UtxoFuture`], a `clone` of
6989     * which you must keep locally and call [`UtxoFuture::resolve`] on once the lookup completes.
6990     *
6991     * Note that in order to avoid runaway memory usage, the number of parallel checks is limited,
6992     * but only fairly loosely. Because a pending checks block all message processing, leaving
6993     * checks pending for an extended time may cause DoS of other functions. It is recommended you
6994     * keep a tight timeout on lookups, on the order of a few seconds.
6995     */
6996    LDKUtxoResult_Async,
6997    /**
6998     * Must be last for serialization purposes
6999     */
7000    LDKUtxoResult_Sentinel,
7001 } LDKUtxoResult_Tag;
7002
7003 typedef struct MUST_USE_STRUCT LDKUtxoResult {
7004    LDKUtxoResult_Tag tag;
7005    union {
7006       struct {
7007          struct LDKCResult_TxOutUtxoLookupErrorZ sync;
7008       };
7009       struct {
7010          struct LDKUtxoFuture async;
7011       };
7012    };
7013 } LDKUtxoResult;
7014
7015 /**
7016  * The `UtxoLookup` trait defines behavior for accessing on-chain UTXOs.
7017  */
7018 typedef struct LDKUtxoLookup {
7019    /**
7020     * An opaque pointer which is passed to your function implementations as an argument.
7021     * This has no meaning in the LDK, and can be NULL or any other value.
7022     */
7023    void *this_arg;
7024    /**
7025     * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
7026     * Returns an error if `chain_hash` is for a different chain or if such a transaction output is
7027     * unknown.
7028     *
7029     * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
7030     */
7031    struct LDKUtxoResult (*get_utxo)(const void *this_arg, const uint8_t (*chain_hash)[32], uint64_t short_channel_id);
7032    /**
7033     * Frees any resources associated with this object given its this_arg pointer.
7034     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7035     */
7036    void (*free)(void *this_arg);
7037 } LDKUtxoLookup;
7038
7039 /**
7040  * An enum which can either contain a crate::lightning::routing::utxo::UtxoLookup or not
7041  */
7042 typedef enum LDKCOption_UtxoLookupZ_Tag {
7043    /**
7044     * When we're in this state, this COption_UtxoLookupZ contains a crate::lightning::routing::utxo::UtxoLookup
7045     */
7046    LDKCOption_UtxoLookupZ_Some,
7047    /**
7048     * When we're in this state, this COption_UtxoLookupZ contains nothing
7049     */
7050    LDKCOption_UtxoLookupZ_None,
7051    /**
7052     * Must be last for serialization purposes
7053     */
7054    LDKCOption_UtxoLookupZ_Sentinel,
7055 } LDKCOption_UtxoLookupZ_Tag;
7056
7057 typedef struct LDKCOption_UtxoLookupZ {
7058    LDKCOption_UtxoLookupZ_Tag tag;
7059    union {
7060       struct {
7061          struct LDKUtxoLookup some;
7062       };
7063    };
7064 } LDKCOption_UtxoLookupZ;
7065
7066 /**
7067  * The contents of CResult_NoneLightningErrorZ
7068  */
7069 typedef union LDKCResult_NoneLightningErrorZPtr {
7070    /**
7071     * Note that this value is always NULL, as there are no contents in the OK variant
7072     */
7073    void *result;
7074    /**
7075     * A pointer to the contents in the error state.
7076     * Reading from this pointer when `result_ok` is set is undefined.
7077     */
7078    struct LDKLightningError *err;
7079 } LDKCResult_NoneLightningErrorZPtr;
7080
7081 /**
7082  * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
7083  * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
7084  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7085  */
7086 typedef struct LDKCResult_NoneLightningErrorZ {
7087    /**
7088     * The contents of this CResult_NoneLightningErrorZ, accessible via either
7089     * `err` or `result` depending on the state of `result_ok`.
7090     */
7091    union LDKCResult_NoneLightningErrorZPtr contents;
7092    /**
7093     * Whether this CResult_NoneLightningErrorZ represents a success state.
7094     */
7095    bool result_ok;
7096 } LDKCResult_NoneLightningErrorZ;
7097
7098 /**
7099  * The contents of CResult_boolLightningErrorZ
7100  */
7101 typedef union LDKCResult_boolLightningErrorZPtr {
7102    /**
7103     * A pointer to the contents in the success state.
7104     * Reading from this pointer when `result_ok` is not set is undefined.
7105     */
7106    bool *result;
7107    /**
7108     * A pointer to the contents in the error state.
7109     * Reading from this pointer when `result_ok` is set is undefined.
7110     */
7111    struct LDKLightningError *err;
7112 } LDKCResult_boolLightningErrorZPtr;
7113
7114 /**
7115  * A CResult_boolLightningErrorZ represents the result of a fallible operation,
7116  * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
7117  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7118  */
7119 typedef struct LDKCResult_boolLightningErrorZ {
7120    /**
7121     * The contents of this CResult_boolLightningErrorZ, accessible via either
7122     * `err` or `result` depending on the state of `result_ok`.
7123     */
7124    union LDKCResult_boolLightningErrorZPtr contents;
7125    /**
7126     * Whether this CResult_boolLightningErrorZ represents a success state.
7127     */
7128    bool result_ok;
7129 } LDKCResult_boolLightningErrorZ;
7130
7131
7132
7133 /**
7134  * A [`channel_announcement`] message to be sent to or received from a peer.
7135  *
7136  * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
7137  */
7138 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
7139    /**
7140     * A pointer to the opaque Rust object.
7141     * Nearly everywhere, inner must be non-null, however in places where
7142     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7143     */
7144    LDKnativeChannelAnnouncement *inner;
7145    /**
7146     * Indicates that this is the only struct which contains the same pointer.
7147     * Rust functions which take ownership of an object provided via an argument require
7148     * this to be true and invalidate the object pointed to by inner.
7149     */
7150    bool is_owned;
7151 } LDKChannelAnnouncement;
7152
7153 /**
7154  * A tuple of 3 elements. See the individual fields for the types contained.
7155  */
7156 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
7157    /**
7158     * The element at position 0
7159     */
7160    struct LDKChannelAnnouncement a;
7161    /**
7162     * The element at position 1
7163     */
7164    struct LDKChannelUpdate b;
7165    /**
7166     * The element at position 2
7167     */
7168    struct LDKChannelUpdate c;
7169 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
7170
7171 /**
7172  * An enum which can either contain a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ or not
7173  */
7174 typedef enum LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag {
7175    /**
7176     * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
7177     */
7178    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some,
7179    /**
7180     * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains nothing
7181     */
7182    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None,
7183    /**
7184     * Must be last for serialization purposes
7185     */
7186    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Sentinel,
7187 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag;
7188
7189 typedef struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
7190    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag tag;
7191    union {
7192       struct {
7193          struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ some;
7194       };
7195    };
7196 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
7197
7198
7199
7200 /**
7201  * An [`accept_channel`] message to be sent to or received from a peer.
7202  *
7203  * Used in V1 channel establishment
7204  *
7205  * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
7206  */
7207 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
7208    /**
7209     * A pointer to the opaque Rust object.
7210     * Nearly everywhere, inner must be non-null, however in places where
7211     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7212     */
7213    LDKnativeAcceptChannel *inner;
7214    /**
7215     * Indicates that this is the only struct which contains the same pointer.
7216     * Rust functions which take ownership of an object provided via an argument require
7217     * this to be true and invalidate the object pointed to by inner.
7218     */
7219    bool is_owned;
7220 } LDKAcceptChannel;
7221
7222
7223
7224 /**
7225  * An accept_channel2 message to be sent by or received from the channel accepter.
7226  *
7227  * Used in V2 channel establishment
7228  *
7229  */
7230 typedef struct MUST_USE_STRUCT LDKAcceptChannelV2 {
7231    /**
7232     * A pointer to the opaque Rust object.
7233     * Nearly everywhere, inner must be non-null, however in places where
7234     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7235     */
7236    LDKnativeAcceptChannelV2 *inner;
7237    /**
7238     * Indicates that this is the only struct which contains the same pointer.
7239     * Rust functions which take ownership of an object provided via an argument require
7240     * this to be true and invalidate the object pointed to by inner.
7241     */
7242    bool is_owned;
7243 } LDKAcceptChannelV2;
7244
7245
7246
7247 /**
7248  * An [`open_channel`] message to be sent to or received from a peer.
7249  *
7250  * Used in V1 channel establishment
7251  *
7252  * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
7253  */
7254 typedef struct MUST_USE_STRUCT LDKOpenChannel {
7255    /**
7256     * A pointer to the opaque Rust object.
7257     * Nearly everywhere, inner must be non-null, however in places where
7258     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7259     */
7260    LDKnativeOpenChannel *inner;
7261    /**
7262     * Indicates that this is the only struct which contains the same pointer.
7263     * Rust functions which take ownership of an object provided via an argument require
7264     * this to be true and invalidate the object pointed to by inner.
7265     */
7266    bool is_owned;
7267 } LDKOpenChannel;
7268
7269
7270
7271 /**
7272  * An open_channel2 message to be sent by or received from the channel initiator.
7273  *
7274  * Used in V2 channel establishment
7275  *
7276  */
7277 typedef struct MUST_USE_STRUCT LDKOpenChannelV2 {
7278    /**
7279     * A pointer to the opaque Rust object.
7280     * Nearly everywhere, inner must be non-null, however in places where
7281     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7282     */
7283    LDKnativeOpenChannelV2 *inner;
7284    /**
7285     * Indicates that this is the only struct which contains the same pointer.
7286     * Rust functions which take ownership of an object provided via an argument require
7287     * this to be true and invalidate the object pointed to by inner.
7288     */
7289    bool is_owned;
7290 } LDKOpenChannelV2;
7291
7292
7293
7294 /**
7295  * A [`funding_created`] message to be sent to or received from a peer.
7296  *
7297  * Used in V1 channel establishment
7298  *
7299  * [`funding_created`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_created-message
7300  */
7301 typedef struct MUST_USE_STRUCT LDKFundingCreated {
7302    /**
7303     * A pointer to the opaque Rust object.
7304     * Nearly everywhere, inner must be non-null, however in places where
7305     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7306     */
7307    LDKnativeFundingCreated *inner;
7308    /**
7309     * Indicates that this is the only struct which contains the same pointer.
7310     * Rust functions which take ownership of an object provided via an argument require
7311     * this to be true and invalidate the object pointed to by inner.
7312     */
7313    bool is_owned;
7314 } LDKFundingCreated;
7315
7316
7317
7318 /**
7319  * A [`funding_signed`] message to be sent to or received from a peer.
7320  *
7321  * Used in V1 channel establishment
7322  *
7323  * [`funding_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message
7324  */
7325 typedef struct MUST_USE_STRUCT LDKFundingSigned {
7326    /**
7327     * A pointer to the opaque Rust object.
7328     * Nearly everywhere, inner must be non-null, however in places where
7329     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7330     */
7331    LDKnativeFundingSigned *inner;
7332    /**
7333     * Indicates that this is the only struct which contains the same pointer.
7334     * Rust functions which take ownership of an object provided via an argument require
7335     * this to be true and invalidate the object pointed to by inner.
7336     */
7337    bool is_owned;
7338 } LDKFundingSigned;
7339
7340
7341
7342 /**
7343  * An stfu (quiescence) message to be sent by or received from the stfu initiator.
7344  */
7345 typedef struct MUST_USE_STRUCT LDKStfu {
7346    /**
7347     * A pointer to the opaque Rust object.
7348     * Nearly everywhere, inner must be non-null, however in places where
7349     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7350     */
7351    LDKnativeStfu *inner;
7352    /**
7353     * Indicates that this is the only struct which contains the same pointer.
7354     * Rust functions which take ownership of an object provided via an argument require
7355     * this to be true and invalidate the object pointed to by inner.
7356     */
7357    bool is_owned;
7358 } LDKStfu;
7359
7360
7361
7362 /**
7363  * A splice message to be sent by or received from the stfu initiator (splice initiator).
7364  */
7365 typedef struct MUST_USE_STRUCT LDKSplice {
7366    /**
7367     * A pointer to the opaque Rust object.
7368     * Nearly everywhere, inner must be non-null, however in places where
7369     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7370     */
7371    LDKnativeSplice *inner;
7372    /**
7373     * Indicates that this is the only struct which contains the same pointer.
7374     * Rust functions which take ownership of an object provided via an argument require
7375     * this to be true and invalidate the object pointed to by inner.
7376     */
7377    bool is_owned;
7378 } LDKSplice;
7379
7380
7381
7382 /**
7383  * A splice_ack message to be received by or sent to the splice initiator.
7384  *
7385  */
7386 typedef struct MUST_USE_STRUCT LDKSpliceAck {
7387    /**
7388     * A pointer to the opaque Rust object.
7389     * Nearly everywhere, inner must be non-null, however in places where
7390     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7391     */
7392    LDKnativeSpliceAck *inner;
7393    /**
7394     * Indicates that this is the only struct which contains the same pointer.
7395     * Rust functions which take ownership of an object provided via an argument require
7396     * this to be true and invalidate the object pointed to by inner.
7397     */
7398    bool is_owned;
7399 } LDKSpliceAck;
7400
7401
7402
7403 /**
7404  * A splice_locked message to be sent to or received from a peer.
7405  *
7406  */
7407 typedef struct MUST_USE_STRUCT LDKSpliceLocked {
7408    /**
7409     * A pointer to the opaque Rust object.
7410     * Nearly everywhere, inner must be non-null, however in places where
7411     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7412     */
7413    LDKnativeSpliceLocked *inner;
7414    /**
7415     * Indicates that this is the only struct which contains the same pointer.
7416     * Rust functions which take ownership of an object provided via an argument require
7417     * this to be true and invalidate the object pointed to by inner.
7418     */
7419    bool is_owned;
7420 } LDKSpliceLocked;
7421
7422
7423
7424 /**
7425  * A tx_add_input message for adding an input during interactive transaction construction
7426  *
7427  */
7428 typedef struct MUST_USE_STRUCT LDKTxAddInput {
7429    /**
7430     * A pointer to the opaque Rust object.
7431     * Nearly everywhere, inner must be non-null, however in places where
7432     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7433     */
7434    LDKnativeTxAddInput *inner;
7435    /**
7436     * Indicates that this is the only struct which contains the same pointer.
7437     * Rust functions which take ownership of an object provided via an argument require
7438     * this to be true and invalidate the object pointed to by inner.
7439     */
7440    bool is_owned;
7441 } LDKTxAddInput;
7442
7443
7444
7445 /**
7446  * A tx_add_output message for adding an output during interactive transaction construction.
7447  *
7448  */
7449 typedef struct MUST_USE_STRUCT LDKTxAddOutput {
7450    /**
7451     * A pointer to the opaque Rust object.
7452     * Nearly everywhere, inner must be non-null, however in places where
7453     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7454     */
7455    LDKnativeTxAddOutput *inner;
7456    /**
7457     * Indicates that this is the only struct which contains the same pointer.
7458     * Rust functions which take ownership of an object provided via an argument require
7459     * this to be true and invalidate the object pointed to by inner.
7460     */
7461    bool is_owned;
7462 } LDKTxAddOutput;
7463
7464
7465
7466 /**
7467  * A tx_remove_input message for removing an input during interactive transaction construction.
7468  *
7469  */
7470 typedef struct MUST_USE_STRUCT LDKTxRemoveInput {
7471    /**
7472     * A pointer to the opaque Rust object.
7473     * Nearly everywhere, inner must be non-null, however in places where
7474     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7475     */
7476    LDKnativeTxRemoveInput *inner;
7477    /**
7478     * Indicates that this is the only struct which contains the same pointer.
7479     * Rust functions which take ownership of an object provided via an argument require
7480     * this to be true and invalidate the object pointed to by inner.
7481     */
7482    bool is_owned;
7483 } LDKTxRemoveInput;
7484
7485
7486
7487 /**
7488  * A tx_remove_output message for removing an output during interactive transaction construction.
7489  *
7490  */
7491 typedef struct MUST_USE_STRUCT LDKTxRemoveOutput {
7492    /**
7493     * A pointer to the opaque Rust object.
7494     * Nearly everywhere, inner must be non-null, however in places where
7495     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7496     */
7497    LDKnativeTxRemoveOutput *inner;
7498    /**
7499     * Indicates that this is the only struct which contains the same pointer.
7500     * Rust functions which take ownership of an object provided via an argument require
7501     * this to be true and invalidate the object pointed to by inner.
7502     */
7503    bool is_owned;
7504 } LDKTxRemoveOutput;
7505
7506
7507
7508 /**
7509  * A tx_complete message signalling the conclusion of a peer's transaction contributions during
7510  * interactive transaction construction.
7511  *
7512  */
7513 typedef struct MUST_USE_STRUCT LDKTxComplete {
7514    /**
7515     * A pointer to the opaque Rust object.
7516     * Nearly everywhere, inner must be non-null, however in places where
7517     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7518     */
7519    LDKnativeTxComplete *inner;
7520    /**
7521     * Indicates that this is the only struct which contains the same pointer.
7522     * Rust functions which take ownership of an object provided via an argument require
7523     * this to be true and invalidate the object pointed to by inner.
7524     */
7525    bool is_owned;
7526 } LDKTxComplete;
7527
7528
7529
7530 /**
7531  * A tx_signatures message containing the sender's signatures for a transaction constructed with
7532  * interactive transaction construction.
7533  *
7534  */
7535 typedef struct MUST_USE_STRUCT LDKTxSignatures {
7536    /**
7537     * A pointer to the opaque Rust object.
7538     * Nearly everywhere, inner must be non-null, however in places where
7539     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7540     */
7541    LDKnativeTxSignatures *inner;
7542    /**
7543     * Indicates that this is the only struct which contains the same pointer.
7544     * Rust functions which take ownership of an object provided via an argument require
7545     * this to be true and invalidate the object pointed to by inner.
7546     */
7547    bool is_owned;
7548 } LDKTxSignatures;
7549
7550
7551
7552 /**
7553  * A tx_init_rbf message which initiates a replacement of the transaction after it's been
7554  * completed.
7555  *
7556  */
7557 typedef struct MUST_USE_STRUCT LDKTxInitRbf {
7558    /**
7559     * A pointer to the opaque Rust object.
7560     * Nearly everywhere, inner must be non-null, however in places where
7561     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7562     */
7563    LDKnativeTxInitRbf *inner;
7564    /**
7565     * Indicates that this is the only struct which contains the same pointer.
7566     * Rust functions which take ownership of an object provided via an argument require
7567     * this to be true and invalidate the object pointed to by inner.
7568     */
7569    bool is_owned;
7570 } LDKTxInitRbf;
7571
7572
7573
7574 /**
7575  * A tx_ack_rbf message which acknowledges replacement of the transaction after it's been
7576  * completed.
7577  *
7578  */
7579 typedef struct MUST_USE_STRUCT LDKTxAckRbf {
7580    /**
7581     * A pointer to the opaque Rust object.
7582     * Nearly everywhere, inner must be non-null, however in places where
7583     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7584     */
7585    LDKnativeTxAckRbf *inner;
7586    /**
7587     * Indicates that this is the only struct which contains the same pointer.
7588     * Rust functions which take ownership of an object provided via an argument require
7589     * this to be true and invalidate the object pointed to by inner.
7590     */
7591    bool is_owned;
7592 } LDKTxAckRbf;
7593
7594
7595
7596 /**
7597  * A tx_abort message which signals the cancellation of an in-progress transaction negotiation.
7598  *
7599  */
7600 typedef struct MUST_USE_STRUCT LDKTxAbort {
7601    /**
7602     * A pointer to the opaque Rust object.
7603     * Nearly everywhere, inner must be non-null, however in places where
7604     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7605     */
7606    LDKnativeTxAbort *inner;
7607    /**
7608     * Indicates that this is the only struct which contains the same pointer.
7609     * Rust functions which take ownership of an object provided via an argument require
7610     * this to be true and invalidate the object pointed to by inner.
7611     */
7612    bool is_owned;
7613 } LDKTxAbort;
7614
7615
7616
7617 /**
7618  * A [`channel_ready`] message to be sent to or received from a peer.
7619  *
7620  * [`channel_ready`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message
7621  */
7622 typedef struct MUST_USE_STRUCT LDKChannelReady {
7623    /**
7624     * A pointer to the opaque Rust object.
7625     * Nearly everywhere, inner must be non-null, however in places where
7626     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7627     */
7628    LDKnativeChannelReady *inner;
7629    /**
7630     * Indicates that this is the only struct which contains the same pointer.
7631     * Rust functions which take ownership of an object provided via an argument require
7632     * this to be true and invalidate the object pointed to by inner.
7633     */
7634    bool is_owned;
7635 } LDKChannelReady;
7636
7637
7638
7639 /**
7640  * An [`announcement_signatures`] message to be sent to or received from a peer.
7641  *
7642  * [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message
7643  */
7644 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
7645    /**
7646     * A pointer to the opaque Rust object.
7647     * Nearly everywhere, inner must be non-null, however in places where
7648     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7649     */
7650    LDKnativeAnnouncementSignatures *inner;
7651    /**
7652     * Indicates that this is the only struct which contains the same pointer.
7653     * Rust functions which take ownership of an object provided via an argument require
7654     * this to be true and invalidate the object pointed to by inner.
7655     */
7656    bool is_owned;
7657 } LDKAnnouncementSignatures;
7658
7659
7660
7661 /**
7662  * Struct used to return values from [`RevokeAndACK`] messages, containing a bunch of commitment
7663  * transaction updates if they were pending.
7664  */
7665 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
7666    /**
7667     * A pointer to the opaque Rust object.
7668     * Nearly everywhere, inner must be non-null, however in places where
7669     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7670     */
7671    LDKnativeCommitmentUpdate *inner;
7672    /**
7673     * Indicates that this is the only struct which contains the same pointer.
7674     * Rust functions which take ownership of an object provided via an argument require
7675     * this to be true and invalidate the object pointed to by inner.
7676     */
7677    bool is_owned;
7678 } LDKCommitmentUpdate;
7679
7680
7681
7682 /**
7683  * A [`revoke_and_ack`] message to be sent to or received from a peer.
7684  *
7685  * [`revoke_and_ack`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#completing-the-transition-to-the-updated-state-revoke_and_ack
7686  */
7687 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
7688    /**
7689     * A pointer to the opaque Rust object.
7690     * Nearly everywhere, inner must be non-null, however in places where
7691     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7692     */
7693    LDKnativeRevokeAndACK *inner;
7694    /**
7695     * Indicates that this is the only struct which contains the same pointer.
7696     * Rust functions which take ownership of an object provided via an argument require
7697     * this to be true and invalidate the object pointed to by inner.
7698     */
7699    bool is_owned;
7700 } LDKRevokeAndACK;
7701
7702
7703
7704 /**
7705  * A [`closing_signed`] message to be sent to or received from a peer.
7706  *
7707  * [`closing_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed
7708  */
7709 typedef struct MUST_USE_STRUCT LDKClosingSigned {
7710    /**
7711     * A pointer to the opaque Rust object.
7712     * Nearly everywhere, inner must be non-null, however in places where
7713     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7714     */
7715    LDKnativeClosingSigned *inner;
7716    /**
7717     * Indicates that this is the only struct which contains the same pointer.
7718     * Rust functions which take ownership of an object provided via an argument require
7719     * this to be true and invalidate the object pointed to by inner.
7720     */
7721    bool is_owned;
7722 } LDKClosingSigned;
7723
7724
7725
7726 /**
7727  * A [`shutdown`] message to be sent to or received from a peer.
7728  *
7729  * [`shutdown`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-initiation-shutdown
7730  */
7731 typedef struct MUST_USE_STRUCT LDKShutdown {
7732    /**
7733     * A pointer to the opaque Rust object.
7734     * Nearly everywhere, inner must be non-null, however in places where
7735     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7736     */
7737    LDKnativeShutdown *inner;
7738    /**
7739     * Indicates that this is the only struct which contains the same pointer.
7740     * Rust functions which take ownership of an object provided via an argument require
7741     * this to be true and invalidate the object pointed to by inner.
7742     */
7743    bool is_owned;
7744 } LDKShutdown;
7745
7746
7747
7748 /**
7749  * A [`channel_reestablish`] message to be sent to or received from a peer.
7750  *
7751  * [`channel_reestablish`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#message-retransmission
7752  */
7753 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
7754    /**
7755     * A pointer to the opaque Rust object.
7756     * Nearly everywhere, inner must be non-null, however in places where
7757     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7758     */
7759    LDKnativeChannelReestablish *inner;
7760    /**
7761     * Indicates that this is the only struct which contains the same pointer.
7762     * Rust functions which take ownership of an object provided via an argument require
7763     * this to be true and invalidate the object pointed to by inner.
7764     */
7765    bool is_owned;
7766 } LDKChannelReestablish;
7767
7768
7769
7770 /**
7771  * A [`node_announcement`] message to be sent to or received from a peer.
7772  *
7773  * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
7774  */
7775 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
7776    /**
7777     * A pointer to the opaque Rust object.
7778     * Nearly everywhere, inner must be non-null, however in places where
7779     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7780     */
7781    LDKnativeNodeAnnouncement *inner;
7782    /**
7783     * Indicates that this is the only struct which contains the same pointer.
7784     * Rust functions which take ownership of an object provided via an argument require
7785     * this to be true and invalidate the object pointed to by inner.
7786     */
7787    bool is_owned;
7788 } LDKNodeAnnouncement;
7789
7790
7791
7792 /**
7793  * An [`error`] message to be sent to or received from a peer.
7794  *
7795  * [`error`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
7796  */
7797 typedef struct MUST_USE_STRUCT LDKErrorMessage {
7798    /**
7799     * A pointer to the opaque Rust object.
7800     * Nearly everywhere, inner must be non-null, however in places where
7801     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7802     */
7803    LDKnativeErrorMessage *inner;
7804    /**
7805     * Indicates that this is the only struct which contains the same pointer.
7806     * Rust functions which take ownership of an object provided via an argument require
7807     * this to be true and invalidate the object pointed to by inner.
7808     */
7809    bool is_owned;
7810 } LDKErrorMessage;
7811
7812
7813
7814 /**
7815  * A [`warning`] message to be sent to or received from a peer.
7816  *
7817  * [`warning`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
7818  */
7819 typedef struct MUST_USE_STRUCT LDKWarningMessage {
7820    /**
7821     * A pointer to the opaque Rust object.
7822     * Nearly everywhere, inner must be non-null, however in places where
7823     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7824     */
7825    LDKnativeWarningMessage *inner;
7826    /**
7827     * Indicates that this is the only struct which contains the same pointer.
7828     * Rust functions which take ownership of an object provided via an argument require
7829     * this to be true and invalidate the object pointed to by inner.
7830     */
7831    bool is_owned;
7832 } LDKWarningMessage;
7833
7834 /**
7835  * Used to put an error message in a [`LightningError`].
7836  */
7837 typedef enum LDKErrorAction_Tag {
7838    /**
7839     * The peer took some action which made us think they were useless. Disconnect them.
7840     */
7841    LDKErrorAction_DisconnectPeer,
7842    /**
7843     * The peer did something incorrect. Tell them without closing any channels and disconnect them.
7844     */
7845    LDKErrorAction_DisconnectPeerWithWarning,
7846    /**
7847     * The peer did something harmless that we weren't able to process, just log and ignore
7848     */
7849    LDKErrorAction_IgnoreError,
7850    /**
7851     * The peer did something harmless that we weren't able to meaningfully process.
7852     * If the error is logged, log it at the given level.
7853     */
7854    LDKErrorAction_IgnoreAndLog,
7855    /**
7856     * The peer provided us with a gossip message which we'd already seen. In most cases this
7857     * should be ignored, but it may result in the message being forwarded if it is a duplicate of
7858     * our own channel announcements.
7859     */
7860    LDKErrorAction_IgnoreDuplicateGossip,
7861    /**
7862     * The peer did something incorrect. Tell them.
7863     */
7864    LDKErrorAction_SendErrorMessage,
7865    /**
7866     * The peer did something incorrect. Tell them without closing any channels.
7867     */
7868    LDKErrorAction_SendWarningMessage,
7869    /**
7870     * Must be last for serialization purposes
7871     */
7872    LDKErrorAction_Sentinel,
7873 } LDKErrorAction_Tag;
7874
7875 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
7876    /**
7877     * An error message which we should make an effort to send before we disconnect.
7878     *
7879     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
7880     */
7881    struct LDKErrorMessage msg;
7882 } LDKErrorAction_LDKDisconnectPeer_Body;
7883
7884 typedef struct LDKErrorAction_LDKDisconnectPeerWithWarning_Body {
7885    /**
7886     * A warning message which we should make an effort to send before we disconnect.
7887     */
7888    struct LDKWarningMessage msg;
7889 } LDKErrorAction_LDKDisconnectPeerWithWarning_Body;
7890
7891 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
7892    /**
7893     * The message to send.
7894     */
7895    struct LDKErrorMessage msg;
7896 } LDKErrorAction_LDKSendErrorMessage_Body;
7897
7898 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
7899    /**
7900     * The message to send.
7901     */
7902    struct LDKWarningMessage msg;
7903    /**
7904     * The peer may have done something harmless that we weren't able to meaningfully process,
7905     * though we should still tell them about it.
7906     * If this event is logged, log it at the given level.
7907     */
7908    enum LDKLevel log_level;
7909 } LDKErrorAction_LDKSendWarningMessage_Body;
7910
7911 typedef struct MUST_USE_STRUCT LDKErrorAction {
7912    LDKErrorAction_Tag tag;
7913    union {
7914       LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
7915       LDKErrorAction_LDKDisconnectPeerWithWarning_Body disconnect_peer_with_warning;
7916       struct {
7917          enum LDKLevel ignore_and_log;
7918       };
7919       LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
7920       LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
7921    };
7922 } LDKErrorAction;
7923
7924
7925
7926 /**
7927  * A [`query_channel_range`] message is used to query a peer for channel
7928  * UTXOs in a range of blocks. The recipient of a query makes a best
7929  * effort to reply to the query using one or more [`ReplyChannelRange`]
7930  * messages.
7931  *
7932  * [`query_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
7933  */
7934 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
7935    /**
7936     * A pointer to the opaque Rust object.
7937     * Nearly everywhere, inner must be non-null, however in places where
7938     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7939     */
7940    LDKnativeQueryChannelRange *inner;
7941    /**
7942     * Indicates that this is the only struct which contains the same pointer.
7943     * Rust functions which take ownership of an object provided via an argument require
7944     * this to be true and invalidate the object pointed to by inner.
7945     */
7946    bool is_owned;
7947 } LDKQueryChannelRange;
7948
7949
7950
7951 /**
7952  * A [`query_short_channel_ids`] message is used to query a peer for
7953  * routing gossip messages related to one or more `short_channel_id`s.
7954  *
7955  * The query recipient will reply with the latest, if available,
7956  * [`ChannelAnnouncement`], [`ChannelUpdate`] and [`NodeAnnouncement`] messages
7957  * it maintains for the requested `short_channel_id`s followed by a
7958  * [`ReplyShortChannelIdsEnd`] message. The `short_channel_id`s sent in
7959  * this query are encoded. We only support `encoding_type=0` uncompressed
7960  * serialization and do not support `encoding_type=1` zlib serialization.
7961  *
7962  * [`query_short_channel_ids`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_short_channel_idsreply_short_channel_ids_end-messages
7963  */
7964 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
7965    /**
7966     * A pointer to the opaque Rust object.
7967     * Nearly everywhere, inner must be non-null, however in places where
7968     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7969     */
7970    LDKnativeQueryShortChannelIds *inner;
7971    /**
7972     * Indicates that this is the only struct which contains the same pointer.
7973     * Rust functions which take ownership of an object provided via an argument require
7974     * this to be true and invalidate the object pointed to by inner.
7975     */
7976    bool is_owned;
7977 } LDKQueryShortChannelIds;
7978
7979
7980
7981 /**
7982  * A [`reply_channel_range`] message is a reply to a [`QueryChannelRange`]
7983  * message.
7984  *
7985  * Multiple `reply_channel_range` messages can be sent in reply
7986  * to a single [`QueryChannelRange`] message. The query recipient makes a
7987  * best effort to respond based on their local network view which may
7988  * not be a perfect view of the network. The `short_channel_id`s in the
7989  * reply are encoded. We only support `encoding_type=0` uncompressed
7990  * serialization and do not support `encoding_type=1` zlib serialization.
7991  *
7992  * [`reply_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
7993  */
7994 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
7995    /**
7996     * A pointer to the opaque Rust object.
7997     * Nearly everywhere, inner must be non-null, however in places where
7998     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7999     */
8000    LDKnativeReplyChannelRange *inner;
8001    /**
8002     * Indicates that this is the only struct which contains the same pointer.
8003     * Rust functions which take ownership of an object provided via an argument require
8004     * this to be true and invalidate the object pointed to by inner.
8005     */
8006    bool is_owned;
8007 } LDKReplyChannelRange;
8008
8009
8010
8011 /**
8012  * A [`gossip_timestamp_filter`] message is used by a node to request
8013  * gossip relay for messages in the requested time range when the
8014  * `gossip_queries` feature has been negotiated.
8015  *
8016  * [`gossip_timestamp_filter`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-gossip_timestamp_filter-message
8017  */
8018 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
8019    /**
8020     * A pointer to the opaque Rust object.
8021     * Nearly everywhere, inner must be non-null, however in places where
8022     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8023     */
8024    LDKnativeGossipTimestampFilter *inner;
8025    /**
8026     * Indicates that this is the only struct which contains the same pointer.
8027     * Rust functions which take ownership of an object provided via an argument require
8028     * this to be true and invalidate the object pointed to by inner.
8029     */
8030    bool is_owned;
8031 } LDKGossipTimestampFilter;
8032
8033 /**
8034  * An event generated by ChannelManager which indicates a message should be sent to a peer (or
8035  * broadcast to most peers).
8036  * These events are handled by PeerManager::process_events if you are using a PeerManager.
8037  */
8038 typedef enum LDKMessageSendEvent_Tag {
8039    /**
8040     * Used to indicate that we've accepted a channel open and should send the accept_channel
8041     * message provided to the given peer.
8042     */
8043    LDKMessageSendEvent_SendAcceptChannel,
8044    /**
8045     * Used to indicate that we've accepted a V2 channel open and should send the accept_channel2
8046     * message provided to the given peer.
8047     */
8048    LDKMessageSendEvent_SendAcceptChannelV2,
8049    /**
8050     * Used to indicate that we've initiated a channel open and should send the open_channel
8051     * message provided to the given peer.
8052     */
8053    LDKMessageSendEvent_SendOpenChannel,
8054    /**
8055     * Used to indicate that we've initiated a V2 channel open and should send the open_channel2
8056     * message provided to the given peer.
8057     */
8058    LDKMessageSendEvent_SendOpenChannelV2,
8059    /**
8060     * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
8061     */
8062    LDKMessageSendEvent_SendFundingCreated,
8063    /**
8064     * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
8065     */
8066    LDKMessageSendEvent_SendFundingSigned,
8067    /**
8068     * Used to indicate that a stfu message should be sent to the peer with the given node id.
8069     */
8070    LDKMessageSendEvent_SendStfu,
8071    /**
8072     * Used to indicate that a splice message should be sent to the peer with the given node id.
8073     */
8074    LDKMessageSendEvent_SendSplice,
8075    /**
8076     * Used to indicate that a splice_ack message should be sent to the peer with the given node id.
8077     */
8078    LDKMessageSendEvent_SendSpliceAck,
8079    /**
8080     * Used to indicate that a splice_locked message should be sent to the peer with the given node id.
8081     */
8082    LDKMessageSendEvent_SendSpliceLocked,
8083    /**
8084     * Used to indicate that a tx_add_input message should be sent to the peer with the given node_id.
8085     */
8086    LDKMessageSendEvent_SendTxAddInput,
8087    /**
8088     * Used to indicate that a tx_add_output message should be sent to the peer with the given node_id.
8089     */
8090    LDKMessageSendEvent_SendTxAddOutput,
8091    /**
8092     * Used to indicate that a tx_remove_input message should be sent to the peer with the given node_id.
8093     */
8094    LDKMessageSendEvent_SendTxRemoveInput,
8095    /**
8096     * Used to indicate that a tx_remove_output message should be sent to the peer with the given node_id.
8097     */
8098    LDKMessageSendEvent_SendTxRemoveOutput,
8099    /**
8100     * Used to indicate that a tx_complete message should be sent to the peer with the given node_id.
8101     */
8102    LDKMessageSendEvent_SendTxComplete,
8103    /**
8104     * Used to indicate that a tx_signatures message should be sent to the peer with the given node_id.
8105     */
8106    LDKMessageSendEvent_SendTxSignatures,
8107    /**
8108     * Used to indicate that a tx_init_rbf message should be sent to the peer with the given node_id.
8109     */
8110    LDKMessageSendEvent_SendTxInitRbf,
8111    /**
8112     * Used to indicate that a tx_ack_rbf message should be sent to the peer with the given node_id.
8113     */
8114    LDKMessageSendEvent_SendTxAckRbf,
8115    /**
8116     * Used to indicate that a tx_abort message should be sent to the peer with the given node_id.
8117     */
8118    LDKMessageSendEvent_SendTxAbort,
8119    /**
8120     * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
8121     */
8122    LDKMessageSendEvent_SendChannelReady,
8123    /**
8124     * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
8125     */
8126    LDKMessageSendEvent_SendAnnouncementSignatures,
8127    /**
8128     * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
8129     * message should be sent to the peer with the given node_id.
8130     */
8131    LDKMessageSendEvent_UpdateHTLCs,
8132    /**
8133     * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
8134     */
8135    LDKMessageSendEvent_SendRevokeAndACK,
8136    /**
8137     * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
8138     */
8139    LDKMessageSendEvent_SendClosingSigned,
8140    /**
8141     * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
8142     */
8143    LDKMessageSendEvent_SendShutdown,
8144    /**
8145     * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
8146     */
8147    LDKMessageSendEvent_SendChannelReestablish,
8148    /**
8149     * Used to send a channel_announcement and channel_update to a specific peer, likely on
8150     * initial connection to ensure our peers know about our channels.
8151     */
8152    LDKMessageSendEvent_SendChannelAnnouncement,
8153    /**
8154     * Used to indicate that a channel_announcement and channel_update should be broadcast to all
8155     * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
8156     *
8157     * Note that after doing so, you very likely (unless you did so very recently) want to
8158     * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
8159     * ensures that any nodes which see our channel_announcement also have a relevant
8160     * node_announcement, including relevant feature flags which may be important for routing
8161     * through or to us.
8162     *
8163     * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
8164     */
8165    LDKMessageSendEvent_BroadcastChannelAnnouncement,
8166    /**
8167     * Used to indicate that a channel_update should be broadcast to all peers.
8168     */
8169    LDKMessageSendEvent_BroadcastChannelUpdate,
8170    /**
8171     * Used to indicate that a node_announcement should be broadcast to all peers.
8172     */
8173    LDKMessageSendEvent_BroadcastNodeAnnouncement,
8174    /**
8175     * Used to indicate that a channel_update should be sent to a single peer.
8176     * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
8177     * private channel and we shouldn't be informing all of our peers of channel parameters.
8178     */
8179    LDKMessageSendEvent_SendChannelUpdate,
8180    /**
8181     * Broadcast an error downstream to be handled
8182     */
8183    LDKMessageSendEvent_HandleError,
8184    /**
8185     * Query a peer for channels with funding transaction UTXOs in a block range.
8186     */
8187    LDKMessageSendEvent_SendChannelRangeQuery,
8188    /**
8189     * Request routing gossip messages from a peer for a list of channels identified by
8190     * their short_channel_ids.
8191     */
8192    LDKMessageSendEvent_SendShortIdsQuery,
8193    /**
8194     * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
8195     * emitted during processing of the query.
8196     */
8197    LDKMessageSendEvent_SendReplyChannelRange,
8198    /**
8199     * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
8200     * enable receiving gossip messages from the peer.
8201     */
8202    LDKMessageSendEvent_SendGossipTimestampFilter,
8203    /**
8204     * Must be last for serialization purposes
8205     */
8206    LDKMessageSendEvent_Sentinel,
8207 } LDKMessageSendEvent_Tag;
8208
8209 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
8210    /**
8211     * The node_id of the node which should receive this message
8212     */
8213    struct LDKPublicKey node_id;
8214    /**
8215     * The message which should be sent.
8216     */
8217    struct LDKAcceptChannel msg;
8218 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
8219
8220 typedef struct LDKMessageSendEvent_LDKSendAcceptChannelV2_Body {
8221    /**
8222     * The node_id of the node which should receive this message
8223     */
8224    struct LDKPublicKey node_id;
8225    /**
8226     * The message which should be sent.
8227     */
8228    struct LDKAcceptChannelV2 msg;
8229 } LDKMessageSendEvent_LDKSendAcceptChannelV2_Body;
8230
8231 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
8232    /**
8233     * The node_id of the node which should receive this message
8234     */
8235    struct LDKPublicKey node_id;
8236    /**
8237     * The message which should be sent.
8238     */
8239    struct LDKOpenChannel msg;
8240 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
8241
8242 typedef struct LDKMessageSendEvent_LDKSendOpenChannelV2_Body {
8243    /**
8244     * The node_id of the node which should receive this message
8245     */
8246    struct LDKPublicKey node_id;
8247    /**
8248     * The message which should be sent.
8249     */
8250    struct LDKOpenChannelV2 msg;
8251 } LDKMessageSendEvent_LDKSendOpenChannelV2_Body;
8252
8253 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
8254    /**
8255     * The node_id of the node which should receive this message
8256     */
8257    struct LDKPublicKey node_id;
8258    /**
8259     * The message which should be sent.
8260     */
8261    struct LDKFundingCreated msg;
8262 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
8263
8264 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
8265    /**
8266     * The node_id of the node which should receive this message
8267     */
8268    struct LDKPublicKey node_id;
8269    /**
8270     * The message which should be sent.
8271     */
8272    struct LDKFundingSigned msg;
8273 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
8274
8275 typedef struct LDKMessageSendEvent_LDKSendStfu_Body {
8276    /**
8277     * The node_id of the node which should receive this message
8278     */
8279    struct LDKPublicKey node_id;
8280    /**
8281     * The message which should be sent.
8282     */
8283    struct LDKStfu msg;
8284 } LDKMessageSendEvent_LDKSendStfu_Body;
8285
8286 typedef struct LDKMessageSendEvent_LDKSendSplice_Body {
8287    /**
8288     * The node_id of the node which should receive this message
8289     */
8290    struct LDKPublicKey node_id;
8291    /**
8292     * The message which should be sent.
8293     */
8294    struct LDKSplice msg;
8295 } LDKMessageSendEvent_LDKSendSplice_Body;
8296
8297 typedef struct LDKMessageSendEvent_LDKSendSpliceAck_Body {
8298    /**
8299     * The node_id of the node which should receive this message
8300     */
8301    struct LDKPublicKey node_id;
8302    /**
8303     * The message which should be sent.
8304     */
8305    struct LDKSpliceAck msg;
8306 } LDKMessageSendEvent_LDKSendSpliceAck_Body;
8307
8308 typedef struct LDKMessageSendEvent_LDKSendSpliceLocked_Body {
8309    /**
8310     * The node_id of the node which should receive this message
8311     */
8312    struct LDKPublicKey node_id;
8313    /**
8314     * The message which should be sent.
8315     */
8316    struct LDKSpliceLocked msg;
8317 } LDKMessageSendEvent_LDKSendSpliceLocked_Body;
8318
8319 typedef struct LDKMessageSendEvent_LDKSendTxAddInput_Body {
8320    /**
8321     * The node_id of the node which should receive this message
8322     */
8323    struct LDKPublicKey node_id;
8324    /**
8325     * The message which should be sent.
8326     */
8327    struct LDKTxAddInput msg;
8328 } LDKMessageSendEvent_LDKSendTxAddInput_Body;
8329
8330 typedef struct LDKMessageSendEvent_LDKSendTxAddOutput_Body {
8331    /**
8332     * The node_id of the node which should receive this message
8333     */
8334    struct LDKPublicKey node_id;
8335    /**
8336     * The message which should be sent.
8337     */
8338    struct LDKTxAddOutput msg;
8339 } LDKMessageSendEvent_LDKSendTxAddOutput_Body;
8340
8341 typedef struct LDKMessageSendEvent_LDKSendTxRemoveInput_Body {
8342    /**
8343     * The node_id of the node which should receive this message
8344     */
8345    struct LDKPublicKey node_id;
8346    /**
8347     * The message which should be sent.
8348     */
8349    struct LDKTxRemoveInput msg;
8350 } LDKMessageSendEvent_LDKSendTxRemoveInput_Body;
8351
8352 typedef struct LDKMessageSendEvent_LDKSendTxRemoveOutput_Body {
8353    /**
8354     * The node_id of the node which should receive this message
8355     */
8356    struct LDKPublicKey node_id;
8357    /**
8358     * The message which should be sent.
8359     */
8360    struct LDKTxRemoveOutput msg;
8361 } LDKMessageSendEvent_LDKSendTxRemoveOutput_Body;
8362
8363 typedef struct LDKMessageSendEvent_LDKSendTxComplete_Body {
8364    /**
8365     * The node_id of the node which should receive this message
8366     */
8367    struct LDKPublicKey node_id;
8368    /**
8369     * The message which should be sent.
8370     */
8371    struct LDKTxComplete msg;
8372 } LDKMessageSendEvent_LDKSendTxComplete_Body;
8373
8374 typedef struct LDKMessageSendEvent_LDKSendTxSignatures_Body {
8375    /**
8376     * The node_id of the node which should receive this message
8377     */
8378    struct LDKPublicKey node_id;
8379    /**
8380     * The message which should be sent.
8381     */
8382    struct LDKTxSignatures msg;
8383 } LDKMessageSendEvent_LDKSendTxSignatures_Body;
8384
8385 typedef struct LDKMessageSendEvent_LDKSendTxInitRbf_Body {
8386    /**
8387     * The node_id of the node which should receive this message
8388     */
8389    struct LDKPublicKey node_id;
8390    /**
8391     * The message which should be sent.
8392     */
8393    struct LDKTxInitRbf msg;
8394 } LDKMessageSendEvent_LDKSendTxInitRbf_Body;
8395
8396 typedef struct LDKMessageSendEvent_LDKSendTxAckRbf_Body {
8397    /**
8398     * The node_id of the node which should receive this message
8399     */
8400    struct LDKPublicKey node_id;
8401    /**
8402     * The message which should be sent.
8403     */
8404    struct LDKTxAckRbf msg;
8405 } LDKMessageSendEvent_LDKSendTxAckRbf_Body;
8406
8407 typedef struct LDKMessageSendEvent_LDKSendTxAbort_Body {
8408    /**
8409     * The node_id of the node which should receive this message
8410     */
8411    struct LDKPublicKey node_id;
8412    /**
8413     * The message which should be sent.
8414     */
8415    struct LDKTxAbort msg;
8416 } LDKMessageSendEvent_LDKSendTxAbort_Body;
8417
8418 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
8419    /**
8420     * The node_id of the node which should receive these message(s)
8421     */
8422    struct LDKPublicKey node_id;
8423    /**
8424     * The channel_ready message which should be sent.
8425     */
8426    struct LDKChannelReady msg;
8427 } LDKMessageSendEvent_LDKSendChannelReady_Body;
8428
8429 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
8430    /**
8431     * The node_id of the node which should receive these message(s)
8432     */
8433    struct LDKPublicKey node_id;
8434    /**
8435     * The announcement_signatures message which should be sent.
8436     */
8437    struct LDKAnnouncementSignatures msg;
8438 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
8439
8440 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
8441    /**
8442     * The node_id of the node which should receive these message(s)
8443     */
8444    struct LDKPublicKey node_id;
8445    /**
8446     * The update messages which should be sent. ALL messages in the struct should be sent!
8447     */
8448    struct LDKCommitmentUpdate updates;
8449 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
8450
8451 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
8452    /**
8453     * The node_id of the node which should receive this message
8454     */
8455    struct LDKPublicKey node_id;
8456    /**
8457     * The message which should be sent.
8458     */
8459    struct LDKRevokeAndACK msg;
8460 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
8461
8462 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
8463    /**
8464     * The node_id of the node which should receive this message
8465     */
8466    struct LDKPublicKey node_id;
8467    /**
8468     * The message which should be sent.
8469     */
8470    struct LDKClosingSigned msg;
8471 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
8472
8473 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
8474    /**
8475     * The node_id of the node which should receive this message
8476     */
8477    struct LDKPublicKey node_id;
8478    /**
8479     * The message which should be sent.
8480     */
8481    struct LDKShutdown msg;
8482 } LDKMessageSendEvent_LDKSendShutdown_Body;
8483
8484 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
8485    /**
8486     * The node_id of the node which should receive this message
8487     */
8488    struct LDKPublicKey node_id;
8489    /**
8490     * The message which should be sent.
8491     */
8492    struct LDKChannelReestablish msg;
8493 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
8494
8495 typedef struct LDKMessageSendEvent_LDKSendChannelAnnouncement_Body {
8496    /**
8497     * The node_id of the node which should receive this message
8498     */
8499    struct LDKPublicKey node_id;
8500    /**
8501     * The channel_announcement which should be sent.
8502     */
8503    struct LDKChannelAnnouncement msg;
8504    /**
8505     * The followup channel_update which should be sent.
8506     */
8507    struct LDKChannelUpdate update_msg;
8508 } LDKMessageSendEvent_LDKSendChannelAnnouncement_Body;
8509
8510 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
8511    /**
8512     * The channel_announcement which should be sent.
8513     */
8514    struct LDKChannelAnnouncement msg;
8515    /**
8516     * The followup channel_update which should be sent.
8517     *
8518     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
8519     */
8520    struct LDKChannelUpdate update_msg;
8521 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
8522
8523 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
8524    /**
8525     * The channel_update which should be sent.
8526     */
8527    struct LDKChannelUpdate msg;
8528 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
8529
8530 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
8531    /**
8532     * The node_announcement which should be sent.
8533     */
8534    struct LDKNodeAnnouncement msg;
8535 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
8536
8537 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
8538    /**
8539     * The node_id of the node which should receive this message
8540     */
8541    struct LDKPublicKey node_id;
8542    /**
8543     * The channel_update which should be sent.
8544     */
8545    struct LDKChannelUpdate msg;
8546 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
8547
8548 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
8549    /**
8550     * The node_id of the node which should receive this message
8551     */
8552    struct LDKPublicKey node_id;
8553    /**
8554     * The action which should be taken.
8555     */
8556    struct LDKErrorAction action;
8557 } LDKMessageSendEvent_LDKHandleError_Body;
8558
8559 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
8560    /**
8561     * The node_id of this message recipient
8562     */
8563    struct LDKPublicKey node_id;
8564    /**
8565     * The query_channel_range which should be sent.
8566     */
8567    struct LDKQueryChannelRange msg;
8568 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
8569
8570 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
8571    /**
8572     * The node_id of this message recipient
8573     */
8574    struct LDKPublicKey node_id;
8575    /**
8576     * The query_short_channel_ids which should be sent.
8577     */
8578    struct LDKQueryShortChannelIds msg;
8579 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
8580
8581 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
8582    /**
8583     * The node_id of this message recipient
8584     */
8585    struct LDKPublicKey node_id;
8586    /**
8587     * The reply_channel_range which should be sent.
8588     */
8589    struct LDKReplyChannelRange msg;
8590 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
8591
8592 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
8593    /**
8594     * The node_id of this message recipient
8595     */
8596    struct LDKPublicKey node_id;
8597    /**
8598     * The gossip_timestamp_filter which should be sent.
8599     */
8600    struct LDKGossipTimestampFilter msg;
8601 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
8602
8603 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
8604    LDKMessageSendEvent_Tag tag;
8605    union {
8606       LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
8607       LDKMessageSendEvent_LDKSendAcceptChannelV2_Body send_accept_channel_v2;
8608       LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
8609       LDKMessageSendEvent_LDKSendOpenChannelV2_Body send_open_channel_v2;
8610       LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
8611       LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
8612       LDKMessageSendEvent_LDKSendStfu_Body send_stfu;
8613       LDKMessageSendEvent_LDKSendSplice_Body send_splice;
8614       LDKMessageSendEvent_LDKSendSpliceAck_Body send_splice_ack;
8615       LDKMessageSendEvent_LDKSendSpliceLocked_Body send_splice_locked;
8616       LDKMessageSendEvent_LDKSendTxAddInput_Body send_tx_add_input;
8617       LDKMessageSendEvent_LDKSendTxAddOutput_Body send_tx_add_output;
8618       LDKMessageSendEvent_LDKSendTxRemoveInput_Body send_tx_remove_input;
8619       LDKMessageSendEvent_LDKSendTxRemoveOutput_Body send_tx_remove_output;
8620       LDKMessageSendEvent_LDKSendTxComplete_Body send_tx_complete;
8621       LDKMessageSendEvent_LDKSendTxSignatures_Body send_tx_signatures;
8622       LDKMessageSendEvent_LDKSendTxInitRbf_Body send_tx_init_rbf;
8623       LDKMessageSendEvent_LDKSendTxAckRbf_Body send_tx_ack_rbf;
8624       LDKMessageSendEvent_LDKSendTxAbort_Body send_tx_abort;
8625       LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
8626       LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
8627       LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
8628       LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
8629       LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
8630       LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
8631       LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
8632       LDKMessageSendEvent_LDKSendChannelAnnouncement_Body send_channel_announcement;
8633       LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
8634       LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
8635       LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
8636       LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
8637       LDKMessageSendEvent_LDKHandleError_Body handle_error;
8638       LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
8639       LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
8640       LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
8641       LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
8642    };
8643 } LDKMessageSendEvent;
8644
8645 /**
8646  * A dynamically-allocated array of crate::lightning::events::MessageSendEvents of arbitrary size.
8647  * This corresponds to std::vector in C++
8648  */
8649 typedef struct LDKCVec_MessageSendEventZ {
8650    /**
8651     * The elements in the array.
8652     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8653     */
8654    struct LDKMessageSendEvent *data;
8655    /**
8656     * The number of elements pointed to by `data`.
8657     */
8658    uintptr_t datalen;
8659 } LDKCVec_MessageSendEventZ;
8660
8661
8662
8663 /**
8664  * Details about one direction of a channel as received within a [`ChannelUpdate`].
8665  */
8666 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
8667    /**
8668     * A pointer to the opaque Rust object.
8669     * Nearly everywhere, inner must be non-null, however in places where
8670     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8671     */
8672    LDKnativeChannelUpdateInfo *inner;
8673    /**
8674     * Indicates that this is the only struct which contains the same pointer.
8675     * Rust functions which take ownership of an object provided via an argument require
8676     * this to be true and invalidate the object pointed to by inner.
8677     */
8678    bool is_owned;
8679 } LDKChannelUpdateInfo;
8680
8681 /**
8682  * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
8683  */
8684 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
8685    /**
8686     * A pointer to the contents in the success state.
8687     * Reading from this pointer when `result_ok` is not set is undefined.
8688     */
8689    struct LDKChannelUpdateInfo *result;
8690    /**
8691     * A pointer to the contents in the error state.
8692     * Reading from this pointer when `result_ok` is set is undefined.
8693     */
8694    struct LDKDecodeError *err;
8695 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
8696
8697 /**
8698  * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
8699  * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8700  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8701  */
8702 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
8703    /**
8704     * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
8705     * `err` or `result` depending on the state of `result_ok`.
8706     */
8707    union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
8708    /**
8709     * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
8710     */
8711    bool result_ok;
8712 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
8713
8714
8715
8716 /**
8717  * Details about a channel (both directions).
8718  * Received within a channel announcement.
8719  */
8720 typedef struct MUST_USE_STRUCT LDKChannelInfo {
8721    /**
8722     * A pointer to the opaque Rust object.
8723     * Nearly everywhere, inner must be non-null, however in places where
8724     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8725     */
8726    LDKnativeChannelInfo *inner;
8727    /**
8728     * Indicates that this is the only struct which contains the same pointer.
8729     * Rust functions which take ownership of an object provided via an argument require
8730     * this to be true and invalidate the object pointed to by inner.
8731     */
8732    bool is_owned;
8733 } LDKChannelInfo;
8734
8735 /**
8736  * The contents of CResult_ChannelInfoDecodeErrorZ
8737  */
8738 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
8739    /**
8740     * A pointer to the contents in the success state.
8741     * Reading from this pointer when `result_ok` is not set is undefined.
8742     */
8743    struct LDKChannelInfo *result;
8744    /**
8745     * A pointer to the contents in the error state.
8746     * Reading from this pointer when `result_ok` is set is undefined.
8747     */
8748    struct LDKDecodeError *err;
8749 } LDKCResult_ChannelInfoDecodeErrorZPtr;
8750
8751 /**
8752  * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
8753  * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8754  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8755  */
8756 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
8757    /**
8758     * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
8759     * `err` or `result` depending on the state of `result_ok`.
8760     */
8761    union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
8762    /**
8763     * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
8764     */
8765    bool result_ok;
8766 } LDKCResult_ChannelInfoDecodeErrorZ;
8767
8768
8769
8770 /**
8771  * Fees for routing via a given channel or a node
8772  */
8773 typedef struct MUST_USE_STRUCT LDKRoutingFees {
8774    /**
8775     * A pointer to the opaque Rust object.
8776     * Nearly everywhere, inner must be non-null, however in places where
8777     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8778     */
8779    LDKnativeRoutingFees *inner;
8780    /**
8781     * Indicates that this is the only struct which contains the same pointer.
8782     * Rust functions which take ownership of an object provided via an argument require
8783     * this to be true and invalidate the object pointed to by inner.
8784     */
8785    bool is_owned;
8786 } LDKRoutingFees;
8787
8788 /**
8789  * The contents of CResult_RoutingFeesDecodeErrorZ
8790  */
8791 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
8792    /**
8793     * A pointer to the contents in the success state.
8794     * Reading from this pointer when `result_ok` is not set is undefined.
8795     */
8796    struct LDKRoutingFees *result;
8797    /**
8798     * A pointer to the contents in the error state.
8799     * Reading from this pointer when `result_ok` is set is undefined.
8800     */
8801    struct LDKDecodeError *err;
8802 } LDKCResult_RoutingFeesDecodeErrorZPtr;
8803
8804 /**
8805  * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
8806  * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
8807  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8808  */
8809 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
8810    /**
8811     * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
8812     * `err` or `result` depending on the state of `result_ok`.
8813     */
8814    union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
8815    /**
8816     * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
8817     */
8818    bool result_ok;
8819 } LDKCResult_RoutingFeesDecodeErrorZ;
8820
8821 /**
8822  * A 4-byte byte array.
8823  */
8824 typedef struct LDKFourBytes {
8825    /**
8826     * The four bytes
8827     */
8828    uint8_t data[4];
8829 } LDKFourBytes;
8830
8831 /**
8832  * A 12-byte byte array.
8833  */
8834 typedef struct LDKTwelveBytes {
8835    /**
8836     * The twelve bytes
8837     */
8838    uint8_t data[12];
8839 } LDKTwelveBytes;
8840
8841
8842
8843 /**
8844  * Represents a hostname for serialization purposes.
8845  * Only the character set and length will be validated.
8846  * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
8847  * Its length is guaranteed to be representable by a single byte.
8848  * This serialization is used by [`BOLT 7`] hostnames.
8849  *
8850  * [`BOLT 7`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md
8851  */
8852 typedef struct MUST_USE_STRUCT LDKHostname {
8853    /**
8854     * A pointer to the opaque Rust object.
8855     * Nearly everywhere, inner must be non-null, however in places where
8856     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8857     */
8858    LDKnativeHostname *inner;
8859    /**
8860     * Indicates that this is the only struct which contains the same pointer.
8861     * Rust functions which take ownership of an object provided via an argument require
8862     * this to be true and invalidate the object pointed to by inner.
8863     */
8864    bool is_owned;
8865 } LDKHostname;
8866
8867 /**
8868  * An address which can be used to connect to a remote peer.
8869  */
8870 typedef enum LDKSocketAddress_Tag {
8871    /**
8872     * An IPv4 address and port on which the peer is listening.
8873     */
8874    LDKSocketAddress_TcpIpV4,
8875    /**
8876     * An IPv6 address and port on which the peer is listening.
8877     */
8878    LDKSocketAddress_TcpIpV6,
8879    /**
8880     * An old-style Tor onion address/port on which the peer is listening.
8881     *
8882     * This field is deprecated and the Tor network generally no longer supports V2 Onion
8883     * addresses. Thus, the details are not parsed here.
8884     */
8885    LDKSocketAddress_OnionV2,
8886    /**
8887     * A new-style Tor onion address/port on which the peer is listening.
8888     *
8889     * To create the human-readable \"hostname\", concatenate the ED25519 pubkey, checksum, and version,
8890     * wrap as base32 and append \".onion\".
8891     */
8892    LDKSocketAddress_OnionV3,
8893    /**
8894     * A hostname/port on which the peer is listening.
8895     */
8896    LDKSocketAddress_Hostname,
8897    /**
8898     * Must be last for serialization purposes
8899     */
8900    LDKSocketAddress_Sentinel,
8901 } LDKSocketAddress_Tag;
8902
8903 typedef struct LDKSocketAddress_LDKTcpIpV4_Body {
8904    /**
8905     * The 4-byte IPv4 address
8906     */
8907    struct LDKFourBytes addr;
8908    /**
8909     * The port on which the node is listening
8910     */
8911    uint16_t port;
8912 } LDKSocketAddress_LDKTcpIpV4_Body;
8913
8914 typedef struct LDKSocketAddress_LDKTcpIpV6_Body {
8915    /**
8916     * The 16-byte IPv6 address
8917     */
8918    struct LDKSixteenBytes addr;
8919    /**
8920     * The port on which the node is listening
8921     */
8922    uint16_t port;
8923 } LDKSocketAddress_LDKTcpIpV6_Body;
8924
8925 typedef struct LDKSocketAddress_LDKOnionV3_Body {
8926    /**
8927     * The ed25519 long-term public key of the peer
8928     */
8929    struct LDKThirtyTwoBytes ed25519_pubkey;
8930    /**
8931     * The checksum of the pubkey and version, as included in the onion address
8932     */
8933    uint16_t checksum;
8934    /**
8935     * The version byte, as defined by the Tor Onion v3 spec.
8936     */
8937    uint8_t version;
8938    /**
8939     * The port on which the node is listening
8940     */
8941    uint16_t port;
8942 } LDKSocketAddress_LDKOnionV3_Body;
8943
8944 typedef struct LDKSocketAddress_LDKHostname_Body {
8945    /**
8946     * The hostname on which the node is listening.
8947     */
8948    struct LDKHostname hostname;
8949    /**
8950     * The port on which the node is listening.
8951     */
8952    uint16_t port;
8953 } LDKSocketAddress_LDKHostname_Body;
8954
8955 typedef struct MUST_USE_STRUCT LDKSocketAddress {
8956    LDKSocketAddress_Tag tag;
8957    union {
8958       LDKSocketAddress_LDKTcpIpV4_Body tcp_ip_v4;
8959       LDKSocketAddress_LDKTcpIpV6_Body tcp_ip_v6;
8960       struct {
8961          struct LDKTwelveBytes onion_v2;
8962       };
8963       LDKSocketAddress_LDKOnionV3_Body onion_v3;
8964       LDKSocketAddress_LDKHostname_Body hostname;
8965    };
8966 } LDKSocketAddress;
8967
8968 /**
8969  * A dynamically-allocated array of crate::lightning::ln::msgs::SocketAddresss of arbitrary size.
8970  * This corresponds to std::vector in C++
8971  */
8972 typedef struct LDKCVec_SocketAddressZ {
8973    /**
8974     * The elements in the array.
8975     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8976     */
8977    struct LDKSocketAddress *data;
8978    /**
8979     * The number of elements pointed to by `data`.
8980     */
8981    uintptr_t datalen;
8982 } LDKCVec_SocketAddressZ;
8983
8984
8985
8986 /**
8987  * Information received in the latest node_announcement from this node.
8988  */
8989 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
8990    /**
8991     * A pointer to the opaque Rust object.
8992     * Nearly everywhere, inner must be non-null, however in places where
8993     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8994     */
8995    LDKnativeNodeAnnouncementInfo *inner;
8996    /**
8997     * Indicates that this is the only struct which contains the same pointer.
8998     * Rust functions which take ownership of an object provided via an argument require
8999     * this to be true and invalidate the object pointed to by inner.
9000     */
9001    bool is_owned;
9002 } LDKNodeAnnouncementInfo;
9003
9004 /**
9005  * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
9006  */
9007 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
9008    /**
9009     * A pointer to the contents in the success state.
9010     * Reading from this pointer when `result_ok` is not set is undefined.
9011     */
9012    struct LDKNodeAnnouncementInfo *result;
9013    /**
9014     * A pointer to the contents in the error state.
9015     * Reading from this pointer when `result_ok` is set is undefined.
9016     */
9017    struct LDKDecodeError *err;
9018 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
9019
9020 /**
9021  * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
9022  * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
9023  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9024  */
9025 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
9026    /**
9027     * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
9028     * `err` or `result` depending on the state of `result_ok`.
9029     */
9030    union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
9031    /**
9032     * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
9033     */
9034    bool result_ok;
9035 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
9036
9037
9038
9039 /**
9040  * A user-defined name for a node, which may be used when displaying the node in a graph.
9041  *
9042  * Since node aliases are provided by third parties, they are a potential avenue for injection
9043  * attacks. Care must be taken when processing.
9044  */
9045 typedef struct MUST_USE_STRUCT LDKNodeAlias {
9046    /**
9047     * A pointer to the opaque Rust object.
9048     * Nearly everywhere, inner must be non-null, however in places where
9049     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9050     */
9051    LDKnativeNodeAlias *inner;
9052    /**
9053     * Indicates that this is the only struct which contains the same pointer.
9054     * Rust functions which take ownership of an object provided via an argument require
9055     * this to be true and invalidate the object pointed to by inner.
9056     */
9057    bool is_owned;
9058 } LDKNodeAlias;
9059
9060 /**
9061  * The contents of CResult_NodeAliasDecodeErrorZ
9062  */
9063 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
9064    /**
9065     * A pointer to the contents in the success state.
9066     * Reading from this pointer when `result_ok` is not set is undefined.
9067     */
9068    struct LDKNodeAlias *result;
9069    /**
9070     * A pointer to the contents in the error state.
9071     * Reading from this pointer when `result_ok` is set is undefined.
9072     */
9073    struct LDKDecodeError *err;
9074 } LDKCResult_NodeAliasDecodeErrorZPtr;
9075
9076 /**
9077  * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
9078  * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
9079  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9080  */
9081 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
9082    /**
9083     * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
9084     * `err` or `result` depending on the state of `result_ok`.
9085     */
9086    union LDKCResult_NodeAliasDecodeErrorZPtr contents;
9087    /**
9088     * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
9089     */
9090    bool result_ok;
9091 } LDKCResult_NodeAliasDecodeErrorZ;
9092
9093
9094
9095 /**
9096  * Details about a node in the network, known from the network announcement.
9097  */
9098 typedef struct MUST_USE_STRUCT LDKNodeInfo {
9099    /**
9100     * A pointer to the opaque Rust object.
9101     * Nearly everywhere, inner must be non-null, however in places where
9102     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9103     */
9104    LDKnativeNodeInfo *inner;
9105    /**
9106     * Indicates that this is the only struct which contains the same pointer.
9107     * Rust functions which take ownership of an object provided via an argument require
9108     * this to be true and invalidate the object pointed to by inner.
9109     */
9110    bool is_owned;
9111 } LDKNodeInfo;
9112
9113 /**
9114  * The contents of CResult_NodeInfoDecodeErrorZ
9115  */
9116 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
9117    /**
9118     * A pointer to the contents in the success state.
9119     * Reading from this pointer when `result_ok` is not set is undefined.
9120     */
9121    struct LDKNodeInfo *result;
9122    /**
9123     * A pointer to the contents in the error state.
9124     * Reading from this pointer when `result_ok` is set is undefined.
9125     */
9126    struct LDKDecodeError *err;
9127 } LDKCResult_NodeInfoDecodeErrorZPtr;
9128
9129 /**
9130  * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
9131  * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
9132  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9133  */
9134 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
9135    /**
9136     * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
9137     * `err` or `result` depending on the state of `result_ok`.
9138     */
9139    union LDKCResult_NodeInfoDecodeErrorZPtr contents;
9140    /**
9141     * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
9142     */
9143    bool result_ok;
9144 } LDKCResult_NodeInfoDecodeErrorZ;
9145
9146 /**
9147  * The contents of CResult_NetworkGraphDecodeErrorZ
9148  */
9149 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
9150    /**
9151     * A pointer to the contents in the success state.
9152     * Reading from this pointer when `result_ok` is not set is undefined.
9153     */
9154    struct LDKNetworkGraph *result;
9155    /**
9156     * A pointer to the contents in the error state.
9157     * Reading from this pointer when `result_ok` is set is undefined.
9158     */
9159    struct LDKDecodeError *err;
9160 } LDKCResult_NetworkGraphDecodeErrorZPtr;
9161
9162 /**
9163  * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
9164  * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
9165  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9166  */
9167 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
9168    /**
9169     * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
9170     * `err` or `result` depending on the state of `result_ok`.
9171     */
9172    union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
9173    /**
9174     * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
9175     */
9176    bool result_ok;
9177 } LDKCResult_NetworkGraphDecodeErrorZ;
9178
9179 /**
9180  * An enum which can either contain a crate::c_types::derived::CVec_SocketAddressZ or not
9181  */
9182 typedef enum LDKCOption_CVec_SocketAddressZZ_Tag {
9183    /**
9184     * When we're in this state, this COption_CVec_SocketAddressZZ contains a crate::c_types::derived::CVec_SocketAddressZ
9185     */
9186    LDKCOption_CVec_SocketAddressZZ_Some,
9187    /**
9188     * When we're in this state, this COption_CVec_SocketAddressZZ contains nothing
9189     */
9190    LDKCOption_CVec_SocketAddressZZ_None,
9191    /**
9192     * Must be last for serialization purposes
9193     */
9194    LDKCOption_CVec_SocketAddressZZ_Sentinel,
9195 } LDKCOption_CVec_SocketAddressZZ_Tag;
9196
9197 typedef struct LDKCOption_CVec_SocketAddressZZ {
9198    LDKCOption_CVec_SocketAddressZZ_Tag tag;
9199    union {
9200       struct {
9201          struct LDKCVec_SocketAddressZ some;
9202       };
9203    };
9204 } LDKCOption_CVec_SocketAddressZZ;
9205
9206 /**
9207  * The contents of CResult_u64ShortChannelIdErrorZ
9208  */
9209 typedef union LDKCResult_u64ShortChannelIdErrorZPtr {
9210    /**
9211     * A pointer to the contents in the success state.
9212     * Reading from this pointer when `result_ok` is not set is undefined.
9213     */
9214    uint64_t *result;
9215    /**
9216     * A pointer to the contents in the error state.
9217     * Reading from this pointer when `result_ok` is set is undefined.
9218     */
9219    enum LDKShortChannelIdError *err;
9220 } LDKCResult_u64ShortChannelIdErrorZPtr;
9221
9222 /**
9223  * A CResult_u64ShortChannelIdErrorZ represents the result of a fallible operation,
9224  * containing a u64 on success and a crate::lightning::util::scid_utils::ShortChannelIdError on failure.
9225  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9226  */
9227 typedef struct LDKCResult_u64ShortChannelIdErrorZ {
9228    /**
9229     * The contents of this CResult_u64ShortChannelIdErrorZ, accessible via either
9230     * `err` or `result` depending on the state of `result_ok`.
9231     */
9232    union LDKCResult_u64ShortChannelIdErrorZPtr contents;
9233    /**
9234     * Whether this CResult_u64ShortChannelIdErrorZ represents a success state.
9235     */
9236    bool result_ok;
9237 } LDKCResult_u64ShortChannelIdErrorZ;
9238
9239
9240
9241 /**
9242  * Information about an incoming HTLC, including the [`PendingHTLCRouting`] describing where it
9243  * should go next.
9244  */
9245 typedef struct MUST_USE_STRUCT LDKPendingHTLCInfo {
9246    /**
9247     * A pointer to the opaque Rust object.
9248     * Nearly everywhere, inner must be non-null, however in places where
9249     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9250     */
9251    LDKnativePendingHTLCInfo *inner;
9252    /**
9253     * Indicates that this is the only struct which contains the same pointer.
9254     * Rust functions which take ownership of an object provided via an argument require
9255     * this to be true and invalidate the object pointed to by inner.
9256     */
9257    bool is_owned;
9258 } LDKPendingHTLCInfo;
9259
9260
9261
9262 /**
9263  * Invalid inbound onion payment.
9264  */
9265 typedef struct MUST_USE_STRUCT LDKInboundHTLCErr {
9266    /**
9267     * A pointer to the opaque Rust object.
9268     * Nearly everywhere, inner must be non-null, however in places where
9269     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9270     */
9271    LDKnativeInboundHTLCErr *inner;
9272    /**
9273     * Indicates that this is the only struct which contains the same pointer.
9274     * Rust functions which take ownership of an object provided via an argument require
9275     * this to be true and invalidate the object pointed to by inner.
9276     */
9277    bool is_owned;
9278 } LDKInboundHTLCErr;
9279
9280 /**
9281  * The contents of CResult_PendingHTLCInfoInboundHTLCErrZ
9282  */
9283 typedef union LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr {
9284    /**
9285     * A pointer to the contents in the success state.
9286     * Reading from this pointer when `result_ok` is not set is undefined.
9287     */
9288    struct LDKPendingHTLCInfo *result;
9289    /**
9290     * A pointer to the contents in the error state.
9291     * Reading from this pointer when `result_ok` is set is undefined.
9292     */
9293    struct LDKInboundHTLCErr *err;
9294 } LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr;
9295
9296 /**
9297  * A CResult_PendingHTLCInfoInboundHTLCErrZ represents the result of a fallible operation,
9298  * containing a crate::lightning::ln::channelmanager::PendingHTLCInfo on success and a crate::lightning::ln::onion_payment::InboundHTLCErr on failure.
9299  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9300  */
9301 typedef struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ {
9302    /**
9303     * The contents of this CResult_PendingHTLCInfoInboundHTLCErrZ, accessible via either
9304     * `err` or `result` depending on the state of `result_ok`.
9305     */
9306    union LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr contents;
9307    /**
9308     * Whether this CResult_PendingHTLCInfoInboundHTLCErrZ represents a success state.
9309     */
9310    bool result_ok;
9311 } LDKCResult_PendingHTLCInfoInboundHTLCErrZ;
9312
9313 /**
9314  * A dynamically-allocated array of crate::lightning::ln::chan_utils::HTLCOutputInCommitments of arbitrary size.
9315  * This corresponds to std::vector in C++
9316  */
9317 typedef struct LDKCVec_HTLCOutputInCommitmentZ {
9318    /**
9319     * The elements in the array.
9320     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9321     */
9322    struct LDKHTLCOutputInCommitment *data;
9323    /**
9324     * The number of elements pointed to by `data`.
9325     */
9326    uintptr_t datalen;
9327 } LDKCVec_HTLCOutputInCommitmentZ;
9328
9329 /**
9330  * A dynamically-allocated array of crate::lightning::sign::HTLCDescriptors of arbitrary size.
9331  * This corresponds to std::vector in C++
9332  */
9333 typedef struct LDKCVec_HTLCDescriptorZ {
9334    /**
9335     * The elements in the array.
9336     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9337     */
9338    struct LDKHTLCDescriptor *data;
9339    /**
9340     * The number of elements pointed to by `data`.
9341     */
9342    uintptr_t datalen;
9343 } LDKCVec_HTLCDescriptorZ;
9344
9345
9346
9347 /**
9348  * An unspent transaction output that is available to spend resulting from a successful
9349  * [`CoinSelection`] attempt.
9350  */
9351 typedef struct MUST_USE_STRUCT LDKUtxo {
9352    /**
9353     * A pointer to the opaque Rust object.
9354     * Nearly everywhere, inner must be non-null, however in places where
9355     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9356     */
9357    LDKnativeUtxo *inner;
9358    /**
9359     * Indicates that this is the only struct which contains the same pointer.
9360     * Rust functions which take ownership of an object provided via an argument require
9361     * this to be true and invalidate the object pointed to by inner.
9362     */
9363    bool is_owned;
9364 } LDKUtxo;
9365
9366 /**
9367  * A dynamically-allocated array of crate::lightning::events::bump_transaction::Utxos of arbitrary size.
9368  * This corresponds to std::vector in C++
9369  */
9370 typedef struct LDKCVec_UtxoZ {
9371    /**
9372     * The elements in the array.
9373     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9374     */
9375    struct LDKUtxo *data;
9376    /**
9377     * The number of elements pointed to by `data`.
9378     */
9379    uintptr_t datalen;
9380 } LDKCVec_UtxoZ;
9381
9382 /**
9383  * An enum which can either contain a crate::c_types::TxOut or not
9384  */
9385 typedef enum LDKCOption_TxOutZ_Tag {
9386    /**
9387     * When we're in this state, this COption_TxOutZ contains a crate::c_types::TxOut
9388     */
9389    LDKCOption_TxOutZ_Some,
9390    /**
9391     * When we're in this state, this COption_TxOutZ contains nothing
9392     */
9393    LDKCOption_TxOutZ_None,
9394    /**
9395     * Must be last for serialization purposes
9396     */
9397    LDKCOption_TxOutZ_Sentinel,
9398 } LDKCOption_TxOutZ_Tag;
9399
9400 typedef struct LDKCOption_TxOutZ {
9401    LDKCOption_TxOutZ_Tag tag;
9402    union {
9403       struct {
9404          struct LDKTxOut some;
9405       };
9406    };
9407 } LDKCOption_TxOutZ;
9408
9409
9410
9411 /**
9412  * An input that must be included in a transaction when performing coin selection through
9413  * [`CoinSelectionSource::select_confirmed_utxos`]. It is guaranteed to be a SegWit input, so it
9414  * must have an empty [`TxIn::script_sig`] when spent.
9415  */
9416 typedef struct MUST_USE_STRUCT LDKInput {
9417    /**
9418     * A pointer to the opaque Rust object.
9419     * Nearly everywhere, inner must be non-null, however in places where
9420     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9421     */
9422    LDKnativeInput *inner;
9423    /**
9424     * Indicates that this is the only struct which contains the same pointer.
9425     * Rust functions which take ownership of an object provided via an argument require
9426     * this to be true and invalidate the object pointed to by inner.
9427     */
9428    bool is_owned;
9429 } LDKInput;
9430
9431 /**
9432  * A dynamically-allocated array of crate::lightning::events::bump_transaction::Inputs of arbitrary size.
9433  * This corresponds to std::vector in C++
9434  */
9435 typedef struct LDKCVec_InputZ {
9436    /**
9437     * The elements in the array.
9438     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9439     */
9440    struct LDKInput *data;
9441    /**
9442     * The number of elements pointed to by `data`.
9443     */
9444    uintptr_t datalen;
9445 } LDKCVec_InputZ;
9446
9447
9448
9449 /**
9450  * The result of a successful coin selection attempt for a transaction requiring additional UTXOs
9451  * to cover its fees.
9452  */
9453 typedef struct MUST_USE_STRUCT LDKCoinSelection {
9454    /**
9455     * A pointer to the opaque Rust object.
9456     * Nearly everywhere, inner must be non-null, however in places where
9457     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9458     */
9459    LDKnativeCoinSelection *inner;
9460    /**
9461     * Indicates that this is the only struct which contains the same pointer.
9462     * Rust functions which take ownership of an object provided via an argument require
9463     * this to be true and invalidate the object pointed to by inner.
9464     */
9465    bool is_owned;
9466 } LDKCoinSelection;
9467
9468 /**
9469  * The contents of CResult_CoinSelectionNoneZ
9470  */
9471 typedef union LDKCResult_CoinSelectionNoneZPtr {
9472    /**
9473     * A pointer to the contents in the success state.
9474     * Reading from this pointer when `result_ok` is not set is undefined.
9475     */
9476    struct LDKCoinSelection *result;
9477    /**
9478     * Note that this value is always NULL, as there are no contents in the Err variant
9479     */
9480    void *err;
9481 } LDKCResult_CoinSelectionNoneZPtr;
9482
9483 /**
9484  * A CResult_CoinSelectionNoneZ represents the result of a fallible operation,
9485  * containing a crate::lightning::events::bump_transaction::CoinSelection on success and a () on failure.
9486  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9487  */
9488 typedef struct LDKCResult_CoinSelectionNoneZ {
9489    /**
9490     * The contents of this CResult_CoinSelectionNoneZ, accessible via either
9491     * `err` or `result` depending on the state of `result_ok`.
9492     */
9493    union LDKCResult_CoinSelectionNoneZPtr contents;
9494    /**
9495     * Whether this CResult_CoinSelectionNoneZ represents a success state.
9496     */
9497    bool result_ok;
9498 } LDKCResult_CoinSelectionNoneZ;
9499
9500 /**
9501  * The contents of CResult_CVec_UtxoZNoneZ
9502  */
9503 typedef union LDKCResult_CVec_UtxoZNoneZPtr {
9504    /**
9505     * A pointer to the contents in the success state.
9506     * Reading from this pointer when `result_ok` is not set is undefined.
9507     */
9508    struct LDKCVec_UtxoZ *result;
9509    /**
9510     * Note that this value is always NULL, as there are no contents in the Err variant
9511     */
9512    void *err;
9513 } LDKCResult_CVec_UtxoZNoneZPtr;
9514
9515 /**
9516  * A CResult_CVec_UtxoZNoneZ represents the result of a fallible operation,
9517  * containing a crate::c_types::derived::CVec_UtxoZ on success and a () on failure.
9518  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9519  */
9520 typedef struct LDKCResult_CVec_UtxoZNoneZ {
9521    /**
9522     * The contents of this CResult_CVec_UtxoZNoneZ, accessible via either
9523     * `err` or `result` depending on the state of `result_ok`.
9524     */
9525    union LDKCResult_CVec_UtxoZNoneZPtr contents;
9526    /**
9527     * Whether this CResult_CVec_UtxoZNoneZ represents a success state.
9528     */
9529    bool result_ok;
9530 } LDKCResult_CVec_UtxoZNoneZ;
9531
9532
9533
9534 /**
9535  * An unknown payment context.
9536  */
9537 typedef struct MUST_USE_STRUCT LDKUnknownPaymentContext {
9538    /**
9539     * A pointer to the opaque Rust object.
9540     * Nearly everywhere, inner must be non-null, however in places where
9541     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9542     */
9543    LDKnativeUnknownPaymentContext *inner;
9544    /**
9545     * Indicates that this is the only struct which contains the same pointer.
9546     * Rust functions which take ownership of an object provided via an argument require
9547     * this to be true and invalidate the object pointed to by inner.
9548     */
9549    bool is_owned;
9550 } LDKUnknownPaymentContext;
9551
9552
9553
9554 /**
9555  * The context of a payment made for an invoice requested from a BOLT 12 [`Offer`].
9556  *
9557  * [`Offer`]: crate::offers::offer::Offer
9558  */
9559 typedef struct MUST_USE_STRUCT LDKBolt12OfferContext {
9560    /**
9561     * A pointer to the opaque Rust object.
9562     * Nearly everywhere, inner must be non-null, however in places where
9563     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9564     */
9565    LDKnativeBolt12OfferContext *inner;
9566    /**
9567     * Indicates that this is the only struct which contains the same pointer.
9568     * Rust functions which take ownership of an object provided via an argument require
9569     * this to be true and invalidate the object pointed to by inner.
9570     */
9571    bool is_owned;
9572 } LDKBolt12OfferContext;
9573
9574
9575
9576 /**
9577  * The context of a payment made for an invoice sent for a BOLT 12 [`Refund`].
9578  *
9579  * [`Refund`]: crate::offers::refund::Refund
9580  */
9581 typedef struct MUST_USE_STRUCT LDKBolt12RefundContext {
9582    /**
9583     * A pointer to the opaque Rust object.
9584     * Nearly everywhere, inner must be non-null, however in places where
9585     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9586     */
9587    LDKnativeBolt12RefundContext *inner;
9588    /**
9589     * Indicates that this is the only struct which contains the same pointer.
9590     * Rust functions which take ownership of an object provided via an argument require
9591     * this to be true and invalidate the object pointed to by inner.
9592     */
9593    bool is_owned;
9594 } LDKBolt12RefundContext;
9595
9596 /**
9597  * The context of an inbound payment, which is included in a [`BlindedPath`] via [`ReceiveTlvs`]
9598  * and surfaced in [`PaymentPurpose`].
9599  *
9600  * [`BlindedPath`]: crate::blinded_path::BlindedPath
9601  * [`PaymentPurpose`]: crate::events::PaymentPurpose
9602  */
9603 typedef enum LDKPaymentContext_Tag {
9604    /**
9605     * The payment context was unknown.
9606     */
9607    LDKPaymentContext_Unknown,
9608    /**
9609     * The payment was made for an invoice requested from a BOLT 12 [`Offer`].
9610     *
9611     * [`Offer`]: crate::offers::offer::Offer
9612     */
9613    LDKPaymentContext_Bolt12Offer,
9614    /**
9615     * The payment was made for an invoice sent for a BOLT 12 [`Refund`].
9616     *
9617     * [`Refund`]: crate::offers::refund::Refund
9618     */
9619    LDKPaymentContext_Bolt12Refund,
9620    /**
9621     * Must be last for serialization purposes
9622     */
9623    LDKPaymentContext_Sentinel,
9624 } LDKPaymentContext_Tag;
9625
9626 typedef struct MUST_USE_STRUCT LDKPaymentContext {
9627    LDKPaymentContext_Tag tag;
9628    union {
9629       struct {
9630          struct LDKUnknownPaymentContext unknown;
9631       };
9632       struct {
9633          struct LDKBolt12OfferContext bolt12_offer;
9634       };
9635       struct {
9636          struct LDKBolt12RefundContext bolt12_refund;
9637       };
9638    };
9639 } LDKPaymentContext;
9640
9641 /**
9642  * An enum which can either contain a crate::lightning::blinded_path::payment::PaymentContext or not
9643  */
9644 typedef enum LDKCOption_PaymentContextZ_Tag {
9645    /**
9646     * When we're in this state, this COption_PaymentContextZ contains a crate::lightning::blinded_path::payment::PaymentContext
9647     */
9648    LDKCOption_PaymentContextZ_Some,
9649    /**
9650     * When we're in this state, this COption_PaymentContextZ contains nothing
9651     */
9652    LDKCOption_PaymentContextZ_None,
9653    /**
9654     * Must be last for serialization purposes
9655     */
9656    LDKCOption_PaymentContextZ_Sentinel,
9657 } LDKCOption_PaymentContextZ_Tag;
9658
9659 typedef struct LDKCOption_PaymentContextZ {
9660    LDKCOption_PaymentContextZ_Tag tag;
9661    union {
9662       struct {
9663          struct LDKPaymentContext some;
9664       };
9665    };
9666 } LDKCOption_PaymentContextZ;
9667
9668 /**
9669  * A tuple of 2 elements. See the individual fields for the types contained.
9670  */
9671 typedef struct LDKC2Tuple_u64u16Z {
9672    /**
9673     * The element at position 0
9674     */
9675    uint64_t a;
9676    /**
9677     * The element at position 1
9678     */
9679    uint16_t b;
9680 } LDKC2Tuple_u64u16Z;
9681
9682 /**
9683  * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u16Z or not
9684  */
9685 typedef enum LDKCOption_C2Tuple_u64u16ZZ_Tag {
9686    /**
9687     * When we're in this state, this COption_C2Tuple_u64u16ZZ contains a crate::c_types::derived::C2Tuple_u64u16Z
9688     */
9689    LDKCOption_C2Tuple_u64u16ZZ_Some,
9690    /**
9691     * When we're in this state, this COption_C2Tuple_u64u16ZZ contains nothing
9692     */
9693    LDKCOption_C2Tuple_u64u16ZZ_None,
9694    /**
9695     * Must be last for serialization purposes
9696     */
9697    LDKCOption_C2Tuple_u64u16ZZ_Sentinel,
9698 } LDKCOption_C2Tuple_u64u16ZZ_Tag;
9699
9700 typedef struct LDKCOption_C2Tuple_u64u16ZZ {
9701    LDKCOption_C2Tuple_u64u16ZZ_Tag tag;
9702    union {
9703       struct {
9704          struct LDKC2Tuple_u64u16Z some;
9705       };
9706    };
9707 } LDKCOption_C2Tuple_u64u16ZZ;
9708
9709 /**
9710  * The contents of CResult_ChannelIdAPIErrorZ
9711  */
9712 typedef union LDKCResult_ChannelIdAPIErrorZPtr {
9713    /**
9714     * A pointer to the contents in the success state.
9715     * Reading from this pointer when `result_ok` is not set is undefined.
9716     */
9717    struct LDKChannelId *result;
9718    /**
9719     * A pointer to the contents in the error state.
9720     * Reading from this pointer when `result_ok` is set is undefined.
9721     */
9722    struct LDKAPIError *err;
9723 } LDKCResult_ChannelIdAPIErrorZPtr;
9724
9725 /**
9726  * A CResult_ChannelIdAPIErrorZ represents the result of a fallible operation,
9727  * containing a crate::lightning::ln::types::ChannelId on success and a crate::lightning::util::errors::APIError on failure.
9728  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9729  */
9730 typedef struct LDKCResult_ChannelIdAPIErrorZ {
9731    /**
9732     * The contents of this CResult_ChannelIdAPIErrorZ, accessible via either
9733     * `err` or `result` depending on the state of `result_ok`.
9734     */
9735    union LDKCResult_ChannelIdAPIErrorZPtr contents;
9736    /**
9737     * Whether this CResult_ChannelIdAPIErrorZ represents a success state.
9738     */
9739    bool result_ok;
9740 } LDKCResult_ChannelIdAPIErrorZ;
9741
9742 /**
9743  * Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments.
9744  * These include payments that have yet to find a successful path, or have unresolved HTLCs.
9745  */
9746 typedef enum LDKRecentPaymentDetails_Tag {
9747    /**
9748     * When an invoice was requested and thus a payment has not yet been sent.
9749     */
9750    LDKRecentPaymentDetails_AwaitingInvoice,
9751    /**
9752     * When a payment is still being sent and awaiting successful delivery.
9753     */
9754    LDKRecentPaymentDetails_Pending,
9755    /**
9756     * When a pending payment is fulfilled, we continue tracking it until all pending HTLCs have
9757     * been resolved. Upon receiving [`Event::PaymentSent`], we delay for a few minutes before the
9758     * payment is removed from tracking.
9759     */
9760    LDKRecentPaymentDetails_Fulfilled,
9761    /**
9762     * After a payment's retries are exhausted per the provided [`Retry`], or it is explicitly
9763     * abandoned via [`ChannelManager::abandon_payment`], it is marked as abandoned until all
9764     * pending HTLCs for this payment resolve and an [`Event::PaymentFailed`] is generated.
9765     */
9766    LDKRecentPaymentDetails_Abandoned,
9767    /**
9768     * Must be last for serialization purposes
9769     */
9770    LDKRecentPaymentDetails_Sentinel,
9771 } LDKRecentPaymentDetails_Tag;
9772
9773 typedef struct LDKRecentPaymentDetails_LDKAwaitingInvoice_Body {
9774    /**
9775     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9776     * a payment and ensure idempotency in LDK.
9777     */
9778    struct LDKThirtyTwoBytes payment_id;
9779 } LDKRecentPaymentDetails_LDKAwaitingInvoice_Body;
9780
9781 typedef struct LDKRecentPaymentDetails_LDKPending_Body {
9782    /**
9783     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9784     * a payment and ensure idempotency in LDK.
9785     */
9786    struct LDKThirtyTwoBytes payment_id;
9787    /**
9788     * Hash of the payment that is currently being sent but has yet to be fulfilled or
9789     * abandoned.
9790     */
9791    struct LDKThirtyTwoBytes payment_hash;
9792    /**
9793     * Total amount (in msat, excluding fees) across all paths for this payment,
9794     * not just the amount currently inflight.
9795     */
9796    uint64_t total_msat;
9797 } LDKRecentPaymentDetails_LDKPending_Body;
9798
9799 typedef struct LDKRecentPaymentDetails_LDKFulfilled_Body {
9800    /**
9801     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9802     * a payment and ensure idempotency in LDK.
9803     */
9804    struct LDKThirtyTwoBytes payment_id;
9805    /**
9806     * Hash of the payment that was claimed. `None` for serializations of [`ChannelManager`]
9807     * made before LDK version 0.0.104.
9808     */
9809    struct LDKCOption_ThirtyTwoBytesZ payment_hash;
9810 } LDKRecentPaymentDetails_LDKFulfilled_Body;
9811
9812 typedef struct LDKRecentPaymentDetails_LDKAbandoned_Body {
9813    /**
9814     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9815     * a payment and ensure idempotency in LDK.
9816     */
9817    struct LDKThirtyTwoBytes payment_id;
9818    /**
9819     * Hash of the payment that we have given up trying to send.
9820     */
9821    struct LDKThirtyTwoBytes payment_hash;
9822 } LDKRecentPaymentDetails_LDKAbandoned_Body;
9823
9824 typedef struct MUST_USE_STRUCT LDKRecentPaymentDetails {
9825    LDKRecentPaymentDetails_Tag tag;
9826    union {
9827       LDKRecentPaymentDetails_LDKAwaitingInvoice_Body awaiting_invoice;
9828       LDKRecentPaymentDetails_LDKPending_Body pending;
9829       LDKRecentPaymentDetails_LDKFulfilled_Body fulfilled;
9830       LDKRecentPaymentDetails_LDKAbandoned_Body abandoned;
9831    };
9832 } LDKRecentPaymentDetails;
9833
9834 /**
9835  * A dynamically-allocated array of crate::lightning::ln::channelmanager::RecentPaymentDetailss of arbitrary size.
9836  * This corresponds to std::vector in C++
9837  */
9838 typedef struct LDKCVec_RecentPaymentDetailsZ {
9839    /**
9840     * The elements in the array.
9841     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9842     */
9843    struct LDKRecentPaymentDetails *data;
9844    /**
9845     * The number of elements pointed to by `data`.
9846     */
9847    uintptr_t datalen;
9848 } LDKCVec_RecentPaymentDetailsZ;
9849
9850 /**
9851  * If a payment fails to send with [`ChannelManager::send_payment_with_route`], it can be in one
9852  * of several states. This enum is returned as the Err() type describing which state the payment
9853  * is in, see the description of individual enum states for more.
9854  *
9855  * [`ChannelManager::send_payment_with_route`]: crate::ln::channelmanager::ChannelManager::send_payment_with_route
9856  */
9857 typedef enum LDKPaymentSendFailure_Tag {
9858    /**
9859     * A parameter which was passed to send_payment was invalid, preventing us from attempting to
9860     * send the payment at all.
9861     *
9862     * You can freely resend the payment in full (with the parameter error fixed).
9863     *
9864     * Because the payment failed outright, no payment tracking is done and no
9865     * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
9866     *
9867     * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
9868     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9869     */
9870    LDKPaymentSendFailure_ParameterError,
9871    /**
9872     * A parameter in a single path which was passed to send_payment was invalid, preventing us
9873     * from attempting to send the payment at all.
9874     *
9875     * You can freely resend the payment in full (with the parameter error fixed).
9876     *
9877     * Because the payment failed outright, no payment tracking is done and no
9878     * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
9879     *
9880     * The results here are ordered the same as the paths in the route object which was passed to
9881     * send_payment.
9882     *
9883     * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
9884     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9885     */
9886    LDKPaymentSendFailure_PathParameterError,
9887    /**
9888     * All paths which were attempted failed to send, with no channel state change taking place.
9889     * You can freely resend the payment in full (though you probably want to do so over different
9890     * paths than the ones selected).
9891     *
9892     * Because the payment failed outright, no payment tracking is done and no
9893     * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
9894     *
9895     * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
9896     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9897     */
9898    LDKPaymentSendFailure_AllFailedResendSafe,
9899    /**
9900     * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
9901     * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
9902     *
9903     * [`PaymentId`]: crate::ln::channelmanager::PaymentId
9904     * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
9905     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9906     */
9907    LDKPaymentSendFailure_DuplicatePayment,
9908    /**
9909     * Some paths that were attempted failed to send, though some paths may have succeeded. At least
9910     * some paths have irrevocably committed to the HTLC.
9911     *
9912     * The results here are ordered the same as the paths in the route object that was passed to
9913     * send_payment.
9914     *
9915     * Any entries that contain `Err(APIError::MonitorUpdateInprogress)` will send once a
9916     * [`MonitorEvent::Completed`] is provided for the next-hop channel with the latest update_id.
9917     *
9918     * [`MonitorEvent::Completed`]: crate::chain::channelmonitor::MonitorEvent::Completed
9919     */
9920    LDKPaymentSendFailure_PartialFailure,
9921    /**
9922     * Must be last for serialization purposes
9923     */
9924    LDKPaymentSendFailure_Sentinel,
9925 } LDKPaymentSendFailure_Tag;
9926
9927 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
9928    /**
9929     * The errors themselves, in the same order as the paths from the route.
9930     */
9931    struct LDKCVec_CResult_NoneAPIErrorZZ results;
9932    /**
9933     * If some paths failed without irrevocably committing to the new HTLC(s), this will
9934     * contain a [`RouteParameters`] object for the failing paths.
9935     *
9936     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
9937     */
9938    struct LDKRouteParameters failed_paths_retry;
9939    /**
9940     * The payment id for the payment, which is now at least partially pending.
9941     */
9942    struct LDKThirtyTwoBytes payment_id;
9943 } LDKPaymentSendFailure_LDKPartialFailure_Body;
9944
9945 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
9946    LDKPaymentSendFailure_Tag tag;
9947    union {
9948       struct {
9949          struct LDKAPIError parameter_error;
9950       };
9951       struct {
9952          struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
9953       };
9954       struct {
9955          struct LDKCVec_APIErrorZ all_failed_resend_safe;
9956       };
9957       LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
9958    };
9959 } LDKPaymentSendFailure;
9960
9961 /**
9962  * The contents of CResult_NonePaymentSendFailureZ
9963  */
9964 typedef union LDKCResult_NonePaymentSendFailureZPtr {
9965    /**
9966     * Note that this value is always NULL, as there are no contents in the OK variant
9967     */
9968    void *result;
9969    /**
9970     * A pointer to the contents in the error state.
9971     * Reading from this pointer when `result_ok` is set is undefined.
9972     */
9973    struct LDKPaymentSendFailure *err;
9974 } LDKCResult_NonePaymentSendFailureZPtr;
9975
9976 /**
9977  * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
9978  * containing a () on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
9979  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9980  */
9981 typedef struct LDKCResult_NonePaymentSendFailureZ {
9982    /**
9983     * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
9984     * `err` or `result` depending on the state of `result_ok`.
9985     */
9986    union LDKCResult_NonePaymentSendFailureZPtr contents;
9987    /**
9988     * Whether this CResult_NonePaymentSendFailureZ represents a success state.
9989     */
9990    bool result_ok;
9991 } LDKCResult_NonePaymentSendFailureZ;
9992
9993 /**
9994  * The contents of CResult_NoneRetryableSendFailureZ
9995  */
9996 typedef union LDKCResult_NoneRetryableSendFailureZPtr {
9997    /**
9998     * Note that this value is always NULL, as there are no contents in the OK variant
9999     */
10000    void *result;
10001    /**
10002     * A pointer to the contents in the error state.
10003     * Reading from this pointer when `result_ok` is set is undefined.
10004     */
10005    enum LDKRetryableSendFailure *err;
10006 } LDKCResult_NoneRetryableSendFailureZPtr;
10007
10008 /**
10009  * A CResult_NoneRetryableSendFailureZ represents the result of a fallible operation,
10010  * containing a () on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
10011  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10012  */
10013 typedef struct LDKCResult_NoneRetryableSendFailureZ {
10014    /**
10015     * The contents of this CResult_NoneRetryableSendFailureZ, accessible via either
10016     * `err` or `result` depending on the state of `result_ok`.
10017     */
10018    union LDKCResult_NoneRetryableSendFailureZPtr contents;
10019    /**
10020     * Whether this CResult_NoneRetryableSendFailureZ represents a success state.
10021     */
10022    bool result_ok;
10023 } LDKCResult_NoneRetryableSendFailureZ;
10024
10025 /**
10026  * The contents of CResult_ThirtyTwoBytesPaymentSendFailureZ
10027  */
10028 typedef union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr {
10029    /**
10030     * A pointer to the contents in the success state.
10031     * Reading from this pointer when `result_ok` is not set is undefined.
10032     */
10033    struct LDKThirtyTwoBytes *result;
10034    /**
10035     * A pointer to the contents in the error state.
10036     * Reading from this pointer when `result_ok` is set is undefined.
10037     */
10038    struct LDKPaymentSendFailure *err;
10039 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr;
10040
10041 /**
10042  * A CResult_ThirtyTwoBytesPaymentSendFailureZ represents the result of a fallible operation,
10043  * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
10044  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10045  */
10046 typedef struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ {
10047    /**
10048     * The contents of this CResult_ThirtyTwoBytesPaymentSendFailureZ, accessible via either
10049     * `err` or `result` depending on the state of `result_ok`.
10050     */
10051    union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr contents;
10052    /**
10053     * Whether this CResult_ThirtyTwoBytesPaymentSendFailureZ represents a success state.
10054     */
10055    bool result_ok;
10056 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZ;
10057
10058 /**
10059  * The contents of CResult_ThirtyTwoBytesRetryableSendFailureZ
10060  */
10061 typedef union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr {
10062    /**
10063     * A pointer to the contents in the success state.
10064     * Reading from this pointer when `result_ok` is not set is undefined.
10065     */
10066    struct LDKThirtyTwoBytes *result;
10067    /**
10068     * A pointer to the contents in the error state.
10069     * Reading from this pointer when `result_ok` is set is undefined.
10070     */
10071    enum LDKRetryableSendFailure *err;
10072 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr;
10073
10074 /**
10075  * A CResult_ThirtyTwoBytesRetryableSendFailureZ represents the result of a fallible operation,
10076  * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
10077  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10078  */
10079 typedef struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ {
10080    /**
10081     * The contents of this CResult_ThirtyTwoBytesRetryableSendFailureZ, accessible via either
10082     * `err` or `result` depending on the state of `result_ok`.
10083     */
10084    union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr contents;
10085    /**
10086     * Whether this CResult_ThirtyTwoBytesRetryableSendFailureZ represents a success state.
10087     */
10088    bool result_ok;
10089 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZ;
10090
10091 /**
10092  * A tuple of 2 elements. See the individual fields for the types contained.
10093  */
10094 typedef struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ {
10095    /**
10096     * The element at position 0
10097     */
10098    struct LDKThirtyTwoBytes a;
10099    /**
10100     * The element at position 1
10101     */
10102    struct LDKThirtyTwoBytes b;
10103 } LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ;
10104
10105 /**
10106  * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ
10107  */
10108 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr {
10109    /**
10110     * A pointer to the contents in the success state.
10111     * Reading from this pointer when `result_ok` is not set is undefined.
10112     */
10113    struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
10114    /**
10115     * A pointer to the contents in the error state.
10116     * Reading from this pointer when `result_ok` is set is undefined.
10117     */
10118    struct LDKPaymentSendFailure *err;
10119 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr;
10120
10121 /**
10122  * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents the result of a fallible operation,
10123  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
10124  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10125  */
10126 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ {
10127    /**
10128     * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ, accessible via either
10129     * `err` or `result` depending on the state of `result_ok`.
10130     */
10131    union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr contents;
10132    /**
10133     * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents a success state.
10134     */
10135    bool result_ok;
10136 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ;
10137
10138 /**
10139  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZs of arbitrary size.
10140  * This corresponds to std::vector in C++
10141  */
10142 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ {
10143    /**
10144     * The elements in the array.
10145     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10146     */
10147    struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *data;
10148    /**
10149     * The number of elements pointed to by `data`.
10150     */
10151    uintptr_t datalen;
10152 } LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ;
10153
10154 /**
10155  * Indicates that we failed to send a payment probe. Further errors may be surfaced later via
10156  * [`Event::ProbeFailed`].
10157  *
10158  * [`Event::ProbeFailed`]: crate::events::Event::ProbeFailed
10159  */
10160 typedef enum LDKProbeSendFailure_Tag {
10161    /**
10162     * We were unable to find a route to the destination.
10163     */
10164    LDKProbeSendFailure_RouteNotFound,
10165    /**
10166     * We failed to send the payment probes.
10167     */
10168    LDKProbeSendFailure_SendingFailed,
10169    /**
10170     * Must be last for serialization purposes
10171     */
10172    LDKProbeSendFailure_Sentinel,
10173 } LDKProbeSendFailure_Tag;
10174
10175 typedef struct MUST_USE_STRUCT LDKProbeSendFailure {
10176    LDKProbeSendFailure_Tag tag;
10177    union {
10178       struct {
10179          struct LDKPaymentSendFailure sending_failed;
10180       };
10181    };
10182 } LDKProbeSendFailure;
10183
10184 /**
10185  * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ
10186  */
10187 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr {
10188    /**
10189     * A pointer to the contents in the success state.
10190     * Reading from this pointer when `result_ok` is not set is undefined.
10191     */
10192    struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ *result;
10193    /**
10194     * A pointer to the contents in the error state.
10195     * Reading from this pointer when `result_ok` is set is undefined.
10196     */
10197    struct LDKProbeSendFailure *err;
10198 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr;
10199
10200 /**
10201  * A CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents the result of a fallible operation,
10202  * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ on success and a crate::lightning::ln::outbound_payment::ProbeSendFailure on failure.
10203  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10204  */
10205 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ {
10206    /**
10207     * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ, accessible via either
10208     * `err` or `result` depending on the state of `result_ok`.
10209     */
10210    union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr contents;
10211    /**
10212     * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents a success state.
10213     */
10214    bool result_ok;
10215 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ;
10216
10217 /**
10218  * A tuple of 2 elements. See the individual fields for the types contained.
10219  */
10220 typedef struct LDKC2Tuple_ChannelIdPublicKeyZ {
10221    /**
10222     * The element at position 0
10223     */
10224    struct LDKChannelId a;
10225    /**
10226     * The element at position 1
10227     */
10228    struct LDKPublicKey b;
10229 } LDKC2Tuple_ChannelIdPublicKeyZ;
10230
10231 /**
10232  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ChannelIdPublicKeyZs of arbitrary size.
10233  * This corresponds to std::vector in C++
10234  */
10235 typedef struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ {
10236    /**
10237     * The elements in the array.
10238     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10239     */
10240    struct LDKC2Tuple_ChannelIdPublicKeyZ *data;
10241    /**
10242     * The number of elements pointed to by `data`.
10243     */
10244    uintptr_t datalen;
10245 } LDKCVec_C2Tuple_ChannelIdPublicKeyZZ;
10246
10247 /**
10248  * A dynamically-allocated array of crate::lightning::ln::types::ChannelIds of arbitrary size.
10249  * This corresponds to std::vector in C++
10250  */
10251 typedef struct LDKCVec_ChannelIdZ {
10252    /**
10253     * The elements in the array.
10254     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10255     */
10256    struct LDKChannelId *data;
10257    /**
10258     * The number of elements pointed to by `data`.
10259     */
10260    uintptr_t datalen;
10261 } LDKCVec_ChannelIdZ;
10262
10263
10264
10265 /**
10266  * Builds an [`Offer`] for the \"offer to be paid\" flow.
10267  *
10268  * See [module-level documentation] for usage.
10269  *
10270  * [module-level documentation]: self
10271  */
10272 typedef struct MUST_USE_STRUCT LDKOfferWithDerivedMetadataBuilder {
10273    /**
10274     * A pointer to the opaque Rust object.
10275     * Nearly everywhere, inner must be non-null, however in places where
10276     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10277     */
10278    LDKnativeOfferWithDerivedMetadataBuilder *inner;
10279    /**
10280     * Indicates that this is the only struct which contains the same pointer.
10281     * Rust functions which take ownership of an object provided via an argument require
10282     * this to be true and invalidate the object pointed to by inner.
10283     */
10284    bool is_owned;
10285 } LDKOfferWithDerivedMetadataBuilder;
10286
10287 /**
10288  * The contents of CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ
10289  */
10290 typedef union LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZPtr {
10291    /**
10292     * A pointer to the contents in the success state.
10293     * Reading from this pointer when `result_ok` is not set is undefined.
10294     */
10295    struct LDKOfferWithDerivedMetadataBuilder *result;
10296    /**
10297     * A pointer to the contents in the error state.
10298     * Reading from this pointer when `result_ok` is set is undefined.
10299     */
10300    enum LDKBolt12SemanticError *err;
10301 } LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZPtr;
10302
10303 /**
10304  * A CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
10305  * containing a crate::lightning::offers::offer::OfferWithDerivedMetadataBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
10306  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10307  */
10308 typedef struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ {
10309    /**
10310     * The contents of this CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ, accessible via either
10311     * `err` or `result` depending on the state of `result_ok`.
10312     */
10313    union LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZPtr contents;
10314    /**
10315     * Whether this CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ represents a success state.
10316     */
10317    bool result_ok;
10318 } LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ;
10319
10320 /**
10321  * An enum which can either contain a crate::c_types::Str or not
10322  */
10323 typedef enum LDKCOption_StrZ_Tag {
10324    /**
10325     * When we're in this state, this COption_StrZ contains a crate::c_types::Str
10326     */
10327    LDKCOption_StrZ_Some,
10328    /**
10329     * When we're in this state, this COption_StrZ contains nothing
10330     */
10331    LDKCOption_StrZ_None,
10332    /**
10333     * Must be last for serialization purposes
10334     */
10335    LDKCOption_StrZ_Sentinel,
10336 } LDKCOption_StrZ_Tag;
10337
10338 typedef struct LDKCOption_StrZ {
10339    LDKCOption_StrZ_Tag tag;
10340    union {
10341       struct {
10342          struct LDKStr some;
10343       };
10344    };
10345 } LDKCOption_StrZ;
10346
10347 /**
10348  * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ
10349  */
10350 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr {
10351    /**
10352     * A pointer to the contents in the success state.
10353     * Reading from this pointer when `result_ok` is not set is undefined.
10354     */
10355    struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
10356    /**
10357     * Note that this value is always NULL, as there are no contents in the Err variant
10358     */
10359    void *err;
10360 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr;
10361
10362 /**
10363  * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents the result of a fallible operation,
10364  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a () on failure.
10365  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10366  */
10367 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ {
10368    /**
10369     * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ, accessible via either
10370     * `err` or `result` depending on the state of `result_ok`.
10371     */
10372    union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr contents;
10373    /**
10374     * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents a success state.
10375     */
10376    bool result_ok;
10377 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ;
10378
10379 /**
10380  * The contents of CResult_ThirtyTwoBytesAPIErrorZ
10381  */
10382 typedef union LDKCResult_ThirtyTwoBytesAPIErrorZPtr {
10383    /**
10384     * A pointer to the contents in the success state.
10385     * Reading from this pointer when `result_ok` is not set is undefined.
10386     */
10387    struct LDKThirtyTwoBytes *result;
10388    /**
10389     * A pointer to the contents in the error state.
10390     * Reading from this pointer when `result_ok` is set is undefined.
10391     */
10392    struct LDKAPIError *err;
10393 } LDKCResult_ThirtyTwoBytesAPIErrorZPtr;
10394
10395 /**
10396  * A CResult_ThirtyTwoBytesAPIErrorZ represents the result of a fallible operation,
10397  * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
10398  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10399  */
10400 typedef struct LDKCResult_ThirtyTwoBytesAPIErrorZ {
10401    /**
10402     * The contents of this CResult_ThirtyTwoBytesAPIErrorZ, accessible via either
10403     * `err` or `result` depending on the state of `result_ok`.
10404     */
10405    union LDKCResult_ThirtyTwoBytesAPIErrorZPtr contents;
10406    /**
10407     * Whether this CResult_ThirtyTwoBytesAPIErrorZ represents a success state.
10408     */
10409    bool result_ok;
10410 } LDKCResult_ThirtyTwoBytesAPIErrorZ;
10411
10412
10413
10414 /**
10415  * An `InvoiceRequest` is a request for a [`Bolt12Invoice`] formulated from an [`Offer`].
10416  *
10417  * An offer may provide choices such as quantity, amount, chain, features, etc. An invoice request
10418  * specifies these such that its recipient can send an invoice for payment.
10419  *
10420  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
10421  * [`Offer`]: crate::offers::offer::Offer
10422  */
10423 typedef struct MUST_USE_STRUCT LDKInvoiceRequest {
10424    /**
10425     * A pointer to the opaque Rust object.
10426     * Nearly everywhere, inner must be non-null, however in places where
10427     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10428     */
10429    LDKnativeInvoiceRequest *inner;
10430    /**
10431     * Indicates that this is the only struct which contains the same pointer.
10432     * Rust functions which take ownership of an object provided via an argument require
10433     * this to be true and invalidate the object pointed to by inner.
10434     */
10435    bool is_owned;
10436 } LDKInvoiceRequest;
10437
10438
10439
10440 /**
10441  * An error in response to an [`InvoiceRequest`] or an [`Bolt12Invoice`].
10442  *
10443  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
10444  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
10445  */
10446 typedef struct MUST_USE_STRUCT LDKInvoiceError {
10447    /**
10448     * A pointer to the opaque Rust object.
10449     * Nearly everywhere, inner must be non-null, however in places where
10450     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10451     */
10452    LDKnativeInvoiceError *inner;
10453    /**
10454     * Indicates that this is the only struct which contains the same pointer.
10455     * Rust functions which take ownership of an object provided via an argument require
10456     * this to be true and invalidate the object pointed to by inner.
10457     */
10458    bool is_owned;
10459 } LDKInvoiceError;
10460
10461 /**
10462  * Possible BOLT 12 Offers messages sent and received via an [`OnionMessage`].
10463  *
10464  * [`OnionMessage`]: crate::ln::msgs::OnionMessage
10465  */
10466 typedef enum LDKOffersMessage_Tag {
10467    /**
10468     * A request for a [`Bolt12Invoice`] for a particular [`Offer`].
10469     *
10470     * [`Offer`]: crate::offers::offer::Offer
10471     */
10472    LDKOffersMessage_InvoiceRequest,
10473    /**
10474     * A [`Bolt12Invoice`] sent in response to an [`InvoiceRequest`] or a [`Refund`].
10475     *
10476     * [`Refund`]: crate::offers::refund::Refund
10477     */
10478    LDKOffersMessage_Invoice,
10479    /**
10480     * An error from handling an [`OffersMessage`].
10481     */
10482    LDKOffersMessage_InvoiceError,
10483    /**
10484     * Must be last for serialization purposes
10485     */
10486    LDKOffersMessage_Sentinel,
10487 } LDKOffersMessage_Tag;
10488
10489 typedef struct MUST_USE_STRUCT LDKOffersMessage {
10490    LDKOffersMessage_Tag tag;
10491    union {
10492       struct {
10493          struct LDKInvoiceRequest invoice_request;
10494       };
10495       struct {
10496          struct LDKBolt12Invoice invoice;
10497       };
10498       struct {
10499          struct LDKInvoiceError invoice_error;
10500       };
10501    };
10502 } LDKOffersMessage;
10503
10504 /**
10505  * An enum which can either contain a crate::lightning::onion_message::offers::OffersMessage or not
10506  */
10507 typedef enum LDKCOption_OffersMessageZ_Tag {
10508    /**
10509     * When we're in this state, this COption_OffersMessageZ contains a crate::lightning::onion_message::offers::OffersMessage
10510     */
10511    LDKCOption_OffersMessageZ_Some,
10512    /**
10513     * When we're in this state, this COption_OffersMessageZ contains nothing
10514     */
10515    LDKCOption_OffersMessageZ_None,
10516    /**
10517     * Must be last for serialization purposes
10518     */
10519    LDKCOption_OffersMessageZ_Sentinel,
10520 } LDKCOption_OffersMessageZ_Tag;
10521
10522 typedef struct LDKCOption_OffersMessageZ {
10523    LDKCOption_OffersMessageZ_Tag tag;
10524    union {
10525       struct {
10526          struct LDKOffersMessage some;
10527       };
10528    };
10529 } LDKCOption_OffersMessageZ;
10530
10531 /**
10532  * The destination of an onion message.
10533  */
10534 typedef enum LDKDestination_Tag {
10535    /**
10536     * We're sending this onion message to a node.
10537     */
10538    LDKDestination_Node,
10539    /**
10540     * We're sending this onion message to a blinded path.
10541     */
10542    LDKDestination_BlindedPath,
10543    /**
10544     * Must be last for serialization purposes
10545     */
10546    LDKDestination_Sentinel,
10547 } LDKDestination_Tag;
10548
10549 typedef struct MUST_USE_STRUCT LDKDestination {
10550    LDKDestination_Tag tag;
10551    union {
10552       struct {
10553          struct LDKPublicKey node;
10554       };
10555       struct {
10556          struct LDKBlindedPath blinded_path;
10557       };
10558    };
10559 } LDKDestination;
10560
10561 /**
10562  * A tuple of 3 elements. See the individual fields for the types contained.
10563  */
10564 typedef struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ {
10565    /**
10566     * The element at position 0
10567     */
10568    struct LDKOffersMessage a;
10569    /**
10570     * The element at position 1
10571     */
10572    struct LDKDestination b;
10573    /**
10574     * The element at position 2
10575     */
10576    struct LDKBlindedPath c;
10577 } LDKC3Tuple_OffersMessageDestinationBlindedPathZ;
10578
10579 /**
10580  * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OffersMessageDestinationBlindedPathZs of arbitrary size.
10581  * This corresponds to std::vector in C++
10582  */
10583 typedef struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ {
10584    /**
10585     * The elements in the array.
10586     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10587     */
10588    struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *data;
10589    /**
10590     * The number of elements pointed to by `data`.
10591     */
10592    uintptr_t datalen;
10593 } LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ;
10594
10595
10596
10597 /**
10598  * Route hints used in constructing invoices for [phantom node payents].
10599  *
10600  * [phantom node payments]: crate::sign::PhantomKeysManager
10601  */
10602 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
10603    /**
10604     * A pointer to the opaque Rust object.
10605     * Nearly everywhere, inner must be non-null, however in places where
10606     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10607     */
10608    LDKnativePhantomRouteHints *inner;
10609    /**
10610     * Indicates that this is the only struct which contains the same pointer.
10611     * Rust functions which take ownership of an object provided via an argument require
10612     * this to be true and invalidate the object pointed to by inner.
10613     */
10614    bool is_owned;
10615 } LDKPhantomRouteHints;
10616
10617 /**
10618  * The contents of CResult_PhantomRouteHintsDecodeErrorZ
10619  */
10620 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
10621    /**
10622     * A pointer to the contents in the success state.
10623     * Reading from this pointer when `result_ok` is not set is undefined.
10624     */
10625    struct LDKPhantomRouteHints *result;
10626    /**
10627     * A pointer to the contents in the error state.
10628     * Reading from this pointer when `result_ok` is set is undefined.
10629     */
10630    struct LDKDecodeError *err;
10631 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
10632
10633 /**
10634  * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
10635  * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
10636  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10637  */
10638 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
10639    /**
10640     * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
10641     * `err` or `result` depending on the state of `result_ok`.
10642     */
10643    union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
10644    /**
10645     * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
10646     */
10647    bool result_ok;
10648 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
10649
10650
10651
10652 /**
10653  * Information used to forward or fail this HTLC that is being forwarded within a blinded path.
10654  */
10655 typedef struct MUST_USE_STRUCT LDKBlindedForward {
10656    /**
10657     * A pointer to the opaque Rust object.
10658     * Nearly everywhere, inner must be non-null, however in places where
10659     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10660     */
10661    LDKnativeBlindedForward *inner;
10662    /**
10663     * Indicates that this is the only struct which contains the same pointer.
10664     * Rust functions which take ownership of an object provided via an argument require
10665     * this to be true and invalidate the object pointed to by inner.
10666     */
10667    bool is_owned;
10668 } LDKBlindedForward;
10669
10670 /**
10671  * The contents of CResult_BlindedForwardDecodeErrorZ
10672  */
10673 typedef union LDKCResult_BlindedForwardDecodeErrorZPtr {
10674    /**
10675     * A pointer to the contents in the success state.
10676     * Reading from this pointer when `result_ok` is not set is undefined.
10677     */
10678    struct LDKBlindedForward *result;
10679    /**
10680     * A pointer to the contents in the error state.
10681     * Reading from this pointer when `result_ok` is set is undefined.
10682     */
10683    struct LDKDecodeError *err;
10684 } LDKCResult_BlindedForwardDecodeErrorZPtr;
10685
10686 /**
10687  * A CResult_BlindedForwardDecodeErrorZ represents the result of a fallible operation,
10688  * containing a crate::lightning::ln::channelmanager::BlindedForward on success and a crate::lightning::ln::msgs::DecodeError on failure.
10689  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10690  */
10691 typedef struct LDKCResult_BlindedForwardDecodeErrorZ {
10692    /**
10693     * The contents of this CResult_BlindedForwardDecodeErrorZ, accessible via either
10694     * `err` or `result` depending on the state of `result_ok`.
10695     */
10696    union LDKCResult_BlindedForwardDecodeErrorZPtr contents;
10697    /**
10698     * Whether this CResult_BlindedForwardDecodeErrorZ represents a success state.
10699     */
10700    bool result_ok;
10701 } LDKCResult_BlindedForwardDecodeErrorZ;
10702
10703
10704
10705 /**
10706  * BOLT 4 onion packet including hop data for the next peer.
10707  */
10708 typedef struct MUST_USE_STRUCT LDKOnionPacket {
10709    /**
10710     * A pointer to the opaque Rust object.
10711     * Nearly everywhere, inner must be non-null, however in places where
10712     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10713     */
10714    LDKnativeOnionPacket *inner;
10715    /**
10716     * Indicates that this is the only struct which contains the same pointer.
10717     * Rust functions which take ownership of an object provided via an argument require
10718     * this to be true and invalidate the object pointed to by inner.
10719     */
10720    bool is_owned;
10721 } LDKOnionPacket;
10722
10723
10724
10725 /**
10726  * Information communicated in the onion to the recipient for multi-part tracking and proof that
10727  * the payment is associated with an invoice.
10728  */
10729 typedef struct MUST_USE_STRUCT LDKFinalOnionHopData {
10730    /**
10731     * A pointer to the opaque Rust object.
10732     * Nearly everywhere, inner must be non-null, however in places where
10733     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10734     */
10735    LDKnativeFinalOnionHopData *inner;
10736    /**
10737     * Indicates that this is the only struct which contains the same pointer.
10738     * Rust functions which take ownership of an object provided via an argument require
10739     * this to be true and invalidate the object pointed to by inner.
10740     */
10741    bool is_owned;
10742 } LDKFinalOnionHopData;
10743
10744 /**
10745  * Information about where a received HTLC('s onion) has indicated the HTLC should go.
10746  */
10747 typedef enum LDKPendingHTLCRouting_Tag {
10748    /**
10749     * An HTLC which should be forwarded on to another node.
10750     */
10751    LDKPendingHTLCRouting_Forward,
10752    /**
10753     * The onion indicates that this is a payment for an invoice (supposedly) generated by us.
10754     *
10755     * Note that at this point, we have not checked that the invoice being paid was actually
10756     * generated by us, but rather it's claiming to pay an invoice of ours.
10757     */
10758    LDKPendingHTLCRouting_Receive,
10759    /**
10760     * The onion indicates that this is for payment to us but which contains the preimage for
10761     * claiming included, and is unrelated to any invoice we'd previously generated (aka a
10762     * \"keysend\" or \"spontaneous\" payment).
10763     */
10764    LDKPendingHTLCRouting_ReceiveKeysend,
10765    /**
10766     * Must be last for serialization purposes
10767     */
10768    LDKPendingHTLCRouting_Sentinel,
10769 } LDKPendingHTLCRouting_Tag;
10770
10771 typedef struct LDKPendingHTLCRouting_LDKForward_Body {
10772    /**
10773     * The onion which should be included in the forwarded HTLC, telling the next hop what to
10774     * do with the HTLC.
10775     */
10776    struct LDKOnionPacket onion_packet;
10777    /**
10778     * The short channel ID of the channel which we were instructed to forward this HTLC to.
10779     *
10780     * This could be a real on-chain SCID, an SCID alias, or some other SCID which has meaning
10781     * to the receiving node, such as one returned from
10782     * [`ChannelManager::get_intercept_scid`] or [`ChannelManager::get_phantom_scid`].
10783     */
10784    uint64_t short_channel_id;
10785    /**
10786     * Set if this HTLC is being forwarded within a blinded path.
10787     *
10788     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
10789     */
10790    struct LDKBlindedForward blinded;
10791 } LDKPendingHTLCRouting_LDKForward_Body;
10792
10793 typedef struct LDKPendingHTLCRouting_LDKReceive_Body {
10794    /**
10795     * Information about the amount the sender intended to pay and (potential) proof that this
10796     * is a payment for an invoice we generated. This proof of payment is is also used for
10797     * linking MPP parts of a larger payment.
10798     */
10799    struct LDKFinalOnionHopData payment_data;
10800    /**
10801     * Additional data which we (allegedly) instructed the sender to include in the onion.
10802     *
10803     * For HTLCs received by LDK, this will ultimately be exposed in
10804     * [`Event::PaymentClaimable::onion_fields`] as
10805     * [`RecipientOnionFields::payment_metadata`].
10806     */
10807    struct LDKCOption_CVec_u8ZZ payment_metadata;
10808    /**
10809     * The context of the payment included by the recipient in a blinded path, or `None` if a
10810     * blinded path was not used.
10811     *
10812     * Used in part to determine the [`events::PaymentPurpose`].
10813     */
10814    struct LDKCOption_PaymentContextZ payment_context;
10815    /**
10816     * CLTV expiry of the received HTLC.
10817     *
10818     * Used to track when we should expire pending HTLCs that go unclaimed.
10819     */
10820    uint32_t incoming_cltv_expiry;
10821    /**
10822     * If the onion had forwarding instructions to one of our phantom node SCIDs, this will
10823     * provide the onion shared secret used to decrypt the next level of forwarding
10824     * instructions.
10825     *
10826     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
10827     */
10828    struct LDKThirtyTwoBytes phantom_shared_secret;
10829    /**
10830     * Custom TLVs which were set by the sender.
10831     *
10832     * For HTLCs received by LDK, this will ultimately be exposed in
10833     * [`Event::PaymentClaimable::onion_fields`] as
10834     * [`RecipientOnionFields::custom_tlvs`].
10835     */
10836    struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs;
10837    /**
10838     * Set if this HTLC is the final hop in a multi-hop blinded path.
10839     */
10840    bool requires_blinded_error;
10841 } LDKPendingHTLCRouting_LDKReceive_Body;
10842
10843 typedef struct LDKPendingHTLCRouting_LDKReceiveKeysend_Body {
10844    /**
10845     * Information about the amount the sender intended to pay and possibly a token to
10846     * associate MPP parts of a larger payment.
10847     *
10848     * This will only be filled in if receiving MPP keysend payments is enabled, and it being
10849     * present will cause deserialization to fail on versions of LDK prior to 0.0.116.
10850     *
10851     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
10852     */
10853    struct LDKFinalOnionHopData payment_data;
10854    /**
10855     * Preimage for this onion payment. This preimage is provided by the sender and will be
10856     * used to settle the spontaneous payment.
10857     */
10858    struct LDKThirtyTwoBytes payment_preimage;
10859    /**
10860     * Additional data which we (allegedly) instructed the sender to include in the onion.
10861     *
10862     * For HTLCs received by LDK, this will ultimately bubble back up as
10863     * [`RecipientOnionFields::payment_metadata`].
10864     */
10865    struct LDKCOption_CVec_u8ZZ payment_metadata;
10866    /**
10867     * CLTV expiry of the received HTLC.
10868     *
10869     * Used to track when we should expire pending HTLCs that go unclaimed.
10870     */
10871    uint32_t incoming_cltv_expiry;
10872    /**
10873     * Custom TLVs which were set by the sender.
10874     *
10875     * For HTLCs received by LDK, these will ultimately bubble back up as
10876     * [`RecipientOnionFields::custom_tlvs`].
10877     */
10878    struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs;
10879    /**
10880     * Set if this HTLC is the final hop in a multi-hop blinded path.
10881     */
10882    bool requires_blinded_error;
10883 } LDKPendingHTLCRouting_LDKReceiveKeysend_Body;
10884
10885 typedef struct MUST_USE_STRUCT LDKPendingHTLCRouting {
10886    LDKPendingHTLCRouting_Tag tag;
10887    union {
10888       LDKPendingHTLCRouting_LDKForward_Body forward;
10889       LDKPendingHTLCRouting_LDKReceive_Body receive;
10890       LDKPendingHTLCRouting_LDKReceiveKeysend_Body receive_keysend;
10891    };
10892 } LDKPendingHTLCRouting;
10893
10894 /**
10895  * The contents of CResult_PendingHTLCRoutingDecodeErrorZ
10896  */
10897 typedef union LDKCResult_PendingHTLCRoutingDecodeErrorZPtr {
10898    /**
10899     * A pointer to the contents in the success state.
10900     * Reading from this pointer when `result_ok` is not set is undefined.
10901     */
10902    struct LDKPendingHTLCRouting *result;
10903    /**
10904     * A pointer to the contents in the error state.
10905     * Reading from this pointer when `result_ok` is set is undefined.
10906     */
10907    struct LDKDecodeError *err;
10908 } LDKCResult_PendingHTLCRoutingDecodeErrorZPtr;
10909
10910 /**
10911  * A CResult_PendingHTLCRoutingDecodeErrorZ represents the result of a fallible operation,
10912  * containing a crate::lightning::ln::channelmanager::PendingHTLCRouting on success and a crate::lightning::ln::msgs::DecodeError on failure.
10913  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10914  */
10915 typedef struct LDKCResult_PendingHTLCRoutingDecodeErrorZ {
10916    /**
10917     * The contents of this CResult_PendingHTLCRoutingDecodeErrorZ, accessible via either
10918     * `err` or `result` depending on the state of `result_ok`.
10919     */
10920    union LDKCResult_PendingHTLCRoutingDecodeErrorZPtr contents;
10921    /**
10922     * Whether this CResult_PendingHTLCRoutingDecodeErrorZ represents a success state.
10923     */
10924    bool result_ok;
10925 } LDKCResult_PendingHTLCRoutingDecodeErrorZ;
10926
10927 /**
10928  * The contents of CResult_PendingHTLCInfoDecodeErrorZ
10929  */
10930 typedef union LDKCResult_PendingHTLCInfoDecodeErrorZPtr {
10931    /**
10932     * A pointer to the contents in the success state.
10933     * Reading from this pointer when `result_ok` is not set is undefined.
10934     */
10935    struct LDKPendingHTLCInfo *result;
10936    /**
10937     * A pointer to the contents in the error state.
10938     * Reading from this pointer when `result_ok` is set is undefined.
10939     */
10940    struct LDKDecodeError *err;
10941 } LDKCResult_PendingHTLCInfoDecodeErrorZPtr;
10942
10943 /**
10944  * A CResult_PendingHTLCInfoDecodeErrorZ represents the result of a fallible operation,
10945  * containing a crate::lightning::ln::channelmanager::PendingHTLCInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
10946  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10947  */
10948 typedef struct LDKCResult_PendingHTLCInfoDecodeErrorZ {
10949    /**
10950     * The contents of this CResult_PendingHTLCInfoDecodeErrorZ, accessible via either
10951     * `err` or `result` depending on the state of `result_ok`.
10952     */
10953    union LDKCResult_PendingHTLCInfoDecodeErrorZPtr contents;
10954    /**
10955     * Whether this CResult_PendingHTLCInfoDecodeErrorZ represents a success state.
10956     */
10957    bool result_ok;
10958 } LDKCResult_PendingHTLCInfoDecodeErrorZ;
10959
10960 /**
10961  * The contents of CResult_BlindedFailureDecodeErrorZ
10962  */
10963 typedef union LDKCResult_BlindedFailureDecodeErrorZPtr {
10964    /**
10965     * A pointer to the contents in the success state.
10966     * Reading from this pointer when `result_ok` is not set is undefined.
10967     */
10968    enum LDKBlindedFailure *result;
10969    /**
10970     * A pointer to the contents in the error state.
10971     * Reading from this pointer when `result_ok` is set is undefined.
10972     */
10973    struct LDKDecodeError *err;
10974 } LDKCResult_BlindedFailureDecodeErrorZPtr;
10975
10976 /**
10977  * A CResult_BlindedFailureDecodeErrorZ represents the result of a fallible operation,
10978  * containing a crate::lightning::ln::channelmanager::BlindedFailure on success and a crate::lightning::ln::msgs::DecodeError on failure.
10979  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10980  */
10981 typedef struct LDKCResult_BlindedFailureDecodeErrorZ {
10982    /**
10983     * The contents of this CResult_BlindedFailureDecodeErrorZ, accessible via either
10984     * `err` or `result` depending on the state of `result_ok`.
10985     */
10986    union LDKCResult_BlindedFailureDecodeErrorZPtr contents;
10987    /**
10988     * Whether this CResult_BlindedFailureDecodeErrorZ represents a success state.
10989     */
10990    bool result_ok;
10991 } LDKCResult_BlindedFailureDecodeErrorZ;
10992
10993
10994
10995 /**
10996  * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
10997  * on-chain transactions to ensure no loss of funds occurs.
10998  *
10999  * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
11000  * information and are actively monitoring the chain.
11001  *
11002  * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
11003  * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
11004  * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
11005  * returned block hash and the the current chain and then reconnecting blocks to get to the
11006  * best chain) upon deserializing the object!
11007  */
11008 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
11009    /**
11010     * A pointer to the opaque Rust object.
11011     * Nearly everywhere, inner must be non-null, however in places where
11012     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11013     */
11014    LDKnativeChannelMonitor *inner;
11015    /**
11016     * Indicates that this is the only struct which contains the same pointer.
11017     * Rust functions which take ownership of an object provided via an argument require
11018     * this to be true and invalidate the object pointed to by inner.
11019     */
11020    bool is_owned;
11021 } LDKChannelMonitor;
11022
11023 /**
11024  * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
11025  * This corresponds to std::vector in C++
11026  */
11027 typedef struct LDKCVec_ChannelMonitorZ {
11028    /**
11029     * The elements in the array.
11030     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11031     */
11032    struct LDKChannelMonitor *data;
11033    /**
11034     * The number of elements pointed to by `data`.
11035     */
11036    uintptr_t datalen;
11037 } LDKCVec_ChannelMonitorZ;
11038
11039
11040
11041 /**
11042  * An update generated by the underlying channel itself which contains some new information the
11043  * [`ChannelMonitor`] should be made aware of.
11044  *
11045  * Because this represents only a small number of updates to the underlying state, it is generally
11046  * much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
11047  * updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
11048  * transaction), a single update may reach upwards of 1 MiB in serialized size.
11049  */
11050 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
11051    /**
11052     * A pointer to the opaque Rust object.
11053     * Nearly everywhere, inner must be non-null, however in places where
11054     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11055     */
11056    LDKnativeChannelMonitorUpdate *inner;
11057    /**
11058     * Indicates that this is the only struct which contains the same pointer.
11059     * Rust functions which take ownership of an object provided via an argument require
11060     * this to be true and invalidate the object pointed to by inner.
11061     */
11062    bool is_owned;
11063 } LDKChannelMonitorUpdate;
11064
11065 /**
11066  * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
11067  * blocks are connected and disconnected.
11068  *
11069  * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
11070  * responsible for maintaining a set of monitors such that they can be updated as channel state
11071  * changes. On each update, *all copies* of a [`ChannelMonitor`] must be updated and the update
11072  * persisted to disk to ensure that the latest [`ChannelMonitor`] state can be reloaded if the
11073  * application crashes.
11074  *
11075  * See method documentation and [`ChannelMonitorUpdateStatus`] for specific requirements.
11076  */
11077 typedef struct LDKWatch {
11078    /**
11079     * An opaque pointer which is passed to your function implementations as an argument.
11080     * This has no meaning in the LDK, and can be NULL or any other value.
11081     */
11082    void *this_arg;
11083    /**
11084     * Watches a channel identified by `funding_txo` using `monitor`.
11085     *
11086     * Implementations are responsible for watching the chain for the funding transaction along
11087     * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
11088     * calling [`block_connected`] and [`block_disconnected`] on the monitor.
11089     *
11090     * A return of `Err(())` indicates that the channel should immediately be force-closed without
11091     * broadcasting the funding transaction.
11092     *
11093     * If the given `funding_txo` has previously been registered via `watch_channel`, `Err(())`
11094     * must be returned.
11095     *
11096     * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
11097     * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
11098     * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
11099     */
11100    struct LDKCResult_ChannelMonitorUpdateStatusNoneZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
11101    /**
11102     * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
11103     *
11104     * Implementations must call [`ChannelMonitor::update_monitor`] with the given update. This
11105     * may fail (returning an `Err(())`), in which case this should return
11106     * [`ChannelMonitorUpdateStatus::InProgress`] (and the update should never complete). This
11107     * generally implies the channel has been closed (either by the funding outpoint being spent
11108     * on-chain or the [`ChannelMonitor`] having decided to do so and broadcasted a transaction),
11109     * and the [`ChannelManager`] state will be updated once it sees the funding spend on-chain.
11110     *
11111     * In general, persistence failures should be retried after returning
11112     * [`ChannelMonitorUpdateStatus::InProgress`] and eventually complete. If a failure truly
11113     * cannot be retried, the node should shut down immediately after returning
11114     * [`ChannelMonitorUpdateStatus::UnrecoverableError`], see its documentation for more info.
11115     *
11116     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11117     */
11118    enum LDKChannelMonitorUpdateStatus (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
11119    /**
11120     * Returns any monitor events since the last call. Subsequent calls must only return new
11121     * events.
11122     *
11123     * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
11124     * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
11125     * to disk.
11126     *
11127     * For details on asynchronous [`ChannelMonitor`] updating and returning
11128     * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
11129     */
11130    struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
11131    /**
11132     * Frees any resources associated with this object given its this_arg pointer.
11133     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11134     */
11135    void (*free)(void *this_arg);
11136 } LDKWatch;
11137
11138 /**
11139  * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
11140  * This corresponds to std::vector in C++
11141  */
11142 typedef struct LDKCVec_TransactionZ {
11143    /**
11144     * The elements in the array.
11145     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11146     */
11147    struct LDKTransaction *data;
11148    /**
11149     * The number of elements pointed to by `data`.
11150     */
11151    uintptr_t datalen;
11152 } LDKCVec_TransactionZ;
11153
11154 /**
11155  * An interface to send a transaction to the Bitcoin network.
11156  */
11157 typedef struct LDKBroadcasterInterface {
11158    /**
11159     * An opaque pointer which is passed to your function implementations as an argument.
11160     * This has no meaning in the LDK, and can be NULL or any other value.
11161     */
11162    void *this_arg;
11163    /**
11164     * Sends a list of transactions out to (hopefully) be mined.
11165     * This only needs to handle the actual broadcasting of transactions, LDK will automatically
11166     * rebroadcast transactions that haven't made it into a block.
11167     *
11168     * In some cases LDK may attempt to broadcast a transaction which double-spends another
11169     * and this isn't a bug and can be safely ignored.
11170     *
11171     * If more than one transaction is given, these transactions should be considered to be a
11172     * package and broadcast together. Some of the transactions may or may not depend on each other,
11173     * be sure to manage both cases correctly.
11174     *
11175     * Bitcoin transaction packages are defined in BIP 331 and here:
11176     * <https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md>
11177     */
11178    void (*broadcast_transactions)(const void *this_arg, struct LDKCVec_TransactionZ txs);
11179    /**
11180     * Frees any resources associated with this object given its this_arg pointer.
11181     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11182     */
11183    void (*free)(void *this_arg);
11184 } LDKBroadcasterInterface;
11185
11186 /**
11187  * A trait that describes a source of entropy.
11188  */
11189 typedef struct LDKEntropySource {
11190    /**
11191     * An opaque pointer which is passed to your function implementations as an argument.
11192     * This has no meaning in the LDK, and can be NULL or any other value.
11193     */
11194    void *this_arg;
11195    /**
11196     * Gets a unique, cryptographically-secure, random 32-byte value. This method must return a
11197     * different value each time it is called.
11198     */
11199    struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
11200    /**
11201     * Frees any resources associated with this object given its this_arg pointer.
11202     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11203     */
11204    void (*free)(void *this_arg);
11205 } LDKEntropySource;
11206
11207
11208
11209 /**
11210  * A semantically valid [`InvoiceRequest`] that hasn't been signed.
11211  *
11212  * # Serialization
11213  *
11214  * This is serialized as a TLV stream, which includes TLV records from the originating message. As
11215  * such, it may include unknown, odd TLV records.
11216  */
11217 typedef struct MUST_USE_STRUCT LDKUnsignedInvoiceRequest {
11218    /**
11219     * A pointer to the opaque Rust object.
11220     * Nearly everywhere, inner must be non-null, however in places where
11221     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11222     */
11223    LDKnativeUnsignedInvoiceRequest *inner;
11224    /**
11225     * Indicates that this is the only struct which contains the same pointer.
11226     * Rust functions which take ownership of an object provided via an argument require
11227     * this to be true and invalidate the object pointed to by inner.
11228     */
11229    bool is_owned;
11230 } LDKUnsignedInvoiceRequest;
11231
11232
11233
11234 /**
11235  * The unsigned part of a [`channel_update`] message.
11236  *
11237  * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
11238  */
11239 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
11240    /**
11241     * A pointer to the opaque Rust object.
11242     * Nearly everywhere, inner must be non-null, however in places where
11243     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11244     */
11245    LDKnativeUnsignedChannelUpdate *inner;
11246    /**
11247     * Indicates that this is the only struct which contains the same pointer.
11248     * Rust functions which take ownership of an object provided via an argument require
11249     * this to be true and invalidate the object pointed to by inner.
11250     */
11251    bool is_owned;
11252 } LDKUnsignedChannelUpdate;
11253
11254
11255
11256 /**
11257  * The unsigned part of a [`node_announcement`] message.
11258  *
11259  * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
11260  */
11261 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
11262    /**
11263     * A pointer to the opaque Rust object.
11264     * Nearly everywhere, inner must be non-null, however in places where
11265     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11266     */
11267    LDKnativeUnsignedNodeAnnouncement *inner;
11268    /**
11269     * Indicates that this is the only struct which contains the same pointer.
11270     * Rust functions which take ownership of an object provided via an argument require
11271     * this to be true and invalidate the object pointed to by inner.
11272     */
11273    bool is_owned;
11274 } LDKUnsignedNodeAnnouncement;
11275
11276 /**
11277  * Represents the set of gossip messages that require a signature from a node's identity key.
11278  */
11279 typedef enum LDKUnsignedGossipMessage_Tag {
11280    /**
11281     * An unsigned channel announcement.
11282     */
11283    LDKUnsignedGossipMessage_ChannelAnnouncement,
11284    /**
11285     * An unsigned channel update.
11286     */
11287    LDKUnsignedGossipMessage_ChannelUpdate,
11288    /**
11289     * An unsigned node announcement.
11290     */
11291    LDKUnsignedGossipMessage_NodeAnnouncement,
11292    /**
11293     * Must be last for serialization purposes
11294     */
11295    LDKUnsignedGossipMessage_Sentinel,
11296 } LDKUnsignedGossipMessage_Tag;
11297
11298 typedef struct MUST_USE_STRUCT LDKUnsignedGossipMessage {
11299    LDKUnsignedGossipMessage_Tag tag;
11300    union {
11301       struct {
11302          struct LDKUnsignedChannelAnnouncement channel_announcement;
11303       };
11304       struct {
11305          struct LDKUnsignedChannelUpdate channel_update;
11306       };
11307       struct {
11308          struct LDKUnsignedNodeAnnouncement node_announcement;
11309       };
11310    };
11311 } LDKUnsignedGossipMessage;
11312
11313 /**
11314  * A trait that can handle cryptographic operations at the scope level of a node.
11315  */
11316 typedef struct LDKNodeSigner {
11317    /**
11318     * An opaque pointer which is passed to your function implementations as an argument.
11319     * This has no meaning in the LDK, and can be NULL or any other value.
11320     */
11321    void *this_arg;
11322    /**
11323     * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
11324     *
11325     * If the implementor of this trait supports [phantom node payments], then every node that is
11326     * intended to be included in the phantom invoice route hints must return the same value from
11327     * this method.
11328     *
11329     * This method must return the same value each time it is called.
11330     *
11331     * [phantom node payments]: PhantomKeysManager
11332     */
11333    struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
11334    /**
11335     * Get node id based on the provided [`Recipient`].
11336     *
11337     * This method must return the same value each time it is called with a given [`Recipient`]
11338     * parameter.
11339     *
11340     * Errors if the [`Recipient`] variant is not supported by the implementation.
11341     */
11342    struct LDKCResult_PublicKeyNoneZ (*get_node_id)(const void *this_arg, enum LDKRecipient recipient);
11343    /**
11344     * Gets the ECDH shared secret of our node secret and `other_key`, multiplying by `tweak` if
11345     * one is provided. Note that this tweak can be applied to `other_key` instead of our node
11346     * secret, though this is less efficient.
11347     *
11348     * Note that if this fails while attempting to forward an HTLC, LDK will panic. The error
11349     * should be resolved to allow LDK to resume forwarding HTLCs.
11350     *
11351     * Errors if the [`Recipient`] variant is not supported by the implementation.
11352     */
11353    struct LDKCResult_ThirtyTwoBytesNoneZ (*ecdh)(const void *this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_BigEndianScalarZ tweak);
11354    /**
11355     * Sign an invoice.
11356     *
11357     * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
11358     * this trait to parse the invoice and make sure they're signing what they expect, rather than
11359     * blindly signing the hash.
11360     *
11361     * The `hrp_bytes` are ASCII bytes, while the `invoice_data` is base32.
11362     *
11363     * The secret key used to sign the invoice is dependent on the [`Recipient`].
11364     *
11365     * Errors if the [`Recipient`] variant is not supported by the implementation.
11366     */
11367    struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient);
11368    /**
11369     * Signs the [`TaggedHash`] of a BOLT 12 invoice request.
11370     *
11371     * May be called by a function passed to [`UnsignedInvoiceRequest::sign`] where
11372     * `invoice_request` is the callee.
11373     *
11374     * Implementors may check that the `invoice_request` is expected rather than blindly signing
11375     * the tagged hash. An `Ok` result should sign `invoice_request.tagged_hash().as_digest()` with
11376     * the node's signing key or an ephemeral key to preserve privacy, whichever is associated with
11377     * [`UnsignedInvoiceRequest::payer_id`].
11378     *
11379     * [`TaggedHash`]: crate::offers::merkle::TaggedHash
11380     */
11381    struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR invoice_request);
11382    /**
11383     * Signs the [`TaggedHash`] of a BOLT 12 invoice.
11384     *
11385     * May be called by a function passed to [`UnsignedBolt12Invoice::sign`] where `invoice` is the
11386     * callee.
11387     *
11388     * Implementors may check that the `invoice` is expected rather than blindly signing the tagged
11389     * hash. An `Ok` result should sign `invoice.tagged_hash().as_digest()` with the node's signing
11390     * key or an ephemeral key to preserve privacy, whichever is associated with
11391     * [`UnsignedBolt12Invoice::signing_pubkey`].
11392     *
11393     * [`TaggedHash`]: crate::offers::merkle::TaggedHash
11394     */
11395    struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR invoice);
11396    /**
11397     * Sign a gossip message.
11398     *
11399     * Note that if this fails, LDK may panic and the message will not be broadcast to the network
11400     * or a possible channel counterparty. If LDK panics, the error should be resolved to allow the
11401     * message to be broadcast, as otherwise it may prevent one from receiving funds over the
11402     * corresponding channel.
11403     */
11404    struct LDKCResult_ECDSASignatureNoneZ (*sign_gossip_message)(const void *this_arg, struct LDKUnsignedGossipMessage msg);
11405    /**
11406     * Frees any resources associated with this object given its this_arg pointer.
11407     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11408     */
11409    void (*free)(void *this_arg);
11410 } LDKNodeSigner;
11411
11412 /**
11413  * A trait that can return signer instances for individual channels.
11414  */
11415 typedef struct LDKSignerProvider {
11416    /**
11417     * An opaque pointer which is passed to your function implementations as an argument.
11418     * This has no meaning in the LDK, and can be NULL or any other value.
11419     */
11420    void *this_arg;
11421    /**
11422     * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::EcdsaSigner`] through
11423     * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow
11424     * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated
11425     * `channel_keys_id`.
11426     *
11427     * This method must return a different value each time it is called.
11428     */
11429    struct LDKThirtyTwoBytes (*generate_channel_keys_id)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id);
11430    /**
11431     * Derives the private key material backing a `Signer`.
11432     *
11433     * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through
11434     * [`SignerProvider::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be
11435     * re-derived from its `channel_keys_id`, which can be obtained through its trait method
11436     * [`ChannelSigner::channel_keys_id`].
11437     */
11438    struct LDKWriteableEcdsaChannelSigner (*derive_channel_signer)(const void *this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
11439    /**
11440     * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream.
11441     * This is only called during deserialization of other objects which contain
11442     * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
11443     * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
11444     * contain no versioning scheme. You may wish to include your own version prefix and ensure
11445     * you've read all of the provided bytes to ensure no corruption occurred.
11446     *
11447     * This method is slowly being phased out -- it will only be called when reading objects
11448     * written by LDK versions prior to 0.0.113.
11449     *
11450     * [`Signer`]: Self::EcdsaSigner
11451     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
11452     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11453     */
11454    struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
11455    /**
11456     * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
11457     *
11458     * If this function returns an error, this will result in a channel failing to open.
11459     *
11460     * This method should return a different value each time it is called, to avoid linking
11461     * on-chain funds across channels as controlled to the same user. `channel_keys_id` may be
11462     * used to derive a unique value for each channel.
11463     */
11464    struct LDKCResult_CVec_u8ZNoneZ (*get_destination_script)(const void *this_arg, struct LDKThirtyTwoBytes channel_keys_id);
11465    /**
11466     * Get a script pubkey which we will send funds to when closing a channel.
11467     *
11468     * If this function returns an error, this will result in a channel failing to open or close.
11469     * In the event of a failure when the counterparty is initiating a close, this can result in a
11470     * channel force close.
11471     *
11472     * This method should return a different value each time it is called, to avoid linking
11473     * on-chain funds across channels as controlled to the same user.
11474     */
11475    struct LDKCResult_ShutdownScriptNoneZ (*get_shutdown_scriptpubkey)(const void *this_arg);
11476    /**
11477     * Frees any resources associated with this object given its this_arg pointer.
11478     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11479     */
11480    void (*free)(void *this_arg);
11481 } LDKSignerProvider;
11482
11483 /**
11484  * A trait which should be implemented to provide feerate information on a number of time
11485  * horizons.
11486  *
11487  * If access to a local mempool is not feasible, feerate estimates should be fetched from a set of
11488  * third-parties hosting them. Note that this enables them to affect the propagation of your
11489  * pre-signed transactions at any time and therefore endangers the safety of channels funds. It
11490  * should be considered carefully as a deployment.
11491  *
11492  * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
11493  * called from inside the library in response to chain events, P2P events, or timer events).
11494  *
11495  * LDK may generate a substantial number of fee-estimation calls in some cases. You should
11496  * pre-calculate and cache the fee estimate results to ensure you don't substantially slow HTLC
11497  * handling.
11498  */
11499 typedef struct LDKFeeEstimator {
11500    /**
11501     * An opaque pointer which is passed to your function implementations as an argument.
11502     * This has no meaning in the LDK, and can be NULL or any other value.
11503     */
11504    void *this_arg;
11505    /**
11506     * Gets estimated satoshis of fee required per 1000 Weight-Units.
11507     *
11508     * LDK will wrap this method and ensure that the value returned is no smaller than 253
11509     * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
11510     *
11511     * The following unit conversions can be used to convert to sats/KW:
11512     *  * satoshis-per-byte * 250
11513     *  * satoshis-per-kbyte / 4
11514     */
11515    uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
11516    /**
11517     * Frees any resources associated with this object given its this_arg pointer.
11518     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11519     */
11520    void (*free)(void *this_arg);
11521 } LDKFeeEstimator;
11522
11523
11524
11525 /**
11526  * Data to construct a [`BlindedHop`] for receiving a payment. This payload is custom to LDK and
11527  * may not be valid if received by another lightning implementation.
11528  */
11529 typedef struct MUST_USE_STRUCT LDKReceiveTlvs {
11530    /**
11531     * A pointer to the opaque Rust object.
11532     * Nearly everywhere, inner must be non-null, however in places where
11533     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11534     */
11535    LDKnativeReceiveTlvs *inner;
11536    /**
11537     * Indicates that this is the only struct which contains the same pointer.
11538     * Rust functions which take ownership of an object provided via an argument require
11539     * this to be true and invalidate the object pointed to by inner.
11540     */
11541    bool is_owned;
11542 } LDKReceiveTlvs;
11543
11544 /**
11545  * A trait defining behavior for routing an [`OnionMessage`].
11546  */
11547 typedef struct LDKMessageRouter {
11548    /**
11549     * An opaque pointer which is passed to your function implementations as an argument.
11550     * This has no meaning in the LDK, and can be NULL or any other value.
11551     */
11552    void *this_arg;
11553    /**
11554     * Returns a route for sending an [`OnionMessage`] to the given [`Destination`].
11555     */
11556    struct LDKCResult_OnionMessagePathNoneZ (*find_path)(const void *this_arg, struct LDKPublicKey sender, struct LDKCVec_PublicKeyZ peers, struct LDKDestination destination);
11557    /**
11558     * Creates [`BlindedPath`]s to the `recipient` node. The nodes in `peers` are assumed to be
11559     * direct peers with the `recipient`.
11560     */
11561    struct LDKCResult_CVec_BlindedPathZNoneZ (*create_blinded_paths)(const void *this_arg, struct LDKPublicKey recipient, struct LDKCVec_PublicKeyZ peers);
11562    /**
11563     * Frees any resources associated with this object given its this_arg pointer.
11564     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11565     */
11566    void (*free)(void *this_arg);
11567 } LDKMessageRouter;
11568
11569 /**
11570  * A trait defining behavior for routing a payment.
11571  */
11572 typedef struct LDKRouter {
11573    /**
11574     * An opaque pointer which is passed to your function implementations as an argument.
11575     * This has no meaning in the LDK, and can be NULL or any other value.
11576     */
11577    void *this_arg;
11578    /**
11579     * Finds a [`Route`] for a payment between the given `payer` and a payee.
11580     *
11581     * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
11582     * and [`RouteParameters::final_value_msat`], respectively.
11583     *
11584     * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
11585     */
11586    struct LDKCResult_RouteLightningErrorZ (*find_route)(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKInFlightHtlcs inflight_htlcs);
11587    /**
11588     * Finds a [`Route`] for a payment between the given `payer` and a payee.
11589     *
11590     * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
11591     * and [`RouteParameters::final_value_msat`], respectively.
11592     *
11593     * Includes a [`PaymentHash`] and a [`PaymentId`] to be able to correlate the request with a specific
11594     * payment.
11595     *
11596     * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
11597     */
11598    struct LDKCResult_RouteLightningErrorZ (*find_route_with_id)(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKInFlightHtlcs inflight_htlcs, struct LDKThirtyTwoBytes _payment_hash, struct LDKThirtyTwoBytes _payment_id);
11599    /**
11600     * Creates [`BlindedPath`]s for payment to the `recipient` node. The channels in `first_hops`
11601     * are assumed to be with the `recipient`'s peers. The payment secret and any constraints are
11602     * given in `tlvs`.
11603     */
11604    struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ (*create_blinded_payment_paths)(const void *this_arg, struct LDKPublicKey recipient, struct LDKCVec_ChannelDetailsZ first_hops, struct LDKReceiveTlvs tlvs, uint64_t amount_msats);
11605    /**
11606     * Implementation of MessageRouter for this object.
11607     */
11608    struct LDKMessageRouter MessageRouter;
11609    /**
11610     * Frees any resources associated with this object given its this_arg pointer.
11611     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11612     */
11613    void (*free)(void *this_arg);
11614 } LDKRouter;
11615
11616
11617
11618 /**
11619  * A lightning node's channel state machine and payment management logic, which facilitates
11620  * sending, forwarding, and receiving payments through lightning channels.
11621  *
11622  * [`ChannelManager`] is parameterized by a number of components to achieve this.
11623  * - [`chain::Watch`] (typically [`ChainMonitor`]) for on-chain monitoring and enforcement of each
11624  *   channel
11625  * - [`BroadcasterInterface`] for broadcasting transactions related to opening, funding, and
11626  *   closing channels
11627  * - [`EntropySource`] for providing random data needed for cryptographic operations
11628  * - [`NodeSigner`] for cryptographic operations scoped to the node
11629  * - [`SignerProvider`] for providing signers whose operations are scoped to individual channels
11630  * - [`FeeEstimator`] to determine transaction fee rates needed to have a transaction mined in a
11631  *   timely manner
11632  * - [`Router`] for finding payment paths when initiating and retrying payments
11633  * - [`Logger`] for logging operational information of varying degrees
11634  *
11635  * Additionally, it implements the following traits:
11636  * - [`ChannelMessageHandler`] to handle off-chain channel activity from peers
11637  * - [`MessageSendEventsProvider`] to similarly send such messages to peers
11638  * - [`OffersMessageHandler`] for BOLT 12 message handling and sending
11639  * - [`EventsProvider`] to generate user-actionable [`Event`]s
11640  * - [`chain::Listen`] and [`chain::Confirm`] for notification of on-chain activity
11641  *
11642  * Thus, [`ChannelManager`] is typically used to parameterize a [`MessageHandler`] and an
11643  * [`OnionMessenger`]. The latter is required to support BOLT 12 functionality.
11644  *
11645  * # `ChannelManager` vs `ChannelMonitor`
11646  *
11647  * It's important to distinguish between the *off-chain* management and *on-chain* enforcement of
11648  * lightning channels. [`ChannelManager`] exchanges messages with peers to manage the off-chain
11649  * state of each channel. During this process, it generates a [`ChannelMonitor`] for each channel
11650  * and a [`ChannelMonitorUpdate`] for each relevant change, notifying its parameterized
11651  * [`chain::Watch`] of them.
11652  *
11653  * An implementation of [`chain::Watch`], such as [`ChainMonitor`], is responsible for aggregating
11654  * these [`ChannelMonitor`]s and applying any [`ChannelMonitorUpdate`]s to them. It then monitors
11655  * for any pertinent on-chain activity, enforcing claims as needed.
11656  *
11657  * This division of off-chain management and on-chain enforcement allows for interesting node
11658  * setups. For instance, on-chain enforcement could be moved to a separate host or have added
11659  * redundancy, possibly as a watchtower. See [`chain::Watch`] for the relevant interface.
11660  *
11661  * # Initialization
11662  *
11663  * Use [`ChannelManager::new`] with the most recent [`BlockHash`] when creating a fresh instance.
11664  * Otherwise, if restarting, construct [`ChannelManagerReadArgs`] with the necessary parameters and
11665  * references to any deserialized [`ChannelMonitor`]s that were previously persisted. Use this to
11666  * deserialize the [`ChannelManager`] and feed it any new chain data since it was last online, as
11667  * detailed in the [`ChannelManagerReadArgs`] documentation.
11668  *
11669  * ```
11670  * use bitcoin::BlockHash;
11671  * use bitcoin::network::constants::Network;
11672  * use lightning::chain::BestBlock;
11673  * # use lightning::chain::channelmonitor::ChannelMonitor;
11674  * use lightning::ln::channelmanager::{ChainParameters, ChannelManager, ChannelManagerReadArgs};
11675  * # use lightning::routing::gossip::NetworkGraph;
11676  * use lightning::util::config::UserConfig;
11677  * use lightning::util::ser::ReadableArgs;
11678  *
11679  * # fn read_channel_monitors() -> Vec<ChannelMonitor<lightning::sign::InMemorySigner>> { vec![] }
11680  * # fn example<
11681  * #     'a,
11682  * #     L: lightning::util::logger::Logger,
11683  * #     ES: lightning::sign::EntropySource,
11684  * #     S: for <'b> lightning::routing::scoring::LockableScore<'b, ScoreLookUp = SL>,
11685  * #     SL: lightning::routing::scoring::ScoreLookUp<ScoreParams = SP>,
11686  * #     SP: Sized,
11687  * #     R: lightning::io::Read,
11688  * # >(
11689  * #     fee_estimator: &dyn lightning::chain::chaininterface::FeeEstimator,
11690  * #     chain_monitor: &dyn lightning::chain::Watch<lightning::sign::InMemorySigner>,
11691  * #     tx_broadcaster: &dyn lightning::chain::chaininterface::BroadcasterInterface,
11692  * #     router: &lightning::routing::router::DefaultRouter<&NetworkGraph<&'a L>, &'a L, &ES, &S, SP, SL>,
11693  * #     logger: &L,
11694  * #     entropy_source: &ES,
11695  * #     node_signer: &dyn lightning::sign::NodeSigner,
11696  * #     signer_provider: &lightning::sign::DynSignerProvider,
11697  * #     best_block: lightning::chain::BestBlock,
11698  * #     current_timestamp: u32,
11699  * #     mut reader: R,
11700  * # ) -> Result<(), lightning::ln::msgs::DecodeError> {
11701  * // Fresh start with no channels
11702  * let params = ChainParameters {
11703  *     network: Network::Bitcoin,
11704  *     best_block,
11705  * };
11706  * let default_config = UserConfig::default();
11707  * let channel_manager = ChannelManager::new(
11708  *     fee_estimator, chain_monitor, tx_broadcaster, router, logger, entropy_source, node_signer,
11709  *     signer_provider, default_config, params, current_timestamp
11710  * );
11711  *
11712  * // Restart from deserialized data
11713  * let mut channel_monitors = read_channel_monitors();
11714  * let args = ChannelManagerReadArgs::new(
11715  *     entropy_source, node_signer, signer_provider, fee_estimator, chain_monitor, tx_broadcaster,
11716  *     router, logger, default_config, channel_monitors.iter_mut().collect()
11717  * );
11718  * let (block_hash, channel_manager) =
11719  *     <(BlockHash, ChannelManager<_, _, _, _, _, _, _, _>)>::read(&mut reader, args)?;
11720  *
11721  * // Update the ChannelManager and ChannelMonitors with the latest chain data
11722  * // ...
11723  *
11724  * // Move the monitors to the ChannelManager's chain::Watch parameter
11725  * for monitor in channel_monitors {
11726  *     chain_monitor.watch_channel(monitor.get_funding_txo().0, monitor);
11727  * }
11728  * # Ok(())
11729  * # }
11730  * ```
11731  *
11732  * # Operation
11733  *
11734  * The following is required for [`ChannelManager`] to function properly:
11735  * - Handle messages from peers using its [`ChannelMessageHandler`] implementation (typically
11736  *   called by [`PeerManager::read_event`] when processing network I/O)
11737  * - Send messages to peers obtained via its [`MessageSendEventsProvider`] implementation
11738  *   (typically initiated when [`PeerManager::process_events`] is called)
11739  * - Feed on-chain activity using either its [`chain::Listen`] or [`chain::Confirm`] implementation
11740  *   as documented by those traits
11741  * - Perform any periodic channel and payment checks by calling [`timer_tick_occurred`] roughly
11742  *   every minute
11743  * - Persist to disk whenever [`get_and_clear_needs_persistence`] returns `true` using a
11744  *   [`Persister`] such as a [`KVStore`] implementation
11745  * - Handle [`Event`]s obtained via its [`EventsProvider`] implementation
11746  *
11747  * The [`Future`] returned by [`get_event_or_persistence_needed_future`] is useful in determining
11748  * when the last two requirements need to be checked.
11749  *
11750  * The [`lightning-block-sync`] and [`lightning-transaction-sync`] crates provide utilities that
11751  * simplify feeding in on-chain activity using the [`chain::Listen`] and [`chain::Confirm`] traits,
11752  * respectively. The remaining requirements can be met using the [`lightning-background-processor`]
11753  * crate. For languages other than Rust, the availability of similar utilities may vary.
11754  *
11755  * # Channels
11756  *
11757  * [`ChannelManager`]'s primary function involves managing a channel state. Without channels,
11758  * payments can't be sent. Use [`list_channels`] or [`list_usable_channels`] for a snapshot of the
11759  * currently open channels.
11760  *
11761  * ```
11762  * # use lightning::ln::channelmanager::AChannelManager;
11763  * #
11764  * # fn example<T: AChannelManager>(channel_manager: T) {
11765  * # let channel_manager = channel_manager.get_cm();
11766  * let channels = channel_manager.list_usable_channels();
11767  * for details in channels {
11768  *     println!(\"{:?}\", details);
11769  * }
11770  * # }
11771  * ```
11772  *
11773  * Each channel is identified using a [`ChannelId`], which will change throughout the channel's
11774  * life cycle. Additionally, channels are assigned a `user_channel_id`, which is given in
11775  * [`Event`]s associated with the channel and serves as a fixed identifier but is otherwise unused
11776  * by [`ChannelManager`].
11777  *
11778  * ## Opening Channels
11779  *
11780  * To an open a channel with a peer, call [`create_channel`]. This will initiate the process of
11781  * opening an outbound channel, which requires self-funding when handling
11782  * [`Event::FundingGenerationReady`].
11783  *
11784  * ```
11785  * # use bitcoin::{ScriptBuf, Transaction};
11786  * # use bitcoin::secp256k1::PublicKey;
11787  * # use lightning::ln::channelmanager::AChannelManager;
11788  * # use lightning::events::{Event, EventsProvider};
11789  * #
11790  * # trait Wallet {
11791  * #     fn create_funding_transaction(
11792  * #         &self, _amount_sats: u64, _output_script: ScriptBuf
11793  * #     ) -> Transaction;
11794  * # }
11795  * #
11796  * # fn example<T: AChannelManager, W: Wallet>(channel_manager: T, wallet: W, peer_id: PublicKey) {
11797  * # let channel_manager = channel_manager.get_cm();
11798  * let value_sats = 1_000_000;
11799  * let push_msats = 10_000_000;
11800  * match channel_manager.create_channel(peer_id, value_sats, push_msats, 42, None, None) {
11801  *     Ok(channel_id) => println!(\"Opening channel {}\", channel_id),
11802  *     Err(e) => println!(\"Error opening channel: {:?}\", e),
11803  * }
11804  *
11805  * // On the event processing thread once the peer has responded
11806  * channel_manager.process_pending_events(&|event| match event {
11807  *     Event::FundingGenerationReady {
11808  *         temporary_channel_id, counterparty_node_id, channel_value_satoshis, output_script,
11809  *         user_channel_id, ..
11810  *     } => {
11811  *         assert_eq!(user_channel_id, 42);
11812  *         let funding_transaction = wallet.create_funding_transaction(
11813  *             channel_value_satoshis, output_script
11814  *         );
11815  *         match channel_manager.funding_transaction_generated(
11816  *             &temporary_channel_id, &counterparty_node_id, funding_transaction
11817  *         ) {
11818  *             Ok(()) => println!(\"Funding channel {}\", temporary_channel_id),
11819  *             Err(e) => println!(\"Error funding channel {}: {:?}\", temporary_channel_id, e),
11820  *         }
11821  *     },
11822  *     Event::ChannelPending { channel_id, user_channel_id, former_temporary_channel_id, .. } => {
11823  *         assert_eq!(user_channel_id, 42);
11824  *         println!(
11825  *             \"Channel {} now {} pending (funding transaction has been broadcasted)\", channel_id,
11826  *             former_temporary_channel_id.unwrap()
11827  *         );
11828  *     },
11829  *     Event::ChannelReady { channel_id, user_channel_id, .. } => {
11830  *         assert_eq!(user_channel_id, 42);
11831  *         println!(\"Channel {} ready\", channel_id);
11832  *     },
11833  *     // ...
11834  * #     _ => {},
11835  * });
11836  * # }
11837  * ```
11838  *
11839  * ## Accepting Channels
11840  *
11841  * Inbound channels are initiated by peers and are automatically accepted unless [`ChannelManager`]
11842  * has [`UserConfig::manually_accept_inbound_channels`] set. In that case, the channel may be
11843  * either accepted or rejected when handling [`Event::OpenChannelRequest`].
11844  *
11845  * ```
11846  * # use bitcoin::secp256k1::PublicKey;
11847  * # use lightning::ln::channelmanager::AChannelManager;
11848  * # use lightning::events::{Event, EventsProvider};
11849  * #
11850  * # fn is_trusted(counterparty_node_id: PublicKey) -> bool {
11851  * #     // ...
11852  * #     unimplemented!()
11853  * # }
11854  * #
11855  * # fn example<T: AChannelManager>(channel_manager: T) {
11856  * # let channel_manager = channel_manager.get_cm();
11857  * channel_manager.process_pending_events(&|event| match event {
11858  *     Event::OpenChannelRequest { temporary_channel_id, counterparty_node_id, ..  } => {
11859  *         if !is_trusted(counterparty_node_id) {
11860  *             match channel_manager.force_close_without_broadcasting_txn(
11861  *                 &temporary_channel_id, &counterparty_node_id
11862  *             ) {
11863  *                 Ok(()) => println!(\"Rejecting channel {}\", temporary_channel_id),
11864  *                 Err(e) => println!(\"Error rejecting channel {}: {:?}\", temporary_channel_id, e),
11865  *             }
11866  *             return;
11867  *         }
11868  *
11869  *         let user_channel_id = 43;
11870  *         match channel_manager.accept_inbound_channel(
11871  *             &temporary_channel_id, &counterparty_node_id, user_channel_id
11872  *         ) {
11873  *             Ok(()) => println!(\"Accepting channel {}\", temporary_channel_id),
11874  *             Err(e) => println!(\"Error accepting channel {}: {:?}\", temporary_channel_id, e),
11875  *         }
11876  *     },
11877  *     // ...
11878  * #     _ => {},
11879  * });
11880  * # }
11881  * ```
11882  *
11883  * ## Closing Channels
11884  *
11885  * There are two ways to close a channel: either cooperatively using [`close_channel`] or
11886  * unilaterally using [`force_close_broadcasting_latest_txn`]. The former is ideal as it makes for
11887  * lower fees and immediate access to funds. However, the latter may be necessary if the
11888  * counterparty isn't behaving properly or has gone offline. [`Event::ChannelClosed`] is generated
11889  * once the channel has been closed successfully.
11890  *
11891  * ```
11892  * # use bitcoin::secp256k1::PublicKey;
11893  * # use lightning::ln::types::ChannelId;
11894  * # use lightning::ln::channelmanager::AChannelManager;
11895  * # use lightning::events::{Event, EventsProvider};
11896  * #
11897  * # fn example<T: AChannelManager>(
11898  * #     channel_manager: T, channel_id: ChannelId, counterparty_node_id: PublicKey
11899  * # ) {
11900  * # let channel_manager = channel_manager.get_cm();
11901  * match channel_manager.close_channel(&channel_id, &counterparty_node_id) {
11902  *     Ok(()) => println!(\"Closing channel {}\", channel_id),
11903  *     Err(e) => println!(\"Error closing channel {}: {:?}\", channel_id, e),
11904  * }
11905  *
11906  * // On the event processing thread
11907  * channel_manager.process_pending_events(&|event| match event {
11908  *     Event::ChannelClosed { channel_id, user_channel_id, ..  } => {
11909  *         assert_eq!(user_channel_id, 42);
11910  *         println!(\"Channel {} closed\", channel_id);
11911  *     },
11912  *     // ...
11913  * #     _ => {},
11914  * });
11915  * # }
11916  * ```
11917  *
11918  * # Payments
11919  *
11920  * [`ChannelManager`] is responsible for sending, forwarding, and receiving payments through its
11921  * channels. A payment is typically initiated from a [BOLT 11] invoice or a [BOLT 12] offer, though
11922  * spontaneous (i.e., keysend) payments are also possible. Incoming payments don't require
11923  * maintaining any additional state as [`ChannelManager`] can reconstruct the [`PaymentPreimage`]
11924  * from the [`PaymentSecret`]. Sending payments, however, require tracking in order to retry failed
11925  * HTLCs.
11926  *
11927  * After a payment is initiated, it will appear in [`list_recent_payments`] until a short time
11928  * after either an [`Event::PaymentSent`] or [`Event::PaymentFailed`] is handled. Failed HTLCs
11929  * for a payment will be retried according to the payment's [`Retry`] strategy or until
11930  * [`abandon_payment`] is called.
11931  *
11932  * ## BOLT 11 Invoices
11933  *
11934  * The [`lightning-invoice`] crate is useful for creating BOLT 11 invoices. Specifically, use the
11935  * functions in its `utils` module for constructing invoices that are compatible with
11936  * [`ChannelManager`]. These functions serve as a convenience for building invoices with the
11937  * [`PaymentHash`] and [`PaymentSecret`] returned from [`create_inbound_payment`]. To provide your
11938  * own [`PaymentHash`], use [`create_inbound_payment_for_hash`] or the corresponding functions in
11939  * the [`lightning-invoice`] `utils` module.
11940  *
11941  * [`ChannelManager`] generates an [`Event::PaymentClaimable`] once the full payment has been
11942  * received. Call [`claim_funds`] to release the [`PaymentPreimage`], which in turn will result in
11943  * an [`Event::PaymentClaimed`].
11944  *
11945  * ```
11946  * # use lightning::events::{Event, EventsProvider, PaymentPurpose};
11947  * # use lightning::ln::channelmanager::AChannelManager;
11948  * #
11949  * # fn example<T: AChannelManager>(channel_manager: T) {
11950  * # let channel_manager = channel_manager.get_cm();
11951  * // Or use utils::create_invoice_from_channelmanager
11952  * let known_payment_hash = match channel_manager.create_inbound_payment(
11953  *     Some(10_000_000), 3600, None
11954  * ) {
11955  *     Ok((payment_hash, _payment_secret)) => {
11956  *         println!(\"Creating inbound payment {}\", payment_hash);
11957  *         payment_hash
11958  *     },
11959  *     Err(()) => panic!(\"Error creating inbound payment\"),
11960  * };
11961  *
11962  * // On the event processing thread
11963  * channel_manager.process_pending_events(&|event| match event {
11964  *     Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
11965  *         PaymentPurpose::Bolt11InvoicePayment { payment_preimage: Some(payment_preimage), .. } => {
11966  *             assert_eq!(payment_hash, known_payment_hash);
11967  *             println!(\"Claiming payment {}\", payment_hash);
11968  *             channel_manager.claim_funds(payment_preimage);
11969  *         },
11970  *         PaymentPurpose::Bolt11InvoicePayment { payment_preimage: None, .. } => {
11971  *             println!(\"Unknown payment hash: {}\", payment_hash);
11972  *         },
11973  *         PaymentPurpose::SpontaneousPayment(payment_preimage) => {
11974  *             assert_ne!(payment_hash, known_payment_hash);
11975  *             println!(\"Claiming spontaneous payment {}\", payment_hash);
11976  *             channel_manager.claim_funds(payment_preimage);
11977  *         },
11978  *         // ...
11979  * #         _ => {},
11980  *     },
11981  *     Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
11982  *         assert_eq!(payment_hash, known_payment_hash);
11983  *         println!(\"Claimed {} msats\", amount_msat);
11984  *     },
11985  *     // ...
11986  * #     _ => {},
11987  * });
11988  * # }
11989  * ```
11990  *
11991  * For paying an invoice, [`lightning-invoice`] provides a `payment` module with convenience
11992  * functions for use with [`send_payment`].
11993  *
11994  * ```
11995  * # use lightning::events::{Event, EventsProvider};
11996  * # use lightning::ln::types::PaymentHash;
11997  * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, RecipientOnionFields, Retry};
11998  * # use lightning::routing::router::RouteParameters;
11999  * #
12000  * # fn example<T: AChannelManager>(
12001  * #     channel_manager: T, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields,
12002  * #     route_params: RouteParameters, retry: Retry
12003  * # ) {
12004  * # let channel_manager = channel_manager.get_cm();
12005  * // let (payment_hash, recipient_onion, route_params) =
12006  * //     payment::payment_parameters_from_invoice(&invoice);
12007  * let payment_id = PaymentId([42; 32]);
12008  * match channel_manager.send_payment(
12009  *     payment_hash, recipient_onion, payment_id, route_params, retry
12010  * ) {
12011  *     Ok(()) => println!(\"Sending payment with hash {}\", payment_hash),
12012  *     Err(e) => println!(\"Failed sending payment with hash {}: {:?}\", payment_hash, e),
12013  * }
12014  *
12015  * let expected_payment_id = payment_id;
12016  * let expected_payment_hash = payment_hash;
12017  * assert!(
12018  *     channel_manager.list_recent_payments().iter().find(|details| matches!(
12019  *         details,
12020  *         RecentPaymentDetails::Pending {
12021  *             payment_id: expected_payment_id,
12022  *             payment_hash: expected_payment_hash,
12023  *             ..
12024  *         }
12025  *     )).is_some()
12026  * );
12027  *
12028  * // On the event processing thread
12029  * channel_manager.process_pending_events(&|event| match event {
12030  *     Event::PaymentSent { payment_hash, .. } => println!(\"Paid {}\", payment_hash),
12031  *     Event::PaymentFailed { payment_hash, .. } => println!(\"Failed paying {}\", payment_hash),
12032  *     // ...
12033  * #     _ => {},
12034  * });
12035  * # }
12036  * ```
12037  *
12038  * ## BOLT 12 Offers
12039  *
12040  * The [`offers`] module is useful for creating BOLT 12 offers. An [`Offer`] is a precursor to a
12041  * [`Bolt12Invoice`], which must first be requested by the payer. The interchange of these messages
12042  * as defined in the specification is handled by [`ChannelManager`] and its implementation of
12043  * [`OffersMessageHandler`]. However, this only works with an [`Offer`] created using a builder
12044  * returned by [`create_offer_builder`]. With this approach, BOLT 12 offers and invoices are
12045  * stateless just as BOLT 11 invoices are.
12046  *
12047  * ```
12048  * # use lightning::events::{Event, EventsProvider, PaymentPurpose};
12049  * # use lightning::ln::channelmanager::AChannelManager;
12050  * # use lightning::offers::parse::Bolt12SemanticError;
12051  * #
12052  * # fn example<T: AChannelManager>(channel_manager: T) -> Result<(), Bolt12SemanticError> {
12053  * # let channel_manager = channel_manager.get_cm();
12054  * let offer = channel_manager
12055  *     .create_offer_builder()?
12056  * # ;
12057  * # // Needed for compiling for c_bindings
12058  * # let builder: lightning::offers::offer::OfferBuilder<_, _> = offer.into();
12059  * # let offer = builder
12060  *     .description(\"coffee\".to_string())
12061  *     .amount_msats(10_000_000)
12062  *     .build()?;
12063  * let bech32_offer = offer.to_string();
12064  *
12065  * // On the event processing thread
12066  * channel_manager.process_pending_events(&|event| match event {
12067  *     Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
12068  *         PaymentPurpose::Bolt12OfferPayment { payment_preimage: Some(payment_preimage), .. } => {
12069  *             println!(\"Claiming payment {}\", payment_hash);
12070  *             channel_manager.claim_funds(payment_preimage);
12071  *         },
12072  *         PaymentPurpose::Bolt12OfferPayment { payment_preimage: None, .. } => {
12073  *             println!(\"Unknown payment hash: {}\", payment_hash);
12074  *         },
12075  *         // ...
12076  * #         _ => {},
12077  *     },
12078  *     Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
12079  *         println!(\"Claimed {} msats\", amount_msat);
12080  *     },
12081  *     // ...
12082  * #     _ => {},
12083  * });
12084  * # Ok(())
12085  * # }
12086  * ```
12087  *
12088  * Use [`pay_for_offer`] to initiated payment, which sends an [`InvoiceRequest`] for an [`Offer`]
12089  * and pays the [`Bolt12Invoice`] response. In addition to success and failure events,
12090  * [`ChannelManager`] may also generate an [`Event::InvoiceRequestFailed`].
12091  *
12092  * ```
12093  * # use lightning::events::{Event, EventsProvider};
12094  * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, Retry};
12095  * # use lightning::offers::offer::Offer;
12096  * #
12097  * # fn example<T: AChannelManager>(
12098  * #     channel_manager: T, offer: &Offer, quantity: Option<u64>, amount_msats: Option<u64>,
12099  * #     payer_note: Option<String>, retry: Retry, max_total_routing_fee_msat: Option<u64>
12100  * # ) {
12101  * # let channel_manager = channel_manager.get_cm();
12102  * let payment_id = PaymentId([42; 32]);
12103  * match channel_manager.pay_for_offer(
12104  *     offer, quantity, amount_msats, payer_note, payment_id, retry, max_total_routing_fee_msat
12105  * ) {
12106  *     Ok(()) => println!(\"Requesting invoice for offer\"),
12107  *     Err(e) => println!(\"Unable to request invoice for offer: {:?}\", e),
12108  * }
12109  *
12110  * // First the payment will be waiting on an invoice
12111  * let expected_payment_id = payment_id;
12112  * assert!(
12113  *     channel_manager.list_recent_payments().iter().find(|details| matches!(
12114  *         details,
12115  *         RecentPaymentDetails::AwaitingInvoice { payment_id: expected_payment_id }
12116  *     )).is_some()
12117  * );
12118  *
12119  * // Once the invoice is received, a payment will be sent
12120  * assert!(
12121  *     channel_manager.list_recent_payments().iter().find(|details| matches!(
12122  *         details,
12123  *         RecentPaymentDetails::Pending { payment_id: expected_payment_id, ..  }
12124  *     )).is_some()
12125  * );
12126  *
12127  * // On the event processing thread
12128  * channel_manager.process_pending_events(&|event| match event {
12129  *     Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id),
12130  *     Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
12131  *     Event::InvoiceRequestFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
12132  *     // ...
12133  * #     _ => {},
12134  * });
12135  * # }
12136  * ```
12137  *
12138  * ## BOLT 12 Refunds
12139  *
12140  * A [`Refund`] is a request for an invoice to be paid. Like *paying* for an [`Offer`], *creating*
12141  * a [`Refund`] involves maintaining state since it represents a future outbound payment.
12142  * Therefore, use [`create_refund_builder`] when creating one, otherwise [`ChannelManager`] will
12143  * refuse to pay any corresponding [`Bolt12Invoice`] that it receives.
12144  *
12145  * ```
12146  * # use core::time::Duration;
12147  * # use lightning::events::{Event, EventsProvider};
12148  * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, Retry};
12149  * # use lightning::offers::parse::Bolt12SemanticError;
12150  * #
12151  * # fn example<T: AChannelManager>(
12152  * #     channel_manager: T, amount_msats: u64, absolute_expiry: Duration, retry: Retry,
12153  * #     max_total_routing_fee_msat: Option<u64>
12154  * # ) -> Result<(), Bolt12SemanticError> {
12155  * # let channel_manager = channel_manager.get_cm();
12156  * let payment_id = PaymentId([42; 32]);
12157  * let refund = channel_manager
12158  *     .create_refund_builder(
12159  *         amount_msats, absolute_expiry, payment_id, retry, max_total_routing_fee_msat
12160  *     )?
12161  * # ;
12162  * # // Needed for compiling for c_bindings
12163  * # let builder: lightning::offers::refund::RefundBuilder<_> = refund.into();
12164  * # let refund = builder
12165  *     .description(\"coffee\".to_string())
12166  *     .payer_note(\"refund for order 1234\".to_string())
12167  *     .build()?;
12168  * let bech32_refund = refund.to_string();
12169  *
12170  * // First the payment will be waiting on an invoice
12171  * let expected_payment_id = payment_id;
12172  * assert!(
12173  *     channel_manager.list_recent_payments().iter().find(|details| matches!(
12174  *         details,
12175  *         RecentPaymentDetails::AwaitingInvoice { payment_id: expected_payment_id }
12176  *     )).is_some()
12177  * );
12178  *
12179  * // Once the invoice is received, a payment will be sent
12180  * assert!(
12181  *     channel_manager.list_recent_payments().iter().find(|details| matches!(
12182  *         details,
12183  *         RecentPaymentDetails::Pending { payment_id: expected_payment_id, ..  }
12184  *     )).is_some()
12185  * );
12186  *
12187  * // On the event processing thread
12188  * channel_manager.process_pending_events(&|event| match event {
12189  *     Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id),
12190  *     Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
12191  *     // ...
12192  * #     _ => {},
12193  * });
12194  * # Ok(())
12195  * # }
12196  * ```
12197  *
12198  * Use [`request_refund_payment`] to send a [`Bolt12Invoice`] for receiving the refund. Similar to
12199  * *creating* an [`Offer`], this is stateless as it represents an inbound payment.
12200  *
12201  * ```
12202  * # use lightning::events::{Event, EventsProvider, PaymentPurpose};
12203  * # use lightning::ln::channelmanager::AChannelManager;
12204  * # use lightning::offers::refund::Refund;
12205  * #
12206  * # fn example<T: AChannelManager>(channel_manager: T, refund: &Refund) {
12207  * # let channel_manager = channel_manager.get_cm();
12208  * let known_payment_hash = match channel_manager.request_refund_payment(refund) {
12209  *     Ok(invoice) => {
12210  *         let payment_hash = invoice.payment_hash();
12211  *         println!(\"Requesting refund payment {}\", payment_hash);
12212  *         payment_hash
12213  *     },
12214  *     Err(e) => panic!(\"Unable to request payment for refund: {:?}\", e),
12215  * };
12216  *
12217  * // On the event processing thread
12218  * channel_manager.process_pending_events(&|event| match event {
12219  *     Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
12220  *     \tPaymentPurpose::Bolt12RefundPayment { payment_preimage: Some(payment_preimage), .. } => {
12221  *             assert_eq!(payment_hash, known_payment_hash);
12222  *             println!(\"Claiming payment {}\", payment_hash);
12223  *             channel_manager.claim_funds(payment_preimage);
12224  *         },
12225  *     \tPaymentPurpose::Bolt12RefundPayment { payment_preimage: None, .. } => {
12226  *             println!(\"Unknown payment hash: {}\", payment_hash);
12227  *     \t},
12228  *         // ...
12229  * #         _ => {},
12230  *     },
12231  *     Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
12232  *         assert_eq!(payment_hash, known_payment_hash);
12233  *         println!(\"Claimed {} msats\", amount_msat);
12234  *     },
12235  *     // ...
12236  * #     _ => {},
12237  * });
12238  * # }
12239  * ```
12240  *
12241  * # Persistence
12242  *
12243  * Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for
12244  * all peers during write/read (though does not modify this instance, only the instance being
12245  * serialized). This will result in any channels which have not yet exchanged [`funding_created`] (i.e.,
12246  * called [`funding_transaction_generated`] for outbound channels) being closed.
12247  *
12248  * Note that you can be a bit lazier about writing out `ChannelManager` than you can be with
12249  * [`ChannelMonitor`]. With [`ChannelMonitor`] you MUST durably write each
12250  * [`ChannelMonitorUpdate`] before returning from
12251  * [`chain::Watch::watch_channel`]/[`update_channel`] or before completing async writes. With
12252  * `ChannelManager`s, writing updates happens out-of-band (and will prevent any other
12253  * `ChannelManager` operations from occurring during the serialization process). If the
12254  * deserialized version is out-of-date compared to the [`ChannelMonitor`] passed by reference to
12255  * [`read`], those channels will be force-closed based on the `ChannelMonitor` state and no funds
12256  * will be lost (modulo on-chain transaction fees).
12257  *
12258  * Note that the deserializer is only implemented for `(`[`BlockHash`]`, `[`ChannelManager`]`)`, which
12259  * tells you the last block hash which was connected. You should get the best block tip before using the manager.
12260  * See [`chain::Listen`] and [`chain::Confirm`] for more details.
12261  *
12262  * # `ChannelUpdate` Messages
12263  *
12264  * Note that `ChannelManager` is responsible for tracking liveness of its channels and generating
12265  * [`ChannelUpdate`] messages informing peers that the channel is temporarily disabled. To avoid
12266  * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
12267  * offline for a full minute. In order to track this, you must call
12268  * [`timer_tick_occurred`] roughly once per minute, though it doesn't have to be perfect.
12269  *
12270  * # DoS Mitigation
12271  *
12272  * To avoid trivial DoS issues, `ChannelManager` limits the number of inbound connections and
12273  * inbound channels without confirmed funding transactions. This may result in nodes which we do
12274  * not have a channel with being unable to connect to us or open new channels with us if we have
12275  * many peers with unfunded channels.
12276  *
12277  * Because it is an indication of trust, inbound channels which we've accepted as 0conf are
12278  * exempted from the count of unfunded channels. Similarly, outbound channels and connections are
12279  * never limited. Please ensure you limit the count of such channels yourself.
12280  *
12281  * # Type Aliases
12282  *
12283  * Rather than using a plain `ChannelManager`, it is preferable to use either a [`SimpleArcChannelManager`]
12284  * a [`SimpleRefChannelManager`], for conciseness. See their documentation for more details, but
12285  * essentially you should default to using a [`SimpleRefChannelManager`], and use a
12286  * [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when
12287  * you're using lightning-net-tokio.
12288  *
12289  * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
12290  * [`MessageHandler`]: crate::ln::peer_handler::MessageHandler
12291  * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
12292  * [`PeerManager::read_event`]: crate::ln::peer_handler::PeerManager::read_event
12293  * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
12294  * [`timer_tick_occurred`]: Self::timer_tick_occurred
12295  * [`get_and_clear_needs_persistence`]: Self::get_and_clear_needs_persistence
12296  * [`Persister`]: crate::util::persist::Persister
12297  * [`KVStore`]: crate::util::persist::KVStore
12298  * [`get_event_or_persistence_needed_future`]: Self::get_event_or_persistence_needed_future
12299  * [`lightning-block-sync`]: https://docs.rs/lightning_block_sync/latest/lightning_block_sync
12300  * [`lightning-transaction-sync`]: https://docs.rs/lightning_transaction_sync/latest/lightning_transaction_sync
12301  * [`lightning-background-processor`]: https://docs.rs/lightning_background_processor/lightning_background_processor
12302  * [`list_channels`]: Self::list_channels
12303  * [`list_usable_channels`]: Self::list_usable_channels
12304  * [`create_channel`]: Self::create_channel
12305  * [`close_channel`]: Self::force_close_broadcasting_latest_txn
12306  * [`force_close_broadcasting_latest_txn`]: Self::force_close_broadcasting_latest_txn
12307  * [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md
12308  * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md
12309  * [`list_recent_payments`]: Self::list_recent_payments
12310  * [`abandon_payment`]: Self::abandon_payment
12311  * [`lightning-invoice`]: https://docs.rs/lightning_invoice/latest/lightning_invoice
12312  * [`create_inbound_payment`]: Self::create_inbound_payment
12313  * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
12314  * [`claim_funds`]: Self::claim_funds
12315  * [`send_payment`]: Self::send_payment
12316  * [`offers`]: crate::offers
12317  * [`create_offer_builder`]: Self::create_offer_builder
12318  * [`pay_for_offer`]: Self::pay_for_offer
12319  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
12320  * [`create_refund_builder`]: Self::create_refund_builder
12321  * [`request_refund_payment`]: Self::request_refund_payment
12322  * [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected
12323  * [`funding_created`]: msgs::FundingCreated
12324  * [`funding_transaction_generated`]: Self::funding_transaction_generated
12325  * [`BlockHash`]: bitcoin::hash_types::BlockHash
12326  * [`update_channel`]: chain::Watch::update_channel
12327  * [`ChannelUpdate`]: msgs::ChannelUpdate
12328  * [`read`]: ReadableArgs::read
12329  */
12330 typedef struct MUST_USE_STRUCT LDKChannelManager {
12331    /**
12332     * A pointer to the opaque Rust object.
12333     * Nearly everywhere, inner must be non-null, however in places where
12334     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12335     */
12336    LDKnativeChannelManager *inner;
12337    /**
12338     * Indicates that this is the only struct which contains the same pointer.
12339     * Rust functions which take ownership of an object provided via an argument require
12340     * this to be true and invalidate the object pointed to by inner.
12341     */
12342    bool is_owned;
12343 } LDKChannelManager;
12344
12345 /**
12346  * A tuple of 2 elements. See the individual fields for the types contained.
12347  */
12348 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ {
12349    /**
12350     * The element at position 0
12351     */
12352    struct LDKThirtyTwoBytes a;
12353    /**
12354     * The element at position 1
12355     */
12356    struct LDKChannelManager b;
12357 } LDKC2Tuple_ThirtyTwoBytesChannelManagerZ;
12358
12359 /**
12360  * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ
12361  */
12362 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr {
12363    /**
12364     * A pointer to the contents in the success state.
12365     * Reading from this pointer when `result_ok` is not set is undefined.
12366     */
12367    struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *result;
12368    /**
12369     * A pointer to the contents in the error state.
12370     * Reading from this pointer when `result_ok` is set is undefined.
12371     */
12372    struct LDKDecodeError *err;
12373 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr;
12374
12375 /**
12376  * A CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents the result of a fallible operation,
12377  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
12378  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12379  */
12380 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ {
12381    /**
12382     * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ, accessible via either
12383     * `err` or `result` depending on the state of `result_ok`.
12384     */
12385    union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr contents;
12386    /**
12387     * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents a success state.
12388     */
12389    bool result_ok;
12390 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ;
12391
12392 /**
12393  * Options for how to set the max dust exposure allowed on a channel. See
12394  * [`ChannelConfig::max_dust_htlc_exposure`] for details.
12395  */
12396 typedef enum LDKMaxDustHTLCExposure_Tag {
12397    /**
12398     * This sets a fixed limit on the total dust exposure in millisatoshis. Setting this too low
12399     * may prevent the sending or receipt of low-value HTLCs on high-traffic nodes, however this
12400     * limit is very important to prevent stealing of large amounts of dust HTLCs by miners
12401     * through [fee griefing
12402     * attacks](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-May/002714.html).
12403     *
12404     * Note that if the feerate increases significantly, without a manual increase
12405     * to this maximum the channel may be unable to send/receive HTLCs between the maximum dust
12406     * exposure and the new minimum value for HTLCs to be economically viable to claim.
12407     */
12408    LDKMaxDustHTLCExposure_FixedLimitMsat,
12409    /**
12410     * This sets a multiplier on the [`ConfirmationTarget::OnChainSweep`] feerate (in sats/KW) to
12411     * determine the maximum allowed dust exposure. If this variant is used then the maximum dust
12412     * exposure in millisatoshis is calculated as:
12413     * `feerate_per_kw * value`. For example, with our default value
12414     * `FeeRateMultiplier(10_000)`:
12415     *
12416     * - For the minimum fee rate of 1 sat/vByte (250 sat/KW, although the minimum
12417     * defaults to 253 sats/KW for rounding, see [`FeeEstimator`]), the max dust exposure would
12418     * be 253 * 10_000 = 2,530,000 msats.
12419     * - For a fee rate of 30 sat/vByte (7500 sat/KW), the max dust exposure would be
12420     * 7500 * 50_000 = 75,000,000 msats (0.00075 BTC).
12421     *
12422     * Note, if you're using a third-party fee estimator, this may leave you more exposed to a
12423     * fee griefing attack, where your fee estimator may purposely overestimate the fee rate,
12424     * causing you to accept more dust HTLCs than you would otherwise.
12425     *
12426     * This variant is primarily meant to serve pre-anchor channels, as HTLC fees being included
12427     * on HTLC outputs means your channel may be subject to more dust exposure in the event of
12428     * increases in fee rate.
12429     *
12430     * # Backwards Compatibility
12431     * This variant only became available in LDK 0.0.116, so if you downgrade to a prior version
12432     * by default this will be set to a [`Self::FixedLimitMsat`] of 5,000,000 msat.
12433     *
12434     * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator
12435     * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
12436     */
12437    LDKMaxDustHTLCExposure_FeeRateMultiplier,
12438    /**
12439     * Must be last for serialization purposes
12440     */
12441    LDKMaxDustHTLCExposure_Sentinel,
12442 } LDKMaxDustHTLCExposure_Tag;
12443
12444 typedef struct MUST_USE_STRUCT LDKMaxDustHTLCExposure {
12445    LDKMaxDustHTLCExposure_Tag tag;
12446    union {
12447       struct {
12448          uint64_t fixed_limit_msat;
12449       };
12450       struct {
12451          uint64_t fee_rate_multiplier;
12452       };
12453    };
12454 } LDKMaxDustHTLCExposure;
12455
12456 /**
12457  * The contents of CResult_MaxDustHTLCExposureDecodeErrorZ
12458  */
12459 typedef union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr {
12460    /**
12461     * A pointer to the contents in the success state.
12462     * Reading from this pointer when `result_ok` is not set is undefined.
12463     */
12464    struct LDKMaxDustHTLCExposure *result;
12465    /**
12466     * A pointer to the contents in the error state.
12467     * Reading from this pointer when `result_ok` is set is undefined.
12468     */
12469    struct LDKDecodeError *err;
12470 } LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr;
12471
12472 /**
12473  * A CResult_MaxDustHTLCExposureDecodeErrorZ represents the result of a fallible operation,
12474  * containing a crate::lightning::util::config::MaxDustHTLCExposure on success and a crate::lightning::ln::msgs::DecodeError on failure.
12475  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12476  */
12477 typedef struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ {
12478    /**
12479     * The contents of this CResult_MaxDustHTLCExposureDecodeErrorZ, accessible via either
12480     * `err` or `result` depending on the state of `result_ok`.
12481     */
12482    union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr contents;
12483    /**
12484     * Whether this CResult_MaxDustHTLCExposureDecodeErrorZ represents a success state.
12485     */
12486    bool result_ok;
12487 } LDKCResult_MaxDustHTLCExposureDecodeErrorZ;
12488
12489
12490
12491 /**
12492  * Options which apply on a per-channel basis and may change at runtime or based on negotiation
12493  * with our counterparty.
12494  */
12495 typedef struct MUST_USE_STRUCT LDKChannelConfig {
12496    /**
12497     * A pointer to the opaque Rust object.
12498     * Nearly everywhere, inner must be non-null, however in places where
12499     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12500     */
12501    LDKnativeChannelConfig *inner;
12502    /**
12503     * Indicates that this is the only struct which contains the same pointer.
12504     * Rust functions which take ownership of an object provided via an argument require
12505     * this to be true and invalidate the object pointed to by inner.
12506     */
12507    bool is_owned;
12508 } LDKChannelConfig;
12509
12510 /**
12511  * The contents of CResult_ChannelConfigDecodeErrorZ
12512  */
12513 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
12514    /**
12515     * A pointer to the contents in the success state.
12516     * Reading from this pointer when `result_ok` is not set is undefined.
12517     */
12518    struct LDKChannelConfig *result;
12519    /**
12520     * A pointer to the contents in the error state.
12521     * Reading from this pointer when `result_ok` is set is undefined.
12522     */
12523    struct LDKDecodeError *err;
12524 } LDKCResult_ChannelConfigDecodeErrorZPtr;
12525
12526 /**
12527  * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
12528  * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
12529  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12530  */
12531 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
12532    /**
12533     * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
12534     * `err` or `result` depending on the state of `result_ok`.
12535     */
12536    union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
12537    /**
12538     * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
12539     */
12540    bool result_ok;
12541 } LDKCResult_ChannelConfigDecodeErrorZ;
12542
12543 /**
12544  * An enum which can either contain a crate::lightning::util::config::MaxDustHTLCExposure or not
12545  */
12546 typedef enum LDKCOption_MaxDustHTLCExposureZ_Tag {
12547    /**
12548     * When we're in this state, this COption_MaxDustHTLCExposureZ contains a crate::lightning::util::config::MaxDustHTLCExposure
12549     */
12550    LDKCOption_MaxDustHTLCExposureZ_Some,
12551    /**
12552     * When we're in this state, this COption_MaxDustHTLCExposureZ contains nothing
12553     */
12554    LDKCOption_MaxDustHTLCExposureZ_None,
12555    /**
12556     * Must be last for serialization purposes
12557     */
12558    LDKCOption_MaxDustHTLCExposureZ_Sentinel,
12559 } LDKCOption_MaxDustHTLCExposureZ_Tag;
12560
12561 typedef struct LDKCOption_MaxDustHTLCExposureZ {
12562    LDKCOption_MaxDustHTLCExposureZ_Tag tag;
12563    union {
12564       struct {
12565          struct LDKMaxDustHTLCExposure some;
12566       };
12567    };
12568 } LDKCOption_MaxDustHTLCExposureZ;
12569
12570 /**
12571  * An enum which can either contain a crate::lightning::util::errors::APIError or not
12572  */
12573 typedef enum LDKCOption_APIErrorZ_Tag {
12574    /**
12575     * When we're in this state, this COption_APIErrorZ contains a crate::lightning::util::errors::APIError
12576     */
12577    LDKCOption_APIErrorZ_Some,
12578    /**
12579     * When we're in this state, this COption_APIErrorZ contains nothing
12580     */
12581    LDKCOption_APIErrorZ_None,
12582    /**
12583     * Must be last for serialization purposes
12584     */
12585    LDKCOption_APIErrorZ_Sentinel,
12586 } LDKCOption_APIErrorZ_Tag;
12587
12588 typedef struct LDKCOption_APIErrorZ {
12589    LDKCOption_APIErrorZ_Tag tag;
12590    union {
12591       struct {
12592          struct LDKAPIError some;
12593       };
12594    };
12595 } LDKCOption_APIErrorZ;
12596
12597 /**
12598  * The contents of CResult_COption_APIErrorZDecodeErrorZ
12599  */
12600 typedef union LDKCResult_COption_APIErrorZDecodeErrorZPtr {
12601    /**
12602     * A pointer to the contents in the success state.
12603     * Reading from this pointer when `result_ok` is not set is undefined.
12604     */
12605    struct LDKCOption_APIErrorZ *result;
12606    /**
12607     * A pointer to the contents in the error state.
12608     * Reading from this pointer when `result_ok` is set is undefined.
12609     */
12610    struct LDKDecodeError *err;
12611 } LDKCResult_COption_APIErrorZDecodeErrorZPtr;
12612
12613 /**
12614  * A CResult_COption_APIErrorZDecodeErrorZ represents the result of a fallible operation,
12615  * containing a crate::c_types::derived::COption_APIErrorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
12616  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12617  */
12618 typedef struct LDKCResult_COption_APIErrorZDecodeErrorZ {
12619    /**
12620     * The contents of this CResult_COption_APIErrorZDecodeErrorZ, accessible via either
12621     * `err` or `result` depending on the state of `result_ok`.
12622     */
12623    union LDKCResult_COption_APIErrorZDecodeErrorZPtr contents;
12624    /**
12625     * Whether this CResult_COption_APIErrorZDecodeErrorZ represents a success state.
12626     */
12627    bool result_ok;
12628 } LDKCResult_COption_APIErrorZDecodeErrorZ;
12629
12630 /**
12631  * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
12632  */
12633 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
12634    /**
12635     * A pointer to the contents in the success state.
12636     * Reading from this pointer when `result_ok` is not set is undefined.
12637     */
12638    struct LDKChannelMonitorUpdate *result;
12639    /**
12640     * A pointer to the contents in the error state.
12641     * Reading from this pointer when `result_ok` is set is undefined.
12642     */
12643    struct LDKDecodeError *err;
12644 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
12645
12646 /**
12647  * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
12648  * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12649  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12650  */
12651 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
12652    /**
12653     * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
12654     * `err` or `result` depending on the state of `result_ok`.
12655     */
12656    union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
12657    /**
12658     * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
12659     */
12660    bool result_ok;
12661 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
12662
12663 /**
12664  * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
12665  */
12666 typedef enum LDKCOption_MonitorEventZ_Tag {
12667    /**
12668     * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
12669     */
12670    LDKCOption_MonitorEventZ_Some,
12671    /**
12672     * When we're in this state, this COption_MonitorEventZ contains nothing
12673     */
12674    LDKCOption_MonitorEventZ_None,
12675    /**
12676     * Must be last for serialization purposes
12677     */
12678    LDKCOption_MonitorEventZ_Sentinel,
12679 } LDKCOption_MonitorEventZ_Tag;
12680
12681 typedef struct LDKCOption_MonitorEventZ {
12682    LDKCOption_MonitorEventZ_Tag tag;
12683    union {
12684       struct {
12685          struct LDKMonitorEvent some;
12686       };
12687    };
12688 } LDKCOption_MonitorEventZ;
12689
12690 /**
12691  * The contents of CResult_COption_MonitorEventZDecodeErrorZ
12692  */
12693 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
12694    /**
12695     * A pointer to the contents in the success state.
12696     * Reading from this pointer when `result_ok` is not set is undefined.
12697     */
12698    struct LDKCOption_MonitorEventZ *result;
12699    /**
12700     * A pointer to the contents in the error state.
12701     * Reading from this pointer when `result_ok` is set is undefined.
12702     */
12703    struct LDKDecodeError *err;
12704 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
12705
12706 /**
12707  * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
12708  * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
12709  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12710  */
12711 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
12712    /**
12713     * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
12714     * `err` or `result` depending on the state of `result_ok`.
12715     */
12716    union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
12717    /**
12718     * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
12719     */
12720    bool result_ok;
12721 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
12722
12723 /**
12724  * The contents of CResult_HTLCUpdateDecodeErrorZ
12725  */
12726 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
12727    /**
12728     * A pointer to the contents in the success state.
12729     * Reading from this pointer when `result_ok` is not set is undefined.
12730     */
12731    struct LDKHTLCUpdate *result;
12732    /**
12733     * A pointer to the contents in the error state.
12734     * Reading from this pointer when `result_ok` is set is undefined.
12735     */
12736    struct LDKDecodeError *err;
12737 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
12738
12739 /**
12740  * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
12741  * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12742  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12743  */
12744 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
12745    /**
12746     * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
12747     * `err` or `result` depending on the state of `result_ok`.
12748     */
12749    union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
12750    /**
12751     * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
12752     */
12753    bool result_ok;
12754 } LDKCResult_HTLCUpdateDecodeErrorZ;
12755
12756 /**
12757  * A tuple of 2 elements. See the individual fields for the types contained.
12758  */
12759 typedef struct LDKC2Tuple_OutPointCVec_u8ZZ {
12760    /**
12761     * The element at position 0
12762     */
12763    struct LDKOutPoint a;
12764    /**
12765     * The element at position 1
12766     */
12767    struct LDKCVec_u8Z b;
12768 } LDKC2Tuple_OutPointCVec_u8ZZ;
12769
12770 /**
12771  * A tuple of 2 elements. See the individual fields for the types contained.
12772  */
12773 typedef struct LDKC2Tuple_u32CVec_u8ZZ {
12774    /**
12775     * The element at position 0
12776     */
12777    uint32_t a;
12778    /**
12779     * The element at position 1
12780     */
12781    struct LDKCVec_u8Z b;
12782 } LDKC2Tuple_u32CVec_u8ZZ;
12783
12784 /**
12785  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32CVec_u8ZZs of arbitrary size.
12786  * This corresponds to std::vector in C++
12787  */
12788 typedef struct LDKCVec_C2Tuple_u32CVec_u8ZZZ {
12789    /**
12790     * The elements in the array.
12791     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12792     */
12793    struct LDKC2Tuple_u32CVec_u8ZZ *data;
12794    /**
12795     * The number of elements pointed to by `data`.
12796     */
12797    uintptr_t datalen;
12798 } LDKCVec_C2Tuple_u32CVec_u8ZZZ;
12799
12800 /**
12801  * A tuple of 2 elements. See the individual fields for the types contained.
12802  */
12803 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ {
12804    /**
12805     * The element at position 0
12806     */
12807    struct LDKThirtyTwoBytes a;
12808    /**
12809     * The element at position 1
12810     */
12811    struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b;
12812 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ;
12813
12814 /**
12815  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZs of arbitrary size.
12816  * This corresponds to std::vector in C++
12817  */
12818 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ {
12819    /**
12820     * The elements in the array.
12821     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12822     */
12823    struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *data;
12824    /**
12825     * The number of elements pointed to by `data`.
12826     */
12827    uintptr_t datalen;
12828 } LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ;
12829
12830 /**
12831  * A dynamically-allocated array of crate::lightning::ln::chan_utils::CommitmentTransactions of arbitrary size.
12832  * This corresponds to std::vector in C++
12833  */
12834 typedef struct LDKCVec_CommitmentTransactionZ {
12835    /**
12836     * The elements in the array.
12837     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12838     */
12839    struct LDKCommitmentTransaction *data;
12840    /**
12841     * The number of elements pointed to by `data`.
12842     */
12843    uintptr_t datalen;
12844 } LDKCVec_CommitmentTransactionZ;
12845
12846 /**
12847  * A tuple of 2 elements. See the individual fields for the types contained.
12848  */
12849 typedef struct LDKC2Tuple_u32TxOutZ {
12850    /**
12851     * The element at position 0
12852     */
12853    uint32_t a;
12854    /**
12855     * The element at position 1
12856     */
12857    struct LDKTxOut b;
12858 } LDKC2Tuple_u32TxOutZ;
12859
12860 /**
12861  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
12862  * This corresponds to std::vector in C++
12863  */
12864 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
12865    /**
12866     * The elements in the array.
12867     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12868     */
12869    struct LDKC2Tuple_u32TxOutZ *data;
12870    /**
12871     * The number of elements pointed to by `data`.
12872     */
12873    uintptr_t datalen;
12874 } LDKCVec_C2Tuple_u32TxOutZZ;
12875
12876 /**
12877  * A tuple of 2 elements. See the individual fields for the types contained.
12878  */
12879 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ {
12880    /**
12881     * The element at position 0
12882     */
12883    struct LDKThirtyTwoBytes a;
12884    /**
12885     * The element at position 1
12886     */
12887    struct LDKCVec_C2Tuple_u32TxOutZZ b;
12888 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ;
12889
12890 /**
12891  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
12892  * This corresponds to std::vector in C++
12893  */
12894 typedef struct LDKCVec_TransactionOutputsZ {
12895    /**
12896     * The elements in the array.
12897     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12898     */
12899    struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *data;
12900    /**
12901     * The number of elements pointed to by `data`.
12902     */
12903    uintptr_t datalen;
12904 } LDKCVec_TransactionOutputsZ;
12905
12906 /**
12907  * Details about the balance(s) available for spending once the channel appears on chain.
12908  *
12909  * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
12910  * be provided.
12911  */
12912 typedef enum LDKBalance_Tag {
12913    /**
12914     * The channel is not yet closed (or the commitment or closing transaction has not yet
12915     * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
12916     * force-closed now.
12917     */
12918    LDKBalance_ClaimableOnChannelClose,
12919    /**
12920     * The channel has been closed, and the given balance is ours but awaiting confirmations until
12921     * we consider it spendable.
12922     */
12923    LDKBalance_ClaimableAwaitingConfirmations,
12924    /**
12925     * The channel has been closed, and the given balance should be ours but awaiting spending
12926     * transaction confirmation. If the spending transaction does not confirm in time, it is
12927     * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
12928     *
12929     * Once the spending transaction confirms, before it has reached enough confirmations to be
12930     * considered safe from chain reorganizations, the balance will instead be provided via
12931     * [`Balance::ClaimableAwaitingConfirmations`].
12932     */
12933    LDKBalance_ContentiousClaimable,
12934    /**
12935     * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
12936     * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
12937     * likely to be claimed by our counterparty before we do.
12938     */
12939    LDKBalance_MaybeTimeoutClaimableHTLC,
12940    /**
12941     * HTLCs which we received from our counterparty which are claimable with a preimage which we
12942     * do not currently have. This will only be claimable if we receive the preimage from the node
12943     * to which we forwarded this HTLC before the timeout.
12944     */
12945    LDKBalance_MaybePreimageClaimableHTLC,
12946    /**
12947     * The channel has been closed, and our counterparty broadcasted a revoked commitment
12948     * transaction.
12949     *
12950     * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
12951     * following amount.
12952     */
12953    LDKBalance_CounterpartyRevokedOutputClaimable,
12954    /**
12955     * Must be last for serialization purposes
12956     */
12957    LDKBalance_Sentinel,
12958 } LDKBalance_Tag;
12959
12960 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
12961    /**
12962     * The amount available to claim, in satoshis, excluding the on-chain fees which will be
12963     * required to do so.
12964     */
12965    uint64_t amount_satoshis;
12966 } LDKBalance_LDKClaimableOnChannelClose_Body;
12967
12968 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
12969    /**
12970     * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
12971     * were spent in broadcasting the transaction.
12972     */
12973    uint64_t amount_satoshis;
12974    /**
12975     * The height at which an [`Event::SpendableOutputs`] event will be generated for this
12976     * amount.
12977     */
12978    uint32_t confirmation_height;
12979 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
12980
12981 typedef struct LDKBalance_LDKContentiousClaimable_Body {
12982    /**
12983     * The amount available to claim, in satoshis, excluding the on-chain fees which will be
12984     * required to do so.
12985     */
12986    uint64_t amount_satoshis;
12987    /**
12988     * The height at which the counterparty may be able to claim the balance if we have not
12989     * done so.
12990     */
12991    uint32_t timeout_height;
12992    /**
12993     * The payment hash that locks this HTLC.
12994     */
12995    struct LDKThirtyTwoBytes payment_hash;
12996    /**
12997     * The preimage that can be used to claim this HTLC.
12998     */
12999    struct LDKThirtyTwoBytes payment_preimage;
13000 } LDKBalance_LDKContentiousClaimable_Body;
13001
13002 typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
13003    /**
13004     * The amount potentially available to claim, in satoshis, excluding the on-chain fees
13005     * which will be required to do so.
13006     */
13007    uint64_t amount_satoshis;
13008    /**
13009     * The height at which we will be able to claim the balance if our counterparty has not
13010     * done so.
13011     */
13012    uint32_t claimable_height;
13013    /**
13014     * The payment hash whose preimage our counterparty needs to claim this HTLC.
13015     */
13016    struct LDKThirtyTwoBytes payment_hash;
13017 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
13018
13019 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
13020    /**
13021     * The amount potentially available to claim, in satoshis, excluding the on-chain fees
13022     * which will be required to do so.
13023     */
13024    uint64_t amount_satoshis;
13025    /**
13026     * The height at which our counterparty will be able to claim the balance if we have not
13027     * yet received the preimage and claimed it ourselves.
13028     */
13029    uint32_t expiry_height;
13030    /**
13031     * The payment hash whose preimage we need to claim this HTLC.
13032     */
13033    struct LDKThirtyTwoBytes payment_hash;
13034 } LDKBalance_LDKMaybePreimageClaimableHTLC_Body;
13035
13036 typedef struct LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body {
13037    /**
13038     * The amount, in satoshis, of the output which we can claim.
13039     *
13040     * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
13041     * were already spent.
13042     */
13043    uint64_t amount_satoshis;
13044 } LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body;
13045
13046 typedef struct MUST_USE_STRUCT LDKBalance {
13047    LDKBalance_Tag tag;
13048    union {
13049       LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
13050       LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
13051       LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
13052       LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body maybe_timeout_claimable_htlc;
13053       LDKBalance_LDKMaybePreimageClaimableHTLC_Body maybe_preimage_claimable_htlc;
13054       LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body counterparty_revoked_output_claimable;
13055    };
13056 } LDKBalance;
13057
13058 /**
13059  * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
13060  * This corresponds to std::vector in C++
13061  */
13062 typedef struct LDKCVec_BalanceZ {
13063    /**
13064     * The elements in the array.
13065     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13066     */
13067    struct LDKBalance *data;
13068    /**
13069     * The number of elements pointed to by `data`.
13070     */
13071    uintptr_t datalen;
13072 } LDKCVec_BalanceZ;
13073
13074 /**
13075  * A tuple of 2 elements. See the individual fields for the types contained.
13076  */
13077 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ {
13078    /**
13079     * The element at position 0
13080     */
13081    struct LDKThirtyTwoBytes a;
13082    /**
13083     * The element at position 1
13084     */
13085    struct LDKChannelMonitor b;
13086 } LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ;
13087
13088 /**
13089  * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ
13090  */
13091 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr {
13092    /**
13093     * A pointer to the contents in the success state.
13094     * Reading from this pointer when `result_ok` is not set is undefined.
13095     */
13096    struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
13097    /**
13098     * A pointer to the contents in the error state.
13099     * Reading from this pointer when `result_ok` is set is undefined.
13100     */
13101    struct LDKDecodeError *err;
13102 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr;
13103
13104 /**
13105  * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
13106  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13107  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13108  */
13109 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ {
13110    /**
13111     * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ, accessible via either
13112     * `err` or `result` depending on the state of `result_ok`.
13113     */
13114    union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr contents;
13115    /**
13116     * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents a success state.
13117     */
13118    bool result_ok;
13119 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ;
13120
13121 /**
13122  * Defines a type identifier for sending messages over the wire.
13123  *
13124  * Messages implementing this trait specify a type and must be [`Writeable`].
13125  */
13126 typedef struct LDKType {
13127    /**
13128     * An opaque pointer which is passed to your function implementations as an argument.
13129     * This has no meaning in the LDK, and can be NULL or any other value.
13130     */
13131    void *this_arg;
13132    /**
13133     * Returns the type identifying the message payload.
13134     */
13135    uint16_t (*type_id)(const void *this_arg);
13136    /**
13137     * Return a human-readable "debug" string describing this object
13138     */
13139    struct LDKStr (*debug_str)(const void *this_arg);
13140    /**
13141     * Serialize the object into a byte array
13142     */
13143    struct LDKCVec_u8Z (*write)(const void *this_arg);
13144    /**
13145     * Called, if set, after this Type has been cloned into a duplicate object.
13146     * The new Type is provided, and should be mutated as needed to perform a
13147     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
13148     */
13149    void (*cloned)(struct LDKType *NONNULL_PTR new_Type);
13150    /**
13151     * Frees any resources associated with this object given its this_arg pointer.
13152     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13153     */
13154    void (*free)(void *this_arg);
13155 } LDKType;
13156
13157 /**
13158  * A tuple of 2 elements. See the individual fields for the types contained.
13159  */
13160 typedef struct LDKC2Tuple_PublicKeyTypeZ {
13161    /**
13162     * The element at position 0
13163     */
13164    struct LDKPublicKey a;
13165    /**
13166     * The element at position 1
13167     */
13168    struct LDKType b;
13169 } LDKC2Tuple_PublicKeyTypeZ;
13170
13171 /**
13172  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
13173  * This corresponds to std::vector in C++
13174  */
13175 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
13176    /**
13177     * The elements in the array.
13178     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13179     */
13180    struct LDKC2Tuple_PublicKeyTypeZ *data;
13181    /**
13182     * The number of elements pointed to by `data`.
13183     */
13184    uintptr_t datalen;
13185 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
13186
13187 /**
13188  * A tuple of 2 elements. See the individual fields for the types contained.
13189  */
13190 typedef struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ {
13191    /**
13192     * The element at position 0
13193     */
13194    struct LDKPublicKey a;
13195    /**
13196     * The element at position 1
13197     */
13198    struct LDKCVec_SocketAddressZ b;
13199 } LDKC2Tuple_PublicKeyCVec_SocketAddressZZ;
13200
13201 /**
13202  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyCVec_SocketAddressZZs of arbitrary size.
13203  * This corresponds to std::vector in C++
13204  */
13205 typedef struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ {
13206    /**
13207     * The elements in the array.
13208     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13209     */
13210    struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *data;
13211    /**
13212     * The number of elements pointed to by `data`.
13213     */
13214    uintptr_t datalen;
13215 } LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ;
13216
13217 /**
13218  * The contents of an onion message.
13219  */
13220 typedef struct LDKOnionMessageContents {
13221    /**
13222     * An opaque pointer which is passed to your function implementations as an argument.
13223     * This has no meaning in the LDK, and can be NULL or any other value.
13224     */
13225    void *this_arg;
13226    /**
13227     * Returns the TLV type identifying the message contents. MUST be >= 64.
13228     */
13229    uint64_t (*tlv_type)(const void *this_arg);
13230    /**
13231     * Serialize the object into a byte array
13232     */
13233    struct LDKCVec_u8Z (*write)(const void *this_arg);
13234    /**
13235     * Return a human-readable "debug" string describing this object
13236     */
13237    struct LDKStr (*debug_str)(const void *this_arg);
13238    /**
13239     * Called, if set, after this OnionMessageContents has been cloned into a duplicate object.
13240     * The new OnionMessageContents is provided, and should be mutated as needed to perform a
13241     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
13242     */
13243    void (*cloned)(struct LDKOnionMessageContents *NONNULL_PTR new_OnionMessageContents);
13244    /**
13245     * Frees any resources associated with this object given its this_arg pointer.
13246     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13247     */
13248    void (*free)(void *this_arg);
13249 } LDKOnionMessageContents;
13250
13251 /**
13252  * An enum which can either contain a crate::lightning::onion_message::packet::OnionMessageContents or not
13253  */
13254 typedef enum LDKCOption_OnionMessageContentsZ_Tag {
13255    /**
13256     * When we're in this state, this COption_OnionMessageContentsZ contains a crate::lightning::onion_message::packet::OnionMessageContents
13257     */
13258    LDKCOption_OnionMessageContentsZ_Some,
13259    /**
13260     * When we're in this state, this COption_OnionMessageContentsZ contains nothing
13261     */
13262    LDKCOption_OnionMessageContentsZ_None,
13263    /**
13264     * Must be last for serialization purposes
13265     */
13266    LDKCOption_OnionMessageContentsZ_Sentinel,
13267 } LDKCOption_OnionMessageContentsZ_Tag;
13268
13269 typedef struct LDKCOption_OnionMessageContentsZ {
13270    LDKCOption_OnionMessageContentsZ_Tag tag;
13271    union {
13272       struct {
13273          struct LDKOnionMessageContents some;
13274       };
13275    };
13276 } LDKCOption_OnionMessageContentsZ;
13277
13278 /**
13279  * The contents of CResult_COption_OnionMessageContentsZDecodeErrorZ
13280  */
13281 typedef union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr {
13282    /**
13283     * A pointer to the contents in the success state.
13284     * Reading from this pointer when `result_ok` is not set is undefined.
13285     */
13286    struct LDKCOption_OnionMessageContentsZ *result;
13287    /**
13288     * A pointer to the contents in the error state.
13289     * Reading from this pointer when `result_ok` is set is undefined.
13290     */
13291    struct LDKDecodeError *err;
13292 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr;
13293
13294 /**
13295  * A CResult_COption_OnionMessageContentsZDecodeErrorZ represents the result of a fallible operation,
13296  * containing a crate::c_types::derived::COption_OnionMessageContentsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13297  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13298  */
13299 typedef struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ {
13300    /**
13301     * The contents of this CResult_COption_OnionMessageContentsZDecodeErrorZ, accessible via either
13302     * `err` or `result` depending on the state of `result_ok`.
13303     */
13304    union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr contents;
13305    /**
13306     * Whether this CResult_COption_OnionMessageContentsZDecodeErrorZ represents a success state.
13307     */
13308    bool result_ok;
13309 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZ;
13310
13311 /**
13312  * A tuple of 3 elements. See the individual fields for the types contained.
13313  */
13314 typedef struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ {
13315    /**
13316     * The element at position 0
13317     */
13318    struct LDKOnionMessageContents a;
13319    /**
13320     * The element at position 1
13321     */
13322    struct LDKDestination b;
13323    /**
13324     * The element at position 2
13325     */
13326    struct LDKBlindedPath c;
13327 } LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ;
13328
13329 /**
13330  * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OnionMessageContentsDestinationBlindedPathZs of arbitrary size.
13331  * This corresponds to std::vector in C++
13332  */
13333 typedef struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ {
13334    /**
13335     * The elements in the array.
13336     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13337     */
13338    struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *data;
13339    /**
13340     * The number of elements pointed to by `data`.
13341     */
13342    uintptr_t datalen;
13343 } LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ;
13344
13345 /**
13346  * An enum which can either contain a crate::lightning::ln::wire::Type or not
13347  */
13348 typedef enum LDKCOption_TypeZ_Tag {
13349    /**
13350     * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
13351     */
13352    LDKCOption_TypeZ_Some,
13353    /**
13354     * When we're in this state, this COption_TypeZ contains nothing
13355     */
13356    LDKCOption_TypeZ_None,
13357    /**
13358     * Must be last for serialization purposes
13359     */
13360    LDKCOption_TypeZ_Sentinel,
13361 } LDKCOption_TypeZ_Tag;
13362
13363 typedef struct LDKCOption_TypeZ {
13364    LDKCOption_TypeZ_Tag tag;
13365    union {
13366       struct {
13367          struct LDKType some;
13368       };
13369    };
13370 } LDKCOption_TypeZ;
13371
13372 /**
13373  * The contents of CResult_COption_TypeZDecodeErrorZ
13374  */
13375 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
13376    /**
13377     * A pointer to the contents in the success state.
13378     * Reading from this pointer when `result_ok` is not set is undefined.
13379     */
13380    struct LDKCOption_TypeZ *result;
13381    /**
13382     * A pointer to the contents in the error state.
13383     * Reading from this pointer when `result_ok` is set is undefined.
13384     */
13385    struct LDKDecodeError *err;
13386 } LDKCResult_COption_TypeZDecodeErrorZPtr;
13387
13388 /**
13389  * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
13390  * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13391  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13392  */
13393 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
13394    /**
13395     * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
13396     * `err` or `result` depending on the state of `result_ok`.
13397     */
13398    union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
13399    /**
13400     * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
13401     */
13402    bool result_ok;
13403 } LDKCResult_COption_TypeZDecodeErrorZ;
13404
13405 /**
13406  * An enum which can either contain a crate::lightning::ln::msgs::SocketAddress or not
13407  */
13408 typedef enum LDKCOption_SocketAddressZ_Tag {
13409    /**
13410     * When we're in this state, this COption_SocketAddressZ contains a crate::lightning::ln::msgs::SocketAddress
13411     */
13412    LDKCOption_SocketAddressZ_Some,
13413    /**
13414     * When we're in this state, this COption_SocketAddressZ contains nothing
13415     */
13416    LDKCOption_SocketAddressZ_None,
13417    /**
13418     * Must be last for serialization purposes
13419     */
13420    LDKCOption_SocketAddressZ_Sentinel,
13421 } LDKCOption_SocketAddressZ_Tag;
13422
13423 typedef struct LDKCOption_SocketAddressZ {
13424    LDKCOption_SocketAddressZ_Tag tag;
13425    union {
13426       struct {
13427          struct LDKSocketAddress some;
13428       };
13429    };
13430 } LDKCOption_SocketAddressZ;
13431
13432
13433
13434 /**
13435  * Details of a connected peer as returned by [`PeerManager::list_peers`].
13436  */
13437 typedef struct MUST_USE_STRUCT LDKPeerDetails {
13438    /**
13439     * A pointer to the opaque Rust object.
13440     * Nearly everywhere, inner must be non-null, however in places where
13441     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13442     */
13443    LDKnativePeerDetails *inner;
13444    /**
13445     * Indicates that this is the only struct which contains the same pointer.
13446     * Rust functions which take ownership of an object provided via an argument require
13447     * this to be true and invalidate the object pointed to by inner.
13448     */
13449    bool is_owned;
13450 } LDKPeerDetails;
13451
13452 /**
13453  * A dynamically-allocated array of crate::lightning::ln::peer_handler::PeerDetailss of arbitrary size.
13454  * This corresponds to std::vector in C++
13455  */
13456 typedef struct LDKCVec_PeerDetailsZ {
13457    /**
13458     * The elements in the array.
13459     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13460     */
13461    struct LDKPeerDetails *data;
13462    /**
13463     * The number of elements pointed to by `data`.
13464     */
13465    uintptr_t datalen;
13466 } LDKCVec_PeerDetailsZ;
13467
13468
13469
13470 /**
13471  * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
13472  * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
13473  * descriptor.
13474  */
13475 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
13476    /**
13477     * A pointer to the opaque Rust object.
13478     * Nearly everywhere, inner must be non-null, however in places where
13479     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13480     */
13481    LDKnativePeerHandleError *inner;
13482    /**
13483     * Indicates that this is the only struct which contains the same pointer.
13484     * Rust functions which take ownership of an object provided via an argument require
13485     * this to be true and invalidate the object pointed to by inner.
13486     */
13487    bool is_owned;
13488 } LDKPeerHandleError;
13489
13490 /**
13491  * The contents of CResult_CVec_u8ZPeerHandleErrorZ
13492  */
13493 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
13494    /**
13495     * A pointer to the contents in the success state.
13496     * Reading from this pointer when `result_ok` is not set is undefined.
13497     */
13498    struct LDKCVec_u8Z *result;
13499    /**
13500     * A pointer to the contents in the error state.
13501     * Reading from this pointer when `result_ok` is set is undefined.
13502     */
13503    struct LDKPeerHandleError *err;
13504 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
13505
13506 /**
13507  * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
13508  * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
13509  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13510  */
13511 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
13512    /**
13513     * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
13514     * `err` or `result` depending on the state of `result_ok`.
13515     */
13516    union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
13517    /**
13518     * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
13519     */
13520    bool result_ok;
13521 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
13522
13523 /**
13524  * The contents of CResult_NonePeerHandleErrorZ
13525  */
13526 typedef union LDKCResult_NonePeerHandleErrorZPtr {
13527    /**
13528     * Note that this value is always NULL, as there are no contents in the OK variant
13529     */
13530    void *result;
13531    /**
13532     * A pointer to the contents in the error state.
13533     * Reading from this pointer when `result_ok` is set is undefined.
13534     */
13535    struct LDKPeerHandleError *err;
13536 } LDKCResult_NonePeerHandleErrorZPtr;
13537
13538 /**
13539  * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
13540  * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
13541  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13542  */
13543 typedef struct LDKCResult_NonePeerHandleErrorZ {
13544    /**
13545     * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
13546     * `err` or `result` depending on the state of `result_ok`.
13547     */
13548    union LDKCResult_NonePeerHandleErrorZPtr contents;
13549    /**
13550     * Whether this CResult_NonePeerHandleErrorZ represents a success state.
13551     */
13552    bool result_ok;
13553 } LDKCResult_NonePeerHandleErrorZ;
13554
13555 /**
13556  * The contents of CResult_boolPeerHandleErrorZ
13557  */
13558 typedef union LDKCResult_boolPeerHandleErrorZPtr {
13559    /**
13560     * A pointer to the contents in the success state.
13561     * Reading from this pointer when `result_ok` is not set is undefined.
13562     */
13563    bool *result;
13564    /**
13565     * A pointer to the contents in the error state.
13566     * Reading from this pointer when `result_ok` is set is undefined.
13567     */
13568    struct LDKPeerHandleError *err;
13569 } LDKCResult_boolPeerHandleErrorZPtr;
13570
13571 /**
13572  * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
13573  * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
13574  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13575  */
13576 typedef struct LDKCResult_boolPeerHandleErrorZ {
13577    /**
13578     * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
13579     * `err` or `result` depending on the state of `result_ok`.
13580     */
13581    union LDKCResult_boolPeerHandleErrorZPtr contents;
13582    /**
13583     * Whether this CResult_boolPeerHandleErrorZ represents a success state.
13584     */
13585    bool result_ok;
13586 } LDKCResult_boolPeerHandleErrorZ;
13587
13588 /**
13589  * All-encompassing standard error type that processing can return
13590  */
13591 typedef enum LDKGraphSyncError_Tag {
13592    /**
13593     * Error trying to read the update data, typically due to an erroneous data length indication
13594     * that is greater than the actual amount of data provided
13595     */
13596    LDKGraphSyncError_DecodeError,
13597    /**
13598     * Error applying the patch to the network graph, usually the result of updates that are too
13599     * old or missing prerequisite data to the application of updates out of order
13600     */
13601    LDKGraphSyncError_LightningError,
13602    /**
13603     * Must be last for serialization purposes
13604     */
13605    LDKGraphSyncError_Sentinel,
13606 } LDKGraphSyncError_Tag;
13607
13608 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
13609    LDKGraphSyncError_Tag tag;
13610    union {
13611       struct {
13612          struct LDKDecodeError decode_error;
13613       };
13614       struct {
13615          struct LDKLightningError lightning_error;
13616       };
13617    };
13618 } LDKGraphSyncError;
13619
13620 /**
13621  * The contents of CResult_u32GraphSyncErrorZ
13622  */
13623 typedef union LDKCResult_u32GraphSyncErrorZPtr {
13624    /**
13625     * A pointer to the contents in the success state.
13626     * Reading from this pointer when `result_ok` is not set is undefined.
13627     */
13628    uint32_t *result;
13629    /**
13630     * A pointer to the contents in the error state.
13631     * Reading from this pointer when `result_ok` is set is undefined.
13632     */
13633    struct LDKGraphSyncError *err;
13634 } LDKCResult_u32GraphSyncErrorZPtr;
13635
13636 /**
13637  * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
13638  * containing a u32 on success and a crate::lightning_rapid_gossip_sync::GraphSyncError on failure.
13639  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13640  */
13641 typedef struct LDKCResult_u32GraphSyncErrorZ {
13642    /**
13643     * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
13644     * `err` or `result` depending on the state of `result_ok`.
13645     */
13646    union LDKCResult_u32GraphSyncErrorZPtr contents;
13647    /**
13648     * Whether this CResult_u32GraphSyncErrorZ represents a success state.
13649     */
13650    bool result_ok;
13651 } LDKCResult_u32GraphSyncErrorZ;
13652
13653 /**
13654  * The contents of CResult_CVec_u8ZIOErrorZ
13655  */
13656 typedef union LDKCResult_CVec_u8ZIOErrorZPtr {
13657    /**
13658     * A pointer to the contents in the success state.
13659     * Reading from this pointer when `result_ok` is not set is undefined.
13660     */
13661    struct LDKCVec_u8Z *result;
13662    /**
13663     * A pointer to the contents in the error state.
13664     * Reading from this pointer when `result_ok` is set is undefined.
13665     */
13666    enum LDKIOError *err;
13667 } LDKCResult_CVec_u8ZIOErrorZPtr;
13668
13669 /**
13670  * A CResult_CVec_u8ZIOErrorZ represents the result of a fallible operation,
13671  * containing a crate::c_types::derived::CVec_u8Z on success and a crate::c_types::IOError on failure.
13672  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13673  */
13674 typedef struct LDKCResult_CVec_u8ZIOErrorZ {
13675    /**
13676     * The contents of this CResult_CVec_u8ZIOErrorZ, accessible via either
13677     * `err` or `result` depending on the state of `result_ok`.
13678     */
13679    union LDKCResult_CVec_u8ZIOErrorZPtr contents;
13680    /**
13681     * Whether this CResult_CVec_u8ZIOErrorZ represents a success state.
13682     */
13683    bool result_ok;
13684 } LDKCResult_CVec_u8ZIOErrorZ;
13685
13686 /**
13687  * A dynamically-allocated array of crate::c_types::Strs of arbitrary size.
13688  * This corresponds to std::vector in C++
13689  */
13690 typedef struct LDKCVec_StrZ {
13691    /**
13692     * The elements in the array.
13693     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13694     */
13695    struct LDKStr *data;
13696    /**
13697     * The number of elements pointed to by `data`.
13698     */
13699    uintptr_t datalen;
13700 } LDKCVec_StrZ;
13701
13702 /**
13703  * The contents of CResult_CVec_StrZIOErrorZ
13704  */
13705 typedef union LDKCResult_CVec_StrZIOErrorZPtr {
13706    /**
13707     * A pointer to the contents in the success state.
13708     * Reading from this pointer when `result_ok` is not set is undefined.
13709     */
13710    struct LDKCVec_StrZ *result;
13711    /**
13712     * A pointer to the contents in the error state.
13713     * Reading from this pointer when `result_ok` is set is undefined.
13714     */
13715    enum LDKIOError *err;
13716 } LDKCResult_CVec_StrZIOErrorZPtr;
13717
13718 /**
13719  * A CResult_CVec_StrZIOErrorZ represents the result of a fallible operation,
13720  * containing a crate::c_types::derived::CVec_StrZ on success and a crate::c_types::IOError on failure.
13721  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13722  */
13723 typedef struct LDKCResult_CVec_StrZIOErrorZ {
13724    /**
13725     * The contents of this CResult_CVec_StrZIOErrorZ, accessible via either
13726     * `err` or `result` depending on the state of `result_ok`.
13727     */
13728    union LDKCResult_CVec_StrZIOErrorZPtr contents;
13729    /**
13730     * Whether this CResult_CVec_StrZIOErrorZ represents a success state.
13731     */
13732    bool result_ok;
13733 } LDKCResult_CVec_StrZIOErrorZ;
13734
13735 /**
13736  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZs of arbitrary size.
13737  * This corresponds to std::vector in C++
13738  */
13739 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ {
13740    /**
13741     * The elements in the array.
13742     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13743     */
13744    struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *data;
13745    /**
13746     * The number of elements pointed to by `data`.
13747     */
13748    uintptr_t datalen;
13749 } LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ;
13750
13751 /**
13752  * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ
13753  */
13754 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr {
13755    /**
13756     * A pointer to the contents in the success state.
13757     * Reading from this pointer when `result_ok` is not set is undefined.
13758     */
13759    struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ *result;
13760    /**
13761     * A pointer to the contents in the error state.
13762     * Reading from this pointer when `result_ok` is set is undefined.
13763     */
13764    enum LDKIOError *err;
13765 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr;
13766
13767 /**
13768  * A CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents the result of a fallible operation,
13769  * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ on success and a crate::c_types::IOError on failure.
13770  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13771  */
13772 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ {
13773    /**
13774     * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ, accessible via either
13775     * `err` or `result` depending on the state of `result_ok`.
13776     */
13777    union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr contents;
13778    /**
13779     * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents a success state.
13780     */
13781    bool result_ok;
13782 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ;
13783
13784 /**
13785  * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ
13786  */
13787 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr {
13788    /**
13789     * A pointer to the contents in the success state.
13790     * Reading from this pointer when `result_ok` is not set is undefined.
13791     */
13792    struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
13793    /**
13794     * A pointer to the contents in the error state.
13795     * Reading from this pointer when `result_ok` is set is undefined.
13796     */
13797    enum LDKIOError *err;
13798 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr;
13799
13800 /**
13801  * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents the result of a fallible operation,
13802  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::c_types::IOError on failure.
13803  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13804  */
13805 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ {
13806    /**
13807     * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ, accessible via either
13808     * `err` or `result` depending on the state of `result_ok`.
13809     */
13810    union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr contents;
13811    /**
13812     * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents a success state.
13813     */
13814    bool result_ok;
13815 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ;
13816
13817 /**
13818  * The contents of CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ
13819  */
13820 typedef union LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr {
13821    /**
13822     * A pointer to the contents in the success state.
13823     * Reading from this pointer when `result_ok` is not set is undefined.
13824     */
13825    struct LDKUnsignedInvoiceRequest *result;
13826    /**
13827     * A pointer to the contents in the error state.
13828     * Reading from this pointer when `result_ok` is set is undefined.
13829     */
13830    enum LDKBolt12SemanticError *err;
13831 } LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr;
13832
13833 /**
13834  * A CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ represents the result of a fallible operation,
13835  * containing a crate::lightning::offers::invoice_request::UnsignedInvoiceRequest on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
13836  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13837  */
13838 typedef struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ {
13839    /**
13840     * The contents of this CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ, accessible via either
13841     * `err` or `result` depending on the state of `result_ok`.
13842     */
13843    union LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr contents;
13844    /**
13845     * Whether this CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ represents a success state.
13846     */
13847    bool result_ok;
13848 } LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ;
13849
13850 /**
13851  * The contents of CResult_InvoiceRequestBolt12SemanticErrorZ
13852  */
13853 typedef union LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr {
13854    /**
13855     * A pointer to the contents in the success state.
13856     * Reading from this pointer when `result_ok` is not set is undefined.
13857     */
13858    struct LDKInvoiceRequest *result;
13859    /**
13860     * A pointer to the contents in the error state.
13861     * Reading from this pointer when `result_ok` is set is undefined.
13862     */
13863    enum LDKBolt12SemanticError *err;
13864 } LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr;
13865
13866 /**
13867  * A CResult_InvoiceRequestBolt12SemanticErrorZ represents the result of a fallible operation,
13868  * containing a crate::lightning::offers::invoice_request::InvoiceRequest on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
13869  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13870  */
13871 typedef struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ {
13872    /**
13873     * The contents of this CResult_InvoiceRequestBolt12SemanticErrorZ, accessible via either
13874     * `err` or `result` depending on the state of `result_ok`.
13875     */
13876    union LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr contents;
13877    /**
13878     * Whether this CResult_InvoiceRequestBolt12SemanticErrorZ represents a success state.
13879     */
13880    bool result_ok;
13881 } LDKCResult_InvoiceRequestBolt12SemanticErrorZ;
13882
13883 /**
13884  * Represents a valid secp256k1 secret key serialized as a 32 byte array.
13885  */
13886 typedef struct LDKSecretKey {
13887    /**
13888     * The bytes of the secret key
13889     */
13890    uint8_t bytes[32];
13891 } LDKSecretKey;
13892
13893 /**
13894  * An enum which can either contain a crate::c_types::SecretKey or not
13895  */
13896 typedef enum LDKCOption_SecretKeyZ_Tag {
13897    /**
13898     * When we're in this state, this COption_SecretKeyZ contains a crate::c_types::SecretKey
13899     */
13900    LDKCOption_SecretKeyZ_Some,
13901    /**
13902     * When we're in this state, this COption_SecretKeyZ contains nothing
13903     */
13904    LDKCOption_SecretKeyZ_None,
13905    /**
13906     * Must be last for serialization purposes
13907     */
13908    LDKCOption_SecretKeyZ_Sentinel,
13909 } LDKCOption_SecretKeyZ_Tag;
13910
13911 typedef struct LDKCOption_SecretKeyZ {
13912    LDKCOption_SecretKeyZ_Tag tag;
13913    union {
13914       struct {
13915          struct LDKSecretKey some;
13916       };
13917    };
13918 } LDKCOption_SecretKeyZ;
13919
13920
13921
13922 /**
13923  * Builds a [`Bolt12Invoice`] from either:
13924  * - an [`InvoiceRequest`] for the \"offer to be paid\" flow or
13925  * - a [`Refund`] for the \"offer for money\" flow.
13926  *
13927  * See [module-level documentation] for usage.
13928  *
13929  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
13930  * [`Refund`]: crate::offers::refund::Refund
13931  * [module-level documentation]: self
13932  */
13933 typedef struct MUST_USE_STRUCT LDKInvoiceWithExplicitSigningPubkeyBuilder {
13934    /**
13935     * A pointer to the opaque Rust object.
13936     * Nearly everywhere, inner must be non-null, however in places where
13937     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13938     */
13939    LDKnativeInvoiceWithExplicitSigningPubkeyBuilder *inner;
13940    /**
13941     * Indicates that this is the only struct which contains the same pointer.
13942     * Rust functions which take ownership of an object provided via an argument require
13943     * this to be true and invalidate the object pointed to by inner.
13944     */
13945    bool is_owned;
13946 } LDKInvoiceWithExplicitSigningPubkeyBuilder;
13947
13948 /**
13949  * The contents of CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ
13950  */
13951 typedef union LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr {
13952    /**
13953     * A pointer to the contents in the success state.
13954     * Reading from this pointer when `result_ok` is not set is undefined.
13955     */
13956    struct LDKInvoiceWithExplicitSigningPubkeyBuilder *result;
13957    /**
13958     * A pointer to the contents in the error state.
13959     * Reading from this pointer when `result_ok` is set is undefined.
13960     */
13961    enum LDKBolt12SemanticError *err;
13962 } LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr;
13963
13964 /**
13965  * A CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
13966  * containing a crate::lightning::offers::invoice::InvoiceWithExplicitSigningPubkeyBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
13967  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13968  */
13969 typedef struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ {
13970    /**
13971     * The contents of this CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ, accessible via either
13972     * `err` or `result` depending on the state of `result_ok`.
13973     */
13974    union LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr contents;
13975    /**
13976     * Whether this CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ represents a success state.
13977     */
13978    bool result_ok;
13979 } LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ;
13980
13981
13982
13983 /**
13984  * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify`] and exposes different
13985  * ways to respond depending on whether the signing keys were derived.
13986  */
13987 typedef struct MUST_USE_STRUCT LDKVerifiedInvoiceRequest {
13988    /**
13989     * A pointer to the opaque Rust object.
13990     * Nearly everywhere, inner must be non-null, however in places where
13991     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13992     */
13993    LDKnativeVerifiedInvoiceRequest *inner;
13994    /**
13995     * Indicates that this is the only struct which contains the same pointer.
13996     * Rust functions which take ownership of an object provided via an argument require
13997     * this to be true and invalidate the object pointed to by inner.
13998     */
13999    bool is_owned;
14000 } LDKVerifiedInvoiceRequest;
14001
14002 /**
14003  * The contents of CResult_VerifiedInvoiceRequestNoneZ
14004  */
14005 typedef union LDKCResult_VerifiedInvoiceRequestNoneZPtr {
14006    /**
14007     * A pointer to the contents in the success state.
14008     * Reading from this pointer when `result_ok` is not set is undefined.
14009     */
14010    struct LDKVerifiedInvoiceRequest *result;
14011    /**
14012     * Note that this value is always NULL, as there are no contents in the Err variant
14013     */
14014    void *err;
14015 } LDKCResult_VerifiedInvoiceRequestNoneZPtr;
14016
14017 /**
14018  * A CResult_VerifiedInvoiceRequestNoneZ represents the result of a fallible operation,
14019  * containing a crate::lightning::offers::invoice_request::VerifiedInvoiceRequest on success and a () on failure.
14020  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14021  */
14022 typedef struct LDKCResult_VerifiedInvoiceRequestNoneZ {
14023    /**
14024     * The contents of this CResult_VerifiedInvoiceRequestNoneZ, accessible via either
14025     * `err` or `result` depending on the state of `result_ok`.
14026     */
14027    union LDKCResult_VerifiedInvoiceRequestNoneZPtr contents;
14028    /**
14029     * Whether this CResult_VerifiedInvoiceRequestNoneZ represents a success state.
14030     */
14031    bool result_ok;
14032 } LDKCResult_VerifiedInvoiceRequestNoneZ;
14033
14034
14035
14036 /**
14037  * Builds a [`Bolt12Invoice`] from either:
14038  * - an [`InvoiceRequest`] for the \"offer to be paid\" flow or
14039  * - a [`Refund`] for the \"offer for money\" flow.
14040  *
14041  * See [module-level documentation] for usage.
14042  *
14043  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
14044  * [`Refund`]: crate::offers::refund::Refund
14045  * [module-level documentation]: self
14046  */
14047 typedef struct MUST_USE_STRUCT LDKInvoiceWithDerivedSigningPubkeyBuilder {
14048    /**
14049     * A pointer to the opaque Rust object.
14050     * Nearly everywhere, inner must be non-null, however in places where
14051     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14052     */
14053    LDKnativeInvoiceWithDerivedSigningPubkeyBuilder *inner;
14054    /**
14055     * Indicates that this is the only struct which contains the same pointer.
14056     * Rust functions which take ownership of an object provided via an argument require
14057     * this to be true and invalidate the object pointed to by inner.
14058     */
14059    bool is_owned;
14060 } LDKInvoiceWithDerivedSigningPubkeyBuilder;
14061
14062 /**
14063  * The contents of CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ
14064  */
14065 typedef union LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr {
14066    /**
14067     * A pointer to the contents in the success state.
14068     * Reading from this pointer when `result_ok` is not set is undefined.
14069     */
14070    struct LDKInvoiceWithDerivedSigningPubkeyBuilder *result;
14071    /**
14072     * A pointer to the contents in the error state.
14073     * Reading from this pointer when `result_ok` is set is undefined.
14074     */
14075    enum LDKBolt12SemanticError *err;
14076 } LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr;
14077
14078 /**
14079  * A CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
14080  * containing a crate::lightning::offers::invoice::InvoiceWithDerivedSigningPubkeyBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
14081  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14082  */
14083 typedef struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ {
14084    /**
14085     * The contents of this CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ, accessible via either
14086     * `err` or `result` depending on the state of `result_ok`.
14087     */
14088    union LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr contents;
14089    /**
14090     * Whether this CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ represents a success state.
14091     */
14092    bool result_ok;
14093 } LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ;
14094
14095
14096
14097 /**
14098  * Fields sent in an [`InvoiceRequest`] message to include in [`PaymentContext::Bolt12Offer`].
14099  *
14100  * [`PaymentContext::Bolt12Offer`]: crate::blinded_path::payment::PaymentContext::Bolt12Offer
14101  */
14102 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFields {
14103    /**
14104     * A pointer to the opaque Rust object.
14105     * Nearly everywhere, inner must be non-null, however in places where
14106     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14107     */
14108    LDKnativeInvoiceRequestFields *inner;
14109    /**
14110     * Indicates that this is the only struct which contains the same pointer.
14111     * Rust functions which take ownership of an object provided via an argument require
14112     * this to be true and invalidate the object pointed to by inner.
14113     */
14114    bool is_owned;
14115 } LDKInvoiceRequestFields;
14116
14117 /**
14118  * The contents of CResult_InvoiceRequestFieldsDecodeErrorZ
14119  */
14120 typedef union LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr {
14121    /**
14122     * A pointer to the contents in the success state.
14123     * Reading from this pointer when `result_ok` is not set is undefined.
14124     */
14125    struct LDKInvoiceRequestFields *result;
14126    /**
14127     * A pointer to the contents in the error state.
14128     * Reading from this pointer when `result_ok` is set is undefined.
14129     */
14130    struct LDKDecodeError *err;
14131 } LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr;
14132
14133 /**
14134  * A CResult_InvoiceRequestFieldsDecodeErrorZ represents the result of a fallible operation,
14135  * containing a crate::lightning::offers::invoice_request::InvoiceRequestFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
14136  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14137  */
14138 typedef struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ {
14139    /**
14140     * The contents of this CResult_InvoiceRequestFieldsDecodeErrorZ, accessible via either
14141     * `err` or `result` depending on the state of `result_ok`.
14142     */
14143    union LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr contents;
14144    /**
14145     * Whether this CResult_InvoiceRequestFieldsDecodeErrorZ represents a success state.
14146     */
14147    bool result_ok;
14148 } LDKCResult_InvoiceRequestFieldsDecodeErrorZ;
14149
14150 /**
14151  * A dynamically-allocated array of crate::c_types::Witnesss of arbitrary size.
14152  * This corresponds to std::vector in C++
14153  */
14154 typedef struct LDKCVec_WitnessZ {
14155    /**
14156     * The elements in the array.
14157     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14158     */
14159    struct LDKWitness *data;
14160    /**
14161     * The number of elements pointed to by `data`.
14162     */
14163    uintptr_t datalen;
14164 } LDKCVec_WitnessZ;
14165
14166 /**
14167  * An enum which can either contain a crate::c_types::ECDSASignature or not
14168  */
14169 typedef enum LDKCOption_ECDSASignatureZ_Tag {
14170    /**
14171     * When we're in this state, this COption_ECDSASignatureZ contains a crate::c_types::ECDSASignature
14172     */
14173    LDKCOption_ECDSASignatureZ_Some,
14174    /**
14175     * When we're in this state, this COption_ECDSASignatureZ contains nothing
14176     */
14177    LDKCOption_ECDSASignatureZ_None,
14178    /**
14179     * Must be last for serialization purposes
14180     */
14181    LDKCOption_ECDSASignatureZ_Sentinel,
14182 } LDKCOption_ECDSASignatureZ_Tag;
14183
14184 typedef struct LDKCOption_ECDSASignatureZ {
14185    LDKCOption_ECDSASignatureZ_Tag tag;
14186    union {
14187       struct {
14188          struct LDKECDSASignature some;
14189       };
14190    };
14191 } LDKCOption_ECDSASignatureZ;
14192
14193 /**
14194  * An enum which can either contain a i64 or not
14195  */
14196 typedef enum LDKCOption_i64Z_Tag {
14197    /**
14198     * When we're in this state, this COption_i64Z contains a i64
14199     */
14200    LDKCOption_i64Z_Some,
14201    /**
14202     * When we're in this state, this COption_i64Z contains nothing
14203     */
14204    LDKCOption_i64Z_None,
14205    /**
14206     * Must be last for serialization purposes
14207     */
14208    LDKCOption_i64Z_Sentinel,
14209 } LDKCOption_i64Z_Tag;
14210
14211 typedef struct LDKCOption_i64Z {
14212    LDKCOption_i64Z_Tag tag;
14213    union {
14214       struct {
14215          int64_t some;
14216       };
14217    };
14218 } LDKCOption_i64Z;
14219
14220 /**
14221  * The contents of CResult_SocketAddressDecodeErrorZ
14222  */
14223 typedef union LDKCResult_SocketAddressDecodeErrorZPtr {
14224    /**
14225     * A pointer to the contents in the success state.
14226     * Reading from this pointer when `result_ok` is not set is undefined.
14227     */
14228    struct LDKSocketAddress *result;
14229    /**
14230     * A pointer to the contents in the error state.
14231     * Reading from this pointer when `result_ok` is set is undefined.
14232     */
14233    struct LDKDecodeError *err;
14234 } LDKCResult_SocketAddressDecodeErrorZPtr;
14235
14236 /**
14237  * A CResult_SocketAddressDecodeErrorZ represents the result of a fallible operation,
14238  * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
14239  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14240  */
14241 typedef struct LDKCResult_SocketAddressDecodeErrorZ {
14242    /**
14243     * The contents of this CResult_SocketAddressDecodeErrorZ, accessible via either
14244     * `err` or `result` depending on the state of `result_ok`.
14245     */
14246    union LDKCResult_SocketAddressDecodeErrorZPtr contents;
14247    /**
14248     * Whether this CResult_SocketAddressDecodeErrorZ represents a success state.
14249     */
14250    bool result_ok;
14251 } LDKCResult_SocketAddressDecodeErrorZ;
14252
14253 /**
14254  * The contents of CResult_SocketAddressSocketAddressParseErrorZ
14255  */
14256 typedef union LDKCResult_SocketAddressSocketAddressParseErrorZPtr {
14257    /**
14258     * A pointer to the contents in the success state.
14259     * Reading from this pointer when `result_ok` is not set is undefined.
14260     */
14261    struct LDKSocketAddress *result;
14262    /**
14263     * A pointer to the contents in the error state.
14264     * Reading from this pointer when `result_ok` is set is undefined.
14265     */
14266    enum LDKSocketAddressParseError *err;
14267 } LDKCResult_SocketAddressSocketAddressParseErrorZPtr;
14268
14269 /**
14270  * A CResult_SocketAddressSocketAddressParseErrorZ represents the result of a fallible operation,
14271  * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::SocketAddressParseError on failure.
14272  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14273  */
14274 typedef struct LDKCResult_SocketAddressSocketAddressParseErrorZ {
14275    /**
14276     * The contents of this CResult_SocketAddressSocketAddressParseErrorZ, accessible via either
14277     * `err` or `result` depending on the state of `result_ok`.
14278     */
14279    union LDKCResult_SocketAddressSocketAddressParseErrorZPtr contents;
14280    /**
14281     * Whether this CResult_SocketAddressSocketAddressParseErrorZ represents a success state.
14282     */
14283    bool result_ok;
14284 } LDKCResult_SocketAddressSocketAddressParseErrorZ;
14285
14286
14287
14288 /**
14289  * An [`update_add_htlc`] message to be sent to or received from a peer.
14290  *
14291  * [`update_add_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#adding-an-htlc-update_add_htlc
14292  */
14293 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
14294    /**
14295     * A pointer to the opaque Rust object.
14296     * Nearly everywhere, inner must be non-null, however in places where
14297     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14298     */
14299    LDKnativeUpdateAddHTLC *inner;
14300    /**
14301     * Indicates that this is the only struct which contains the same pointer.
14302     * Rust functions which take ownership of an object provided via an argument require
14303     * this to be true and invalidate the object pointed to by inner.
14304     */
14305    bool is_owned;
14306 } LDKUpdateAddHTLC;
14307
14308 /**
14309  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
14310  * This corresponds to std::vector in C++
14311  */
14312 typedef struct LDKCVec_UpdateAddHTLCZ {
14313    /**
14314     * The elements in the array.
14315     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14316     */
14317    struct LDKUpdateAddHTLC *data;
14318    /**
14319     * The number of elements pointed to by `data`.
14320     */
14321    uintptr_t datalen;
14322 } LDKCVec_UpdateAddHTLCZ;
14323
14324
14325
14326 /**
14327  * An [`update_fulfill_htlc`] message to be sent to or received from a peer.
14328  *
14329  * [`update_fulfill_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc
14330  */
14331 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
14332    /**
14333     * A pointer to the opaque Rust object.
14334     * Nearly everywhere, inner must be non-null, however in places where
14335     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14336     */
14337    LDKnativeUpdateFulfillHTLC *inner;
14338    /**
14339     * Indicates that this is the only struct which contains the same pointer.
14340     * Rust functions which take ownership of an object provided via an argument require
14341     * this to be true and invalidate the object pointed to by inner.
14342     */
14343    bool is_owned;
14344 } LDKUpdateFulfillHTLC;
14345
14346 /**
14347  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
14348  * This corresponds to std::vector in C++
14349  */
14350 typedef struct LDKCVec_UpdateFulfillHTLCZ {
14351    /**
14352     * The elements in the array.
14353     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14354     */
14355    struct LDKUpdateFulfillHTLC *data;
14356    /**
14357     * The number of elements pointed to by `data`.
14358     */
14359    uintptr_t datalen;
14360 } LDKCVec_UpdateFulfillHTLCZ;
14361
14362
14363
14364 /**
14365  * An [`update_fail_htlc`] message to be sent to or received from a peer.
14366  *
14367  * [`update_fail_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc
14368  */
14369 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
14370    /**
14371     * A pointer to the opaque Rust object.
14372     * Nearly everywhere, inner must be non-null, however in places where
14373     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14374     */
14375    LDKnativeUpdateFailHTLC *inner;
14376    /**
14377     * Indicates that this is the only struct which contains the same pointer.
14378     * Rust functions which take ownership of an object provided via an argument require
14379     * this to be true and invalidate the object pointed to by inner.
14380     */
14381    bool is_owned;
14382 } LDKUpdateFailHTLC;
14383
14384 /**
14385  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
14386  * This corresponds to std::vector in C++
14387  */
14388 typedef struct LDKCVec_UpdateFailHTLCZ {
14389    /**
14390     * The elements in the array.
14391     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14392     */
14393    struct LDKUpdateFailHTLC *data;
14394    /**
14395     * The number of elements pointed to by `data`.
14396     */
14397    uintptr_t datalen;
14398 } LDKCVec_UpdateFailHTLCZ;
14399
14400
14401
14402 /**
14403  * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
14404  *
14405  * [`update_fail_malformed_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc
14406  */
14407 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
14408    /**
14409     * A pointer to the opaque Rust object.
14410     * Nearly everywhere, inner must be non-null, however in places where
14411     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14412     */
14413    LDKnativeUpdateFailMalformedHTLC *inner;
14414    /**
14415     * Indicates that this is the only struct which contains the same pointer.
14416     * Rust functions which take ownership of an object provided via an argument require
14417     * this to be true and invalidate the object pointed to by inner.
14418     */
14419    bool is_owned;
14420 } LDKUpdateFailMalformedHTLC;
14421
14422 /**
14423  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
14424  * This corresponds to std::vector in C++
14425  */
14426 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
14427    /**
14428     * The elements in the array.
14429     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14430     */
14431    struct LDKUpdateFailMalformedHTLC *data;
14432    /**
14433     * The number of elements pointed to by `data`.
14434     */
14435    uintptr_t datalen;
14436 } LDKCVec_UpdateFailMalformedHTLCZ;
14437
14438 /**
14439  * The contents of CResult_AcceptChannelDecodeErrorZ
14440  */
14441 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
14442    /**
14443     * A pointer to the contents in the success state.
14444     * Reading from this pointer when `result_ok` is not set is undefined.
14445     */
14446    struct LDKAcceptChannel *result;
14447    /**
14448     * A pointer to the contents in the error state.
14449     * Reading from this pointer when `result_ok` is set is undefined.
14450     */
14451    struct LDKDecodeError *err;
14452 } LDKCResult_AcceptChannelDecodeErrorZPtr;
14453
14454 /**
14455  * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
14456  * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
14457  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14458  */
14459 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
14460    /**
14461     * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
14462     * `err` or `result` depending on the state of `result_ok`.
14463     */
14464    union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
14465    /**
14466     * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
14467     */
14468    bool result_ok;
14469 } LDKCResult_AcceptChannelDecodeErrorZ;
14470
14471 /**
14472  * The contents of CResult_AcceptChannelV2DecodeErrorZ
14473  */
14474 typedef union LDKCResult_AcceptChannelV2DecodeErrorZPtr {
14475    /**
14476     * A pointer to the contents in the success state.
14477     * Reading from this pointer when `result_ok` is not set is undefined.
14478     */
14479    struct LDKAcceptChannelV2 *result;
14480    /**
14481     * A pointer to the contents in the error state.
14482     * Reading from this pointer when `result_ok` is set is undefined.
14483     */
14484    struct LDKDecodeError *err;
14485 } LDKCResult_AcceptChannelV2DecodeErrorZPtr;
14486
14487 /**
14488  * A CResult_AcceptChannelV2DecodeErrorZ represents the result of a fallible operation,
14489  * containing a crate::lightning::ln::msgs::AcceptChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
14490  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14491  */
14492 typedef struct LDKCResult_AcceptChannelV2DecodeErrorZ {
14493    /**
14494     * The contents of this CResult_AcceptChannelV2DecodeErrorZ, accessible via either
14495     * `err` or `result` depending on the state of `result_ok`.
14496     */
14497    union LDKCResult_AcceptChannelV2DecodeErrorZPtr contents;
14498    /**
14499     * Whether this CResult_AcceptChannelV2DecodeErrorZ represents a success state.
14500     */
14501    bool result_ok;
14502 } LDKCResult_AcceptChannelV2DecodeErrorZ;
14503
14504 /**
14505  * The contents of CResult_StfuDecodeErrorZ
14506  */
14507 typedef union LDKCResult_StfuDecodeErrorZPtr {
14508    /**
14509     * A pointer to the contents in the success state.
14510     * Reading from this pointer when `result_ok` is not set is undefined.
14511     */
14512    struct LDKStfu *result;
14513    /**
14514     * A pointer to the contents in the error state.
14515     * Reading from this pointer when `result_ok` is set is undefined.
14516     */
14517    struct LDKDecodeError *err;
14518 } LDKCResult_StfuDecodeErrorZPtr;
14519
14520 /**
14521  * A CResult_StfuDecodeErrorZ represents the result of a fallible operation,
14522  * containing a crate::lightning::ln::msgs::Stfu on success and a crate::lightning::ln::msgs::DecodeError on failure.
14523  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14524  */
14525 typedef struct LDKCResult_StfuDecodeErrorZ {
14526    /**
14527     * The contents of this CResult_StfuDecodeErrorZ, accessible via either
14528     * `err` or `result` depending on the state of `result_ok`.
14529     */
14530    union LDKCResult_StfuDecodeErrorZPtr contents;
14531    /**
14532     * Whether this CResult_StfuDecodeErrorZ represents a success state.
14533     */
14534    bool result_ok;
14535 } LDKCResult_StfuDecodeErrorZ;
14536
14537 /**
14538  * The contents of CResult_SpliceDecodeErrorZ
14539  */
14540 typedef union LDKCResult_SpliceDecodeErrorZPtr {
14541    /**
14542     * A pointer to the contents in the success state.
14543     * Reading from this pointer when `result_ok` is not set is undefined.
14544     */
14545    struct LDKSplice *result;
14546    /**
14547     * A pointer to the contents in the error state.
14548     * Reading from this pointer when `result_ok` is set is undefined.
14549     */
14550    struct LDKDecodeError *err;
14551 } LDKCResult_SpliceDecodeErrorZPtr;
14552
14553 /**
14554  * A CResult_SpliceDecodeErrorZ represents the result of a fallible operation,
14555  * containing a crate::lightning::ln::msgs::Splice on success and a crate::lightning::ln::msgs::DecodeError on failure.
14556  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14557  */
14558 typedef struct LDKCResult_SpliceDecodeErrorZ {
14559    /**
14560     * The contents of this CResult_SpliceDecodeErrorZ, accessible via either
14561     * `err` or `result` depending on the state of `result_ok`.
14562     */
14563    union LDKCResult_SpliceDecodeErrorZPtr contents;
14564    /**
14565     * Whether this CResult_SpliceDecodeErrorZ represents a success state.
14566     */
14567    bool result_ok;
14568 } LDKCResult_SpliceDecodeErrorZ;
14569
14570 /**
14571  * The contents of CResult_SpliceAckDecodeErrorZ
14572  */
14573 typedef union LDKCResult_SpliceAckDecodeErrorZPtr {
14574    /**
14575     * A pointer to the contents in the success state.
14576     * Reading from this pointer when `result_ok` is not set is undefined.
14577     */
14578    struct LDKSpliceAck *result;
14579    /**
14580     * A pointer to the contents in the error state.
14581     * Reading from this pointer when `result_ok` is set is undefined.
14582     */
14583    struct LDKDecodeError *err;
14584 } LDKCResult_SpliceAckDecodeErrorZPtr;
14585
14586 /**
14587  * A CResult_SpliceAckDecodeErrorZ represents the result of a fallible operation,
14588  * containing a crate::lightning::ln::msgs::SpliceAck on success and a crate::lightning::ln::msgs::DecodeError on failure.
14589  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14590  */
14591 typedef struct LDKCResult_SpliceAckDecodeErrorZ {
14592    /**
14593     * The contents of this CResult_SpliceAckDecodeErrorZ, accessible via either
14594     * `err` or `result` depending on the state of `result_ok`.
14595     */
14596    union LDKCResult_SpliceAckDecodeErrorZPtr contents;
14597    /**
14598     * Whether this CResult_SpliceAckDecodeErrorZ represents a success state.
14599     */
14600    bool result_ok;
14601 } LDKCResult_SpliceAckDecodeErrorZ;
14602
14603 /**
14604  * The contents of CResult_SpliceLockedDecodeErrorZ
14605  */
14606 typedef union LDKCResult_SpliceLockedDecodeErrorZPtr {
14607    /**
14608     * A pointer to the contents in the success state.
14609     * Reading from this pointer when `result_ok` is not set is undefined.
14610     */
14611    struct LDKSpliceLocked *result;
14612    /**
14613     * A pointer to the contents in the error state.
14614     * Reading from this pointer when `result_ok` is set is undefined.
14615     */
14616    struct LDKDecodeError *err;
14617 } LDKCResult_SpliceLockedDecodeErrorZPtr;
14618
14619 /**
14620  * A CResult_SpliceLockedDecodeErrorZ represents the result of a fallible operation,
14621  * containing a crate::lightning::ln::msgs::SpliceLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
14622  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14623  */
14624 typedef struct LDKCResult_SpliceLockedDecodeErrorZ {
14625    /**
14626     * The contents of this CResult_SpliceLockedDecodeErrorZ, accessible via either
14627     * `err` or `result` depending on the state of `result_ok`.
14628     */
14629    union LDKCResult_SpliceLockedDecodeErrorZPtr contents;
14630    /**
14631     * Whether this CResult_SpliceLockedDecodeErrorZ represents a success state.
14632     */
14633    bool result_ok;
14634 } LDKCResult_SpliceLockedDecodeErrorZ;
14635
14636 /**
14637  * The contents of CResult_TxAddInputDecodeErrorZ
14638  */
14639 typedef union LDKCResult_TxAddInputDecodeErrorZPtr {
14640    /**
14641     * A pointer to the contents in the success state.
14642     * Reading from this pointer when `result_ok` is not set is undefined.
14643     */
14644    struct LDKTxAddInput *result;
14645    /**
14646     * A pointer to the contents in the error state.
14647     * Reading from this pointer when `result_ok` is set is undefined.
14648     */
14649    struct LDKDecodeError *err;
14650 } LDKCResult_TxAddInputDecodeErrorZPtr;
14651
14652 /**
14653  * A CResult_TxAddInputDecodeErrorZ represents the result of a fallible operation,
14654  * containing a crate::lightning::ln::msgs::TxAddInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14655  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14656  */
14657 typedef struct LDKCResult_TxAddInputDecodeErrorZ {
14658    /**
14659     * The contents of this CResult_TxAddInputDecodeErrorZ, accessible via either
14660     * `err` or `result` depending on the state of `result_ok`.
14661     */
14662    union LDKCResult_TxAddInputDecodeErrorZPtr contents;
14663    /**
14664     * Whether this CResult_TxAddInputDecodeErrorZ represents a success state.
14665     */
14666    bool result_ok;
14667 } LDKCResult_TxAddInputDecodeErrorZ;
14668
14669 /**
14670  * The contents of CResult_TxAddOutputDecodeErrorZ
14671  */
14672 typedef union LDKCResult_TxAddOutputDecodeErrorZPtr {
14673    /**
14674     * A pointer to the contents in the success state.
14675     * Reading from this pointer when `result_ok` is not set is undefined.
14676     */
14677    struct LDKTxAddOutput *result;
14678    /**
14679     * A pointer to the contents in the error state.
14680     * Reading from this pointer when `result_ok` is set is undefined.
14681     */
14682    struct LDKDecodeError *err;
14683 } LDKCResult_TxAddOutputDecodeErrorZPtr;
14684
14685 /**
14686  * A CResult_TxAddOutputDecodeErrorZ represents the result of a fallible operation,
14687  * containing a crate::lightning::ln::msgs::TxAddOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14688  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14689  */
14690 typedef struct LDKCResult_TxAddOutputDecodeErrorZ {
14691    /**
14692     * The contents of this CResult_TxAddOutputDecodeErrorZ, accessible via either
14693     * `err` or `result` depending on the state of `result_ok`.
14694     */
14695    union LDKCResult_TxAddOutputDecodeErrorZPtr contents;
14696    /**
14697     * Whether this CResult_TxAddOutputDecodeErrorZ represents a success state.
14698     */
14699    bool result_ok;
14700 } LDKCResult_TxAddOutputDecodeErrorZ;
14701
14702 /**
14703  * The contents of CResult_TxRemoveInputDecodeErrorZ
14704  */
14705 typedef union LDKCResult_TxRemoveInputDecodeErrorZPtr {
14706    /**
14707     * A pointer to the contents in the success state.
14708     * Reading from this pointer when `result_ok` is not set is undefined.
14709     */
14710    struct LDKTxRemoveInput *result;
14711    /**
14712     * A pointer to the contents in the error state.
14713     * Reading from this pointer when `result_ok` is set is undefined.
14714     */
14715    struct LDKDecodeError *err;
14716 } LDKCResult_TxRemoveInputDecodeErrorZPtr;
14717
14718 /**
14719  * A CResult_TxRemoveInputDecodeErrorZ represents the result of a fallible operation,
14720  * containing a crate::lightning::ln::msgs::TxRemoveInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14721  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14722  */
14723 typedef struct LDKCResult_TxRemoveInputDecodeErrorZ {
14724    /**
14725     * The contents of this CResult_TxRemoveInputDecodeErrorZ, accessible via either
14726     * `err` or `result` depending on the state of `result_ok`.
14727     */
14728    union LDKCResult_TxRemoveInputDecodeErrorZPtr contents;
14729    /**
14730     * Whether this CResult_TxRemoveInputDecodeErrorZ represents a success state.
14731     */
14732    bool result_ok;
14733 } LDKCResult_TxRemoveInputDecodeErrorZ;
14734
14735 /**
14736  * The contents of CResult_TxRemoveOutputDecodeErrorZ
14737  */
14738 typedef union LDKCResult_TxRemoveOutputDecodeErrorZPtr {
14739    /**
14740     * A pointer to the contents in the success state.
14741     * Reading from this pointer when `result_ok` is not set is undefined.
14742     */
14743    struct LDKTxRemoveOutput *result;
14744    /**
14745     * A pointer to the contents in the error state.
14746     * Reading from this pointer when `result_ok` is set is undefined.
14747     */
14748    struct LDKDecodeError *err;
14749 } LDKCResult_TxRemoveOutputDecodeErrorZPtr;
14750
14751 /**
14752  * A CResult_TxRemoveOutputDecodeErrorZ represents the result of a fallible operation,
14753  * containing a crate::lightning::ln::msgs::TxRemoveOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14754  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14755  */
14756 typedef struct LDKCResult_TxRemoveOutputDecodeErrorZ {
14757    /**
14758     * The contents of this CResult_TxRemoveOutputDecodeErrorZ, accessible via either
14759     * `err` or `result` depending on the state of `result_ok`.
14760     */
14761    union LDKCResult_TxRemoveOutputDecodeErrorZPtr contents;
14762    /**
14763     * Whether this CResult_TxRemoveOutputDecodeErrorZ represents a success state.
14764     */
14765    bool result_ok;
14766 } LDKCResult_TxRemoveOutputDecodeErrorZ;
14767
14768 /**
14769  * The contents of CResult_TxCompleteDecodeErrorZ
14770  */
14771 typedef union LDKCResult_TxCompleteDecodeErrorZPtr {
14772    /**
14773     * A pointer to the contents in the success state.
14774     * Reading from this pointer when `result_ok` is not set is undefined.
14775     */
14776    struct LDKTxComplete *result;
14777    /**
14778     * A pointer to the contents in the error state.
14779     * Reading from this pointer when `result_ok` is set is undefined.
14780     */
14781    struct LDKDecodeError *err;
14782 } LDKCResult_TxCompleteDecodeErrorZPtr;
14783
14784 /**
14785  * A CResult_TxCompleteDecodeErrorZ represents the result of a fallible operation,
14786  * containing a crate::lightning::ln::msgs::TxComplete on success and a crate::lightning::ln::msgs::DecodeError on failure.
14787  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14788  */
14789 typedef struct LDKCResult_TxCompleteDecodeErrorZ {
14790    /**
14791     * The contents of this CResult_TxCompleteDecodeErrorZ, accessible via either
14792     * `err` or `result` depending on the state of `result_ok`.
14793     */
14794    union LDKCResult_TxCompleteDecodeErrorZPtr contents;
14795    /**
14796     * Whether this CResult_TxCompleteDecodeErrorZ represents a success state.
14797     */
14798    bool result_ok;
14799 } LDKCResult_TxCompleteDecodeErrorZ;
14800
14801 /**
14802  * The contents of CResult_TxSignaturesDecodeErrorZ
14803  */
14804 typedef union LDKCResult_TxSignaturesDecodeErrorZPtr {
14805    /**
14806     * A pointer to the contents in the success state.
14807     * Reading from this pointer when `result_ok` is not set is undefined.
14808     */
14809    struct LDKTxSignatures *result;
14810    /**
14811     * A pointer to the contents in the error state.
14812     * Reading from this pointer when `result_ok` is set is undefined.
14813     */
14814    struct LDKDecodeError *err;
14815 } LDKCResult_TxSignaturesDecodeErrorZPtr;
14816
14817 /**
14818  * A CResult_TxSignaturesDecodeErrorZ represents the result of a fallible operation,
14819  * containing a crate::lightning::ln::msgs::TxSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
14820  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14821  */
14822 typedef struct LDKCResult_TxSignaturesDecodeErrorZ {
14823    /**
14824     * The contents of this CResult_TxSignaturesDecodeErrorZ, accessible via either
14825     * `err` or `result` depending on the state of `result_ok`.
14826     */
14827    union LDKCResult_TxSignaturesDecodeErrorZPtr contents;
14828    /**
14829     * Whether this CResult_TxSignaturesDecodeErrorZ represents a success state.
14830     */
14831    bool result_ok;
14832 } LDKCResult_TxSignaturesDecodeErrorZ;
14833
14834 /**
14835  * The contents of CResult_TxInitRbfDecodeErrorZ
14836  */
14837 typedef union LDKCResult_TxInitRbfDecodeErrorZPtr {
14838    /**
14839     * A pointer to the contents in the success state.
14840     * Reading from this pointer when `result_ok` is not set is undefined.
14841     */
14842    struct LDKTxInitRbf *result;
14843    /**
14844     * A pointer to the contents in the error state.
14845     * Reading from this pointer when `result_ok` is set is undefined.
14846     */
14847    struct LDKDecodeError *err;
14848 } LDKCResult_TxInitRbfDecodeErrorZPtr;
14849
14850 /**
14851  * A CResult_TxInitRbfDecodeErrorZ represents the result of a fallible operation,
14852  * containing a crate::lightning::ln::msgs::TxInitRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
14853  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14854  */
14855 typedef struct LDKCResult_TxInitRbfDecodeErrorZ {
14856    /**
14857     * The contents of this CResult_TxInitRbfDecodeErrorZ, accessible via either
14858     * `err` or `result` depending on the state of `result_ok`.
14859     */
14860    union LDKCResult_TxInitRbfDecodeErrorZPtr contents;
14861    /**
14862     * Whether this CResult_TxInitRbfDecodeErrorZ represents a success state.
14863     */
14864    bool result_ok;
14865 } LDKCResult_TxInitRbfDecodeErrorZ;
14866
14867 /**
14868  * The contents of CResult_TxAckRbfDecodeErrorZ
14869  */
14870 typedef union LDKCResult_TxAckRbfDecodeErrorZPtr {
14871    /**
14872     * A pointer to the contents in the success state.
14873     * Reading from this pointer when `result_ok` is not set is undefined.
14874     */
14875    struct LDKTxAckRbf *result;
14876    /**
14877     * A pointer to the contents in the error state.
14878     * Reading from this pointer when `result_ok` is set is undefined.
14879     */
14880    struct LDKDecodeError *err;
14881 } LDKCResult_TxAckRbfDecodeErrorZPtr;
14882
14883 /**
14884  * A CResult_TxAckRbfDecodeErrorZ represents the result of a fallible operation,
14885  * containing a crate::lightning::ln::msgs::TxAckRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
14886  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14887  */
14888 typedef struct LDKCResult_TxAckRbfDecodeErrorZ {
14889    /**
14890     * The contents of this CResult_TxAckRbfDecodeErrorZ, accessible via either
14891     * `err` or `result` depending on the state of `result_ok`.
14892     */
14893    union LDKCResult_TxAckRbfDecodeErrorZPtr contents;
14894    /**
14895     * Whether this CResult_TxAckRbfDecodeErrorZ represents a success state.
14896     */
14897    bool result_ok;
14898 } LDKCResult_TxAckRbfDecodeErrorZ;
14899
14900 /**
14901  * The contents of CResult_TxAbortDecodeErrorZ
14902  */
14903 typedef union LDKCResult_TxAbortDecodeErrorZPtr {
14904    /**
14905     * A pointer to the contents in the success state.
14906     * Reading from this pointer when `result_ok` is not set is undefined.
14907     */
14908    struct LDKTxAbort *result;
14909    /**
14910     * A pointer to the contents in the error state.
14911     * Reading from this pointer when `result_ok` is set is undefined.
14912     */
14913    struct LDKDecodeError *err;
14914 } LDKCResult_TxAbortDecodeErrorZPtr;
14915
14916 /**
14917  * A CResult_TxAbortDecodeErrorZ represents the result of a fallible operation,
14918  * containing a crate::lightning::ln::msgs::TxAbort on success and a crate::lightning::ln::msgs::DecodeError on failure.
14919  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14920  */
14921 typedef struct LDKCResult_TxAbortDecodeErrorZ {
14922    /**
14923     * The contents of this CResult_TxAbortDecodeErrorZ, accessible via either
14924     * `err` or `result` depending on the state of `result_ok`.
14925     */
14926    union LDKCResult_TxAbortDecodeErrorZPtr contents;
14927    /**
14928     * Whether this CResult_TxAbortDecodeErrorZ represents a success state.
14929     */
14930    bool result_ok;
14931 } LDKCResult_TxAbortDecodeErrorZ;
14932
14933 /**
14934  * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
14935  */
14936 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
14937    /**
14938     * A pointer to the contents in the success state.
14939     * Reading from this pointer when `result_ok` is not set is undefined.
14940     */
14941    struct LDKAnnouncementSignatures *result;
14942    /**
14943     * A pointer to the contents in the error state.
14944     * Reading from this pointer when `result_ok` is set is undefined.
14945     */
14946    struct LDKDecodeError *err;
14947 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
14948
14949 /**
14950  * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
14951  * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
14952  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14953  */
14954 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
14955    /**
14956     * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
14957     * `err` or `result` depending on the state of `result_ok`.
14958     */
14959    union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
14960    /**
14961     * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
14962     */
14963    bool result_ok;
14964 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
14965
14966 /**
14967  * The contents of CResult_ChannelReestablishDecodeErrorZ
14968  */
14969 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
14970    /**
14971     * A pointer to the contents in the success state.
14972     * Reading from this pointer when `result_ok` is not set is undefined.
14973     */
14974    struct LDKChannelReestablish *result;
14975    /**
14976     * A pointer to the contents in the error state.
14977     * Reading from this pointer when `result_ok` is set is undefined.
14978     */
14979    struct LDKDecodeError *err;
14980 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
14981
14982 /**
14983  * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
14984  * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
14985  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14986  */
14987 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
14988    /**
14989     * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
14990     * `err` or `result` depending on the state of `result_ok`.
14991     */
14992    union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
14993    /**
14994     * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
14995     */
14996    bool result_ok;
14997 } LDKCResult_ChannelReestablishDecodeErrorZ;
14998
14999 /**
15000  * The contents of CResult_ClosingSignedDecodeErrorZ
15001  */
15002 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
15003    /**
15004     * A pointer to the contents in the success state.
15005     * Reading from this pointer when `result_ok` is not set is undefined.
15006     */
15007    struct LDKClosingSigned *result;
15008    /**
15009     * A pointer to the contents in the error state.
15010     * Reading from this pointer when `result_ok` is set is undefined.
15011     */
15012    struct LDKDecodeError *err;
15013 } LDKCResult_ClosingSignedDecodeErrorZPtr;
15014
15015 /**
15016  * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
15017  * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
15018  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15019  */
15020 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
15021    /**
15022     * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
15023     * `err` or `result` depending on the state of `result_ok`.
15024     */
15025    union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
15026    /**
15027     * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
15028     */
15029    bool result_ok;
15030 } LDKCResult_ClosingSignedDecodeErrorZ;
15031
15032
15033
15034 /**
15035  * The minimum and maximum fees which the sender is willing to place on the closing transaction.
15036  *
15037  * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
15038  * to use.
15039  */
15040 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
15041    /**
15042     * A pointer to the opaque Rust object.
15043     * Nearly everywhere, inner must be non-null, however in places where
15044     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15045     */
15046    LDKnativeClosingSignedFeeRange *inner;
15047    /**
15048     * Indicates that this is the only struct which contains the same pointer.
15049     * Rust functions which take ownership of an object provided via an argument require
15050     * this to be true and invalidate the object pointed to by inner.
15051     */
15052    bool is_owned;
15053 } LDKClosingSignedFeeRange;
15054
15055 /**
15056  * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
15057  */
15058 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
15059    /**
15060     * A pointer to the contents in the success state.
15061     * Reading from this pointer when `result_ok` is not set is undefined.
15062     */
15063    struct LDKClosingSignedFeeRange *result;
15064    /**
15065     * A pointer to the contents in the error state.
15066     * Reading from this pointer when `result_ok` is set is undefined.
15067     */
15068    struct LDKDecodeError *err;
15069 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
15070
15071 /**
15072  * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
15073  * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
15074  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15075  */
15076 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
15077    /**
15078     * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
15079     * `err` or `result` depending on the state of `result_ok`.
15080     */
15081    union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
15082    /**
15083     * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
15084     */
15085    bool result_ok;
15086 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
15087
15088
15089
15090 /**
15091  * A [`commitment_signed`] message to be sent to or received from a peer.
15092  *
15093  * [`commitment_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#committing-updates-so-far-commitment_signed
15094  */
15095 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
15096    /**
15097     * A pointer to the opaque Rust object.
15098     * Nearly everywhere, inner must be non-null, however in places where
15099     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15100     */
15101    LDKnativeCommitmentSigned *inner;
15102    /**
15103     * Indicates that this is the only struct which contains the same pointer.
15104     * Rust functions which take ownership of an object provided via an argument require
15105     * this to be true and invalidate the object pointed to by inner.
15106     */
15107    bool is_owned;
15108 } LDKCommitmentSigned;
15109
15110 /**
15111  * The contents of CResult_CommitmentSignedDecodeErrorZ
15112  */
15113 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
15114    /**
15115     * A pointer to the contents in the success state.
15116     * Reading from this pointer when `result_ok` is not set is undefined.
15117     */
15118    struct LDKCommitmentSigned *result;
15119    /**
15120     * A pointer to the contents in the error state.
15121     * Reading from this pointer when `result_ok` is set is undefined.
15122     */
15123    struct LDKDecodeError *err;
15124 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
15125
15126 /**
15127  * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
15128  * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
15129  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15130  */
15131 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
15132    /**
15133     * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
15134     * `err` or `result` depending on the state of `result_ok`.
15135     */
15136    union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
15137    /**
15138     * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
15139     */
15140    bool result_ok;
15141 } LDKCResult_CommitmentSignedDecodeErrorZ;
15142
15143 /**
15144  * The contents of CResult_FundingCreatedDecodeErrorZ
15145  */
15146 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
15147    /**
15148     * A pointer to the contents in the success state.
15149     * Reading from this pointer when `result_ok` is not set is undefined.
15150     */
15151    struct LDKFundingCreated *result;
15152    /**
15153     * A pointer to the contents in the error state.
15154     * Reading from this pointer when `result_ok` is set is undefined.
15155     */
15156    struct LDKDecodeError *err;
15157 } LDKCResult_FundingCreatedDecodeErrorZPtr;
15158
15159 /**
15160  * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
15161  * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
15162  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15163  */
15164 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
15165    /**
15166     * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
15167     * `err` or `result` depending on the state of `result_ok`.
15168     */
15169    union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
15170    /**
15171     * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
15172     */
15173    bool result_ok;
15174 } LDKCResult_FundingCreatedDecodeErrorZ;
15175
15176 /**
15177  * The contents of CResult_FundingSignedDecodeErrorZ
15178  */
15179 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
15180    /**
15181     * A pointer to the contents in the success state.
15182     * Reading from this pointer when `result_ok` is not set is undefined.
15183     */
15184    struct LDKFundingSigned *result;
15185    /**
15186     * A pointer to the contents in the error state.
15187     * Reading from this pointer when `result_ok` is set is undefined.
15188     */
15189    struct LDKDecodeError *err;
15190 } LDKCResult_FundingSignedDecodeErrorZPtr;
15191
15192 /**
15193  * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
15194  * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
15195  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15196  */
15197 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
15198    /**
15199     * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
15200     * `err` or `result` depending on the state of `result_ok`.
15201     */
15202    union LDKCResult_FundingSignedDecodeErrorZPtr contents;
15203    /**
15204     * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
15205     */
15206    bool result_ok;
15207 } LDKCResult_FundingSignedDecodeErrorZ;
15208
15209 /**
15210  * The contents of CResult_ChannelReadyDecodeErrorZ
15211  */
15212 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
15213    /**
15214     * A pointer to the contents in the success state.
15215     * Reading from this pointer when `result_ok` is not set is undefined.
15216     */
15217    struct LDKChannelReady *result;
15218    /**
15219     * A pointer to the contents in the error state.
15220     * Reading from this pointer when `result_ok` is set is undefined.
15221     */
15222    struct LDKDecodeError *err;
15223 } LDKCResult_ChannelReadyDecodeErrorZPtr;
15224
15225 /**
15226  * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
15227  * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
15228  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15229  */
15230 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
15231    /**
15232     * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
15233     * `err` or `result` depending on the state of `result_ok`.
15234     */
15235    union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
15236    /**
15237     * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
15238     */
15239    bool result_ok;
15240 } LDKCResult_ChannelReadyDecodeErrorZ;
15241
15242
15243
15244 /**
15245  * An [`init`] message to be sent to or received from a peer.
15246  *
15247  * [`init`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-init-message
15248  */
15249 typedef struct MUST_USE_STRUCT LDKInit {
15250    /**
15251     * A pointer to the opaque Rust object.
15252     * Nearly everywhere, inner must be non-null, however in places where
15253     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15254     */
15255    LDKnativeInit *inner;
15256    /**
15257     * Indicates that this is the only struct which contains the same pointer.
15258     * Rust functions which take ownership of an object provided via an argument require
15259     * this to be true and invalidate the object pointed to by inner.
15260     */
15261    bool is_owned;
15262 } LDKInit;
15263
15264 /**
15265  * The contents of CResult_InitDecodeErrorZ
15266  */
15267 typedef union LDKCResult_InitDecodeErrorZPtr {
15268    /**
15269     * A pointer to the contents in the success state.
15270     * Reading from this pointer when `result_ok` is not set is undefined.
15271     */
15272    struct LDKInit *result;
15273    /**
15274     * A pointer to the contents in the error state.
15275     * Reading from this pointer when `result_ok` is set is undefined.
15276     */
15277    struct LDKDecodeError *err;
15278 } LDKCResult_InitDecodeErrorZPtr;
15279
15280 /**
15281  * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
15282  * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
15283  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15284  */
15285 typedef struct LDKCResult_InitDecodeErrorZ {
15286    /**
15287     * The contents of this CResult_InitDecodeErrorZ, accessible via either
15288     * `err` or `result` depending on the state of `result_ok`.
15289     */
15290    union LDKCResult_InitDecodeErrorZPtr contents;
15291    /**
15292     * Whether this CResult_InitDecodeErrorZ represents a success state.
15293     */
15294    bool result_ok;
15295 } LDKCResult_InitDecodeErrorZ;
15296
15297 /**
15298  * The contents of CResult_OpenChannelDecodeErrorZ
15299  */
15300 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
15301    /**
15302     * A pointer to the contents in the success state.
15303     * Reading from this pointer when `result_ok` is not set is undefined.
15304     */
15305    struct LDKOpenChannel *result;
15306    /**
15307     * A pointer to the contents in the error state.
15308     * Reading from this pointer when `result_ok` is set is undefined.
15309     */
15310    struct LDKDecodeError *err;
15311 } LDKCResult_OpenChannelDecodeErrorZPtr;
15312
15313 /**
15314  * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
15315  * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
15316  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15317  */
15318 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
15319    /**
15320     * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
15321     * `err` or `result` depending on the state of `result_ok`.
15322     */
15323    union LDKCResult_OpenChannelDecodeErrorZPtr contents;
15324    /**
15325     * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
15326     */
15327    bool result_ok;
15328 } LDKCResult_OpenChannelDecodeErrorZ;
15329
15330 /**
15331  * The contents of CResult_OpenChannelV2DecodeErrorZ
15332  */
15333 typedef union LDKCResult_OpenChannelV2DecodeErrorZPtr {
15334    /**
15335     * A pointer to the contents in the success state.
15336     * Reading from this pointer when `result_ok` is not set is undefined.
15337     */
15338    struct LDKOpenChannelV2 *result;
15339    /**
15340     * A pointer to the contents in the error state.
15341     * Reading from this pointer when `result_ok` is set is undefined.
15342     */
15343    struct LDKDecodeError *err;
15344 } LDKCResult_OpenChannelV2DecodeErrorZPtr;
15345
15346 /**
15347  * A CResult_OpenChannelV2DecodeErrorZ represents the result of a fallible operation,
15348  * containing a crate::lightning::ln::msgs::OpenChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
15349  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15350  */
15351 typedef struct LDKCResult_OpenChannelV2DecodeErrorZ {
15352    /**
15353     * The contents of this CResult_OpenChannelV2DecodeErrorZ, accessible via either
15354     * `err` or `result` depending on the state of `result_ok`.
15355     */
15356    union LDKCResult_OpenChannelV2DecodeErrorZPtr contents;
15357    /**
15358     * Whether this CResult_OpenChannelV2DecodeErrorZ represents a success state.
15359     */
15360    bool result_ok;
15361 } LDKCResult_OpenChannelV2DecodeErrorZ;
15362
15363 /**
15364  * The contents of CResult_RevokeAndACKDecodeErrorZ
15365  */
15366 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
15367    /**
15368     * A pointer to the contents in the success state.
15369     * Reading from this pointer when `result_ok` is not set is undefined.
15370     */
15371    struct LDKRevokeAndACK *result;
15372    /**
15373     * A pointer to the contents in the error state.
15374     * Reading from this pointer when `result_ok` is set is undefined.
15375     */
15376    struct LDKDecodeError *err;
15377 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
15378
15379 /**
15380  * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
15381  * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
15382  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15383  */
15384 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
15385    /**
15386     * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
15387     * `err` or `result` depending on the state of `result_ok`.
15388     */
15389    union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
15390    /**
15391     * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
15392     */
15393    bool result_ok;
15394 } LDKCResult_RevokeAndACKDecodeErrorZ;
15395
15396 /**
15397  * The contents of CResult_ShutdownDecodeErrorZ
15398  */
15399 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
15400    /**
15401     * A pointer to the contents in the success state.
15402     * Reading from this pointer when `result_ok` is not set is undefined.
15403     */
15404    struct LDKShutdown *result;
15405    /**
15406     * A pointer to the contents in the error state.
15407     * Reading from this pointer when `result_ok` is set is undefined.
15408     */
15409    struct LDKDecodeError *err;
15410 } LDKCResult_ShutdownDecodeErrorZPtr;
15411
15412 /**
15413  * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
15414  * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
15415  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15416  */
15417 typedef struct LDKCResult_ShutdownDecodeErrorZ {
15418    /**
15419     * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
15420     * `err` or `result` depending on the state of `result_ok`.
15421     */
15422    union LDKCResult_ShutdownDecodeErrorZPtr contents;
15423    /**
15424     * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
15425     */
15426    bool result_ok;
15427 } LDKCResult_ShutdownDecodeErrorZ;
15428
15429 /**
15430  * The contents of CResult_UpdateFailHTLCDecodeErrorZ
15431  */
15432 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
15433    /**
15434     * A pointer to the contents in the success state.
15435     * Reading from this pointer when `result_ok` is not set is undefined.
15436     */
15437    struct LDKUpdateFailHTLC *result;
15438    /**
15439     * A pointer to the contents in the error state.
15440     * Reading from this pointer when `result_ok` is set is undefined.
15441     */
15442    struct LDKDecodeError *err;
15443 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
15444
15445 /**
15446  * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
15447  * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15448  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15449  */
15450 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
15451    /**
15452     * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
15453     * `err` or `result` depending on the state of `result_ok`.
15454     */
15455    union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
15456    /**
15457     * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
15458     */
15459    bool result_ok;
15460 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
15461
15462 /**
15463  * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
15464  */
15465 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
15466    /**
15467     * A pointer to the contents in the success state.
15468     * Reading from this pointer when `result_ok` is not set is undefined.
15469     */
15470    struct LDKUpdateFailMalformedHTLC *result;
15471    /**
15472     * A pointer to the contents in the error state.
15473     * Reading from this pointer when `result_ok` is set is undefined.
15474     */
15475    struct LDKDecodeError *err;
15476 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
15477
15478 /**
15479  * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
15480  * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15481  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15482  */
15483 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
15484    /**
15485     * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
15486     * `err` or `result` depending on the state of `result_ok`.
15487     */
15488    union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
15489    /**
15490     * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
15491     */
15492    bool result_ok;
15493 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
15494
15495
15496
15497 /**
15498  * An [`update_fee`] message to be sent to or received from a peer
15499  *
15500  * [`update_fee`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#updating-fees-update_fee
15501  */
15502 typedef struct MUST_USE_STRUCT LDKUpdateFee {
15503    /**
15504     * A pointer to the opaque Rust object.
15505     * Nearly everywhere, inner must be non-null, however in places where
15506     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15507     */
15508    LDKnativeUpdateFee *inner;
15509    /**
15510     * Indicates that this is the only struct which contains the same pointer.
15511     * Rust functions which take ownership of an object provided via an argument require
15512     * this to be true and invalidate the object pointed to by inner.
15513     */
15514    bool is_owned;
15515 } LDKUpdateFee;
15516
15517 /**
15518  * The contents of CResult_UpdateFeeDecodeErrorZ
15519  */
15520 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
15521    /**
15522     * A pointer to the contents in the success state.
15523     * Reading from this pointer when `result_ok` is not set is undefined.
15524     */
15525    struct LDKUpdateFee *result;
15526    /**
15527     * A pointer to the contents in the error state.
15528     * Reading from this pointer when `result_ok` is set is undefined.
15529     */
15530    struct LDKDecodeError *err;
15531 } LDKCResult_UpdateFeeDecodeErrorZPtr;
15532
15533 /**
15534  * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
15535  * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
15536  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15537  */
15538 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
15539    /**
15540     * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
15541     * `err` or `result` depending on the state of `result_ok`.
15542     */
15543    union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
15544    /**
15545     * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
15546     */
15547    bool result_ok;
15548 } LDKCResult_UpdateFeeDecodeErrorZ;
15549
15550 /**
15551  * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
15552  */
15553 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
15554    /**
15555     * A pointer to the contents in the success state.
15556     * Reading from this pointer when `result_ok` is not set is undefined.
15557     */
15558    struct LDKUpdateFulfillHTLC *result;
15559    /**
15560     * A pointer to the contents in the error state.
15561     * Reading from this pointer when `result_ok` is set is undefined.
15562     */
15563    struct LDKDecodeError *err;
15564 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
15565
15566 /**
15567  * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
15568  * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15569  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15570  */
15571 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
15572    /**
15573     * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
15574     * `err` or `result` depending on the state of `result_ok`.
15575     */
15576    union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
15577    /**
15578     * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
15579     */
15580    bool result_ok;
15581 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
15582
15583 /**
15584  * The contents of CResult_OnionPacketDecodeErrorZ
15585  */
15586 typedef union LDKCResult_OnionPacketDecodeErrorZPtr {
15587    /**
15588     * A pointer to the contents in the success state.
15589     * Reading from this pointer when `result_ok` is not set is undefined.
15590     */
15591    struct LDKOnionPacket *result;
15592    /**
15593     * A pointer to the contents in the error state.
15594     * Reading from this pointer when `result_ok` is set is undefined.
15595     */
15596    struct LDKDecodeError *err;
15597 } LDKCResult_OnionPacketDecodeErrorZPtr;
15598
15599 /**
15600  * A CResult_OnionPacketDecodeErrorZ represents the result of a fallible operation,
15601  * containing a crate::lightning::ln::msgs::OnionPacket on success and a crate::lightning::ln::msgs::DecodeError on failure.
15602  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15603  */
15604 typedef struct LDKCResult_OnionPacketDecodeErrorZ {
15605    /**
15606     * The contents of this CResult_OnionPacketDecodeErrorZ, accessible via either
15607     * `err` or `result` depending on the state of `result_ok`.
15608     */
15609    union LDKCResult_OnionPacketDecodeErrorZPtr contents;
15610    /**
15611     * Whether this CResult_OnionPacketDecodeErrorZ represents a success state.
15612     */
15613    bool result_ok;
15614 } LDKCResult_OnionPacketDecodeErrorZ;
15615
15616 /**
15617  * The contents of CResult_UpdateAddHTLCDecodeErrorZ
15618  */
15619 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
15620    /**
15621     * A pointer to the contents in the success state.
15622     * Reading from this pointer when `result_ok` is not set is undefined.
15623     */
15624    struct LDKUpdateAddHTLC *result;
15625    /**
15626     * A pointer to the contents in the error state.
15627     * Reading from this pointer when `result_ok` is set is undefined.
15628     */
15629    struct LDKDecodeError *err;
15630 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
15631
15632 /**
15633  * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
15634  * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15635  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15636  */
15637 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
15638    /**
15639     * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
15640     * `err` or `result` depending on the state of `result_ok`.
15641     */
15642    union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
15643    /**
15644     * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
15645     */
15646    bool result_ok;
15647 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
15648
15649
15650
15651 /**
15652  * An onion message to be sent to or received from a peer.
15653  *
15654  */
15655 typedef struct MUST_USE_STRUCT LDKOnionMessage {
15656    /**
15657     * A pointer to the opaque Rust object.
15658     * Nearly everywhere, inner must be non-null, however in places where
15659     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15660     */
15661    LDKnativeOnionMessage *inner;
15662    /**
15663     * Indicates that this is the only struct which contains the same pointer.
15664     * Rust functions which take ownership of an object provided via an argument require
15665     * this to be true and invalidate the object pointed to by inner.
15666     */
15667    bool is_owned;
15668 } LDKOnionMessage;
15669
15670 /**
15671  * The contents of CResult_OnionMessageDecodeErrorZ
15672  */
15673 typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
15674    /**
15675     * A pointer to the contents in the success state.
15676     * Reading from this pointer when `result_ok` is not set is undefined.
15677     */
15678    struct LDKOnionMessage *result;
15679    /**
15680     * A pointer to the contents in the error state.
15681     * Reading from this pointer when `result_ok` is set is undefined.
15682     */
15683    struct LDKDecodeError *err;
15684 } LDKCResult_OnionMessageDecodeErrorZPtr;
15685
15686 /**
15687  * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
15688  * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
15689  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15690  */
15691 typedef struct LDKCResult_OnionMessageDecodeErrorZ {
15692    /**
15693     * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
15694     * `err` or `result` depending on the state of `result_ok`.
15695     */
15696    union LDKCResult_OnionMessageDecodeErrorZPtr contents;
15697    /**
15698     * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
15699     */
15700    bool result_ok;
15701 } LDKCResult_OnionMessageDecodeErrorZ;
15702
15703 /**
15704  * The contents of CResult_FinalOnionHopDataDecodeErrorZ
15705  */
15706 typedef union LDKCResult_FinalOnionHopDataDecodeErrorZPtr {
15707    /**
15708     * A pointer to the contents in the success state.
15709     * Reading from this pointer when `result_ok` is not set is undefined.
15710     */
15711    struct LDKFinalOnionHopData *result;
15712    /**
15713     * A pointer to the contents in the error state.
15714     * Reading from this pointer when `result_ok` is set is undefined.
15715     */
15716    struct LDKDecodeError *err;
15717 } LDKCResult_FinalOnionHopDataDecodeErrorZPtr;
15718
15719 /**
15720  * A CResult_FinalOnionHopDataDecodeErrorZ represents the result of a fallible operation,
15721  * containing a crate::lightning::ln::msgs::FinalOnionHopData on success and a crate::lightning::ln::msgs::DecodeError on failure.
15722  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15723  */
15724 typedef struct LDKCResult_FinalOnionHopDataDecodeErrorZ {
15725    /**
15726     * The contents of this CResult_FinalOnionHopDataDecodeErrorZ, accessible via either
15727     * `err` or `result` depending on the state of `result_ok`.
15728     */
15729    union LDKCResult_FinalOnionHopDataDecodeErrorZPtr contents;
15730    /**
15731     * Whether this CResult_FinalOnionHopDataDecodeErrorZ represents a success state.
15732     */
15733    bool result_ok;
15734 } LDKCResult_FinalOnionHopDataDecodeErrorZ;
15735
15736
15737
15738 /**
15739  * A [`ping`] message to be sent to or received from a peer.
15740  *
15741  * [`ping`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
15742  */
15743 typedef struct MUST_USE_STRUCT LDKPing {
15744    /**
15745     * A pointer to the opaque Rust object.
15746     * Nearly everywhere, inner must be non-null, however in places where
15747     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15748     */
15749    LDKnativePing *inner;
15750    /**
15751     * Indicates that this is the only struct which contains the same pointer.
15752     * Rust functions which take ownership of an object provided via an argument require
15753     * this to be true and invalidate the object pointed to by inner.
15754     */
15755    bool is_owned;
15756 } LDKPing;
15757
15758 /**
15759  * The contents of CResult_PingDecodeErrorZ
15760  */
15761 typedef union LDKCResult_PingDecodeErrorZPtr {
15762    /**
15763     * A pointer to the contents in the success state.
15764     * Reading from this pointer when `result_ok` is not set is undefined.
15765     */
15766    struct LDKPing *result;
15767    /**
15768     * A pointer to the contents in the error state.
15769     * Reading from this pointer when `result_ok` is set is undefined.
15770     */
15771    struct LDKDecodeError *err;
15772 } LDKCResult_PingDecodeErrorZPtr;
15773
15774 /**
15775  * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
15776  * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
15777  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15778  */
15779 typedef struct LDKCResult_PingDecodeErrorZ {
15780    /**
15781     * The contents of this CResult_PingDecodeErrorZ, accessible via either
15782     * `err` or `result` depending on the state of `result_ok`.
15783     */
15784    union LDKCResult_PingDecodeErrorZPtr contents;
15785    /**
15786     * Whether this CResult_PingDecodeErrorZ represents a success state.
15787     */
15788    bool result_ok;
15789 } LDKCResult_PingDecodeErrorZ;
15790
15791
15792
15793 /**
15794  * A [`pong`] message to be sent to or received from a peer.
15795  *
15796  * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
15797  */
15798 typedef struct MUST_USE_STRUCT LDKPong {
15799    /**
15800     * A pointer to the opaque Rust object.
15801     * Nearly everywhere, inner must be non-null, however in places where
15802     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15803     */
15804    LDKnativePong *inner;
15805    /**
15806     * Indicates that this is the only struct which contains the same pointer.
15807     * Rust functions which take ownership of an object provided via an argument require
15808     * this to be true and invalidate the object pointed to by inner.
15809     */
15810    bool is_owned;
15811 } LDKPong;
15812
15813 /**
15814  * The contents of CResult_PongDecodeErrorZ
15815  */
15816 typedef union LDKCResult_PongDecodeErrorZPtr {
15817    /**
15818     * A pointer to the contents in the success state.
15819     * Reading from this pointer when `result_ok` is not set is undefined.
15820     */
15821    struct LDKPong *result;
15822    /**
15823     * A pointer to the contents in the error state.
15824     * Reading from this pointer when `result_ok` is set is undefined.
15825     */
15826    struct LDKDecodeError *err;
15827 } LDKCResult_PongDecodeErrorZPtr;
15828
15829 /**
15830  * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
15831  * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
15832  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15833  */
15834 typedef struct LDKCResult_PongDecodeErrorZ {
15835    /**
15836     * The contents of this CResult_PongDecodeErrorZ, accessible via either
15837     * `err` or `result` depending on the state of `result_ok`.
15838     */
15839    union LDKCResult_PongDecodeErrorZPtr contents;
15840    /**
15841     * Whether this CResult_PongDecodeErrorZ represents a success state.
15842     */
15843    bool result_ok;
15844 } LDKCResult_PongDecodeErrorZ;
15845
15846 /**
15847  * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
15848  */
15849 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
15850    /**
15851     * A pointer to the contents in the success state.
15852     * Reading from this pointer when `result_ok` is not set is undefined.
15853     */
15854    struct LDKUnsignedChannelAnnouncement *result;
15855    /**
15856     * A pointer to the contents in the error state.
15857     * Reading from this pointer when `result_ok` is set is undefined.
15858     */
15859    struct LDKDecodeError *err;
15860 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
15861
15862 /**
15863  * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
15864  * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
15865  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15866  */
15867 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
15868    /**
15869     * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
15870     * `err` or `result` depending on the state of `result_ok`.
15871     */
15872    union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
15873    /**
15874     * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
15875     */
15876    bool result_ok;
15877 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
15878
15879 /**
15880  * The contents of CResult_ChannelAnnouncementDecodeErrorZ
15881  */
15882 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
15883    /**
15884     * A pointer to the contents in the success state.
15885     * Reading from this pointer when `result_ok` is not set is undefined.
15886     */
15887    struct LDKChannelAnnouncement *result;
15888    /**
15889     * A pointer to the contents in the error state.
15890     * Reading from this pointer when `result_ok` is set is undefined.
15891     */
15892    struct LDKDecodeError *err;
15893 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
15894
15895 /**
15896  * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
15897  * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
15898  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15899  */
15900 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
15901    /**
15902     * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
15903     * `err` or `result` depending on the state of `result_ok`.
15904     */
15905    union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
15906    /**
15907     * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
15908     */
15909    bool result_ok;
15910 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
15911
15912 /**
15913  * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
15914  */
15915 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
15916    /**
15917     * A pointer to the contents in the success state.
15918     * Reading from this pointer when `result_ok` is not set is undefined.
15919     */
15920    struct LDKUnsignedChannelUpdate *result;
15921    /**
15922     * A pointer to the contents in the error state.
15923     * Reading from this pointer when `result_ok` is set is undefined.
15924     */
15925    struct LDKDecodeError *err;
15926 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
15927
15928 /**
15929  * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
15930  * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
15931  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15932  */
15933 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
15934    /**
15935     * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
15936     * `err` or `result` depending on the state of `result_ok`.
15937     */
15938    union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
15939    /**
15940     * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
15941     */
15942    bool result_ok;
15943 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
15944
15945 /**
15946  * The contents of CResult_ChannelUpdateDecodeErrorZ
15947  */
15948 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
15949    /**
15950     * A pointer to the contents in the success state.
15951     * Reading from this pointer when `result_ok` is not set is undefined.
15952     */
15953    struct LDKChannelUpdate *result;
15954    /**
15955     * A pointer to the contents in the error state.
15956     * Reading from this pointer when `result_ok` is set is undefined.
15957     */
15958    struct LDKDecodeError *err;
15959 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
15960
15961 /**
15962  * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
15963  * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
15964  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15965  */
15966 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
15967    /**
15968     * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
15969     * `err` or `result` depending on the state of `result_ok`.
15970     */
15971    union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
15972    /**
15973     * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
15974     */
15975    bool result_ok;
15976 } LDKCResult_ChannelUpdateDecodeErrorZ;
15977
15978 /**
15979  * The contents of CResult_ErrorMessageDecodeErrorZ
15980  */
15981 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
15982    /**
15983     * A pointer to the contents in the success state.
15984     * Reading from this pointer when `result_ok` is not set is undefined.
15985     */
15986    struct LDKErrorMessage *result;
15987    /**
15988     * A pointer to the contents in the error state.
15989     * Reading from this pointer when `result_ok` is set is undefined.
15990     */
15991    struct LDKDecodeError *err;
15992 } LDKCResult_ErrorMessageDecodeErrorZPtr;
15993
15994 /**
15995  * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
15996  * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
15997  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15998  */
15999 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
16000    /**
16001     * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
16002     * `err` or `result` depending on the state of `result_ok`.
16003     */
16004    union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
16005    /**
16006     * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
16007     */
16008    bool result_ok;
16009 } LDKCResult_ErrorMessageDecodeErrorZ;
16010
16011 /**
16012  * The contents of CResult_WarningMessageDecodeErrorZ
16013  */
16014 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
16015    /**
16016     * A pointer to the contents in the success state.
16017     * Reading from this pointer when `result_ok` is not set is undefined.
16018     */
16019    struct LDKWarningMessage *result;
16020    /**
16021     * A pointer to the contents in the error state.
16022     * Reading from this pointer when `result_ok` is set is undefined.
16023     */
16024    struct LDKDecodeError *err;
16025 } LDKCResult_WarningMessageDecodeErrorZPtr;
16026
16027 /**
16028  * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
16029  * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
16030  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16031  */
16032 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
16033    /**
16034     * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
16035     * `err` or `result` depending on the state of `result_ok`.
16036     */
16037    union LDKCResult_WarningMessageDecodeErrorZPtr contents;
16038    /**
16039     * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
16040     */
16041    bool result_ok;
16042 } LDKCResult_WarningMessageDecodeErrorZ;
16043
16044 /**
16045  * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
16046  */
16047 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
16048    /**
16049     * A pointer to the contents in the success state.
16050     * Reading from this pointer when `result_ok` is not set is undefined.
16051     */
16052    struct LDKUnsignedNodeAnnouncement *result;
16053    /**
16054     * A pointer to the contents in the error state.
16055     * Reading from this pointer when `result_ok` is set is undefined.
16056     */
16057    struct LDKDecodeError *err;
16058 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
16059
16060 /**
16061  * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
16062  * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
16063  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16064  */
16065 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
16066    /**
16067     * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
16068     * `err` or `result` depending on the state of `result_ok`.
16069     */
16070    union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
16071    /**
16072     * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
16073     */
16074    bool result_ok;
16075 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
16076
16077 /**
16078  * The contents of CResult_NodeAnnouncementDecodeErrorZ
16079  */
16080 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
16081    /**
16082     * A pointer to the contents in the success state.
16083     * Reading from this pointer when `result_ok` is not set is undefined.
16084     */
16085    struct LDKNodeAnnouncement *result;
16086    /**
16087     * A pointer to the contents in the error state.
16088     * Reading from this pointer when `result_ok` is set is undefined.
16089     */
16090    struct LDKDecodeError *err;
16091 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
16092
16093 /**
16094  * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
16095  * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
16096  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16097  */
16098 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
16099    /**
16100     * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
16101     * `err` or `result` depending on the state of `result_ok`.
16102     */
16103    union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
16104    /**
16105     * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
16106     */
16107    bool result_ok;
16108 } LDKCResult_NodeAnnouncementDecodeErrorZ;
16109
16110 /**
16111  * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
16112  */
16113 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
16114    /**
16115     * A pointer to the contents in the success state.
16116     * Reading from this pointer when `result_ok` is not set is undefined.
16117     */
16118    struct LDKQueryShortChannelIds *result;
16119    /**
16120     * A pointer to the contents in the error state.
16121     * Reading from this pointer when `result_ok` is set is undefined.
16122     */
16123    struct LDKDecodeError *err;
16124 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
16125
16126 /**
16127  * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
16128  * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
16129  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16130  */
16131 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
16132    /**
16133     * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
16134     * `err` or `result` depending on the state of `result_ok`.
16135     */
16136    union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
16137    /**
16138     * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
16139     */
16140    bool result_ok;
16141 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
16142
16143
16144
16145 /**
16146  * A [`reply_short_channel_ids_end`] message is sent as a reply to a
16147  * message. The query recipient makes a best
16148  * effort to respond based on their local network view which may not be
16149  * a perfect view of the network.
16150  *
16151  * [`reply_short_channel_ids_end`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_short_channel_idsreply_short_channel_ids_end-messages
16152  */
16153 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
16154    /**
16155     * A pointer to the opaque Rust object.
16156     * Nearly everywhere, inner must be non-null, however in places where
16157     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16158     */
16159    LDKnativeReplyShortChannelIdsEnd *inner;
16160    /**
16161     * Indicates that this is the only struct which contains the same pointer.
16162     * Rust functions which take ownership of an object provided via an argument require
16163     * this to be true and invalidate the object pointed to by inner.
16164     */
16165    bool is_owned;
16166 } LDKReplyShortChannelIdsEnd;
16167
16168 /**
16169  * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
16170  */
16171 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
16172    /**
16173     * A pointer to the contents in the success state.
16174     * Reading from this pointer when `result_ok` is not set is undefined.
16175     */
16176    struct LDKReplyShortChannelIdsEnd *result;
16177    /**
16178     * A pointer to the contents in the error state.
16179     * Reading from this pointer when `result_ok` is set is undefined.
16180     */
16181    struct LDKDecodeError *err;
16182 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
16183
16184 /**
16185  * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
16186  * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
16187  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16188  */
16189 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
16190    /**
16191     * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
16192     * `err` or `result` depending on the state of `result_ok`.
16193     */
16194    union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
16195    /**
16196     * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
16197     */
16198    bool result_ok;
16199 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
16200
16201 /**
16202  * The contents of CResult_QueryChannelRangeDecodeErrorZ
16203  */
16204 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
16205    /**
16206     * A pointer to the contents in the success state.
16207     * Reading from this pointer when `result_ok` is not set is undefined.
16208     */
16209    struct LDKQueryChannelRange *result;
16210    /**
16211     * A pointer to the contents in the error state.
16212     * Reading from this pointer when `result_ok` is set is undefined.
16213     */
16214    struct LDKDecodeError *err;
16215 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
16216
16217 /**
16218  * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
16219  * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
16220  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16221  */
16222 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
16223    /**
16224     * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
16225     * `err` or `result` depending on the state of `result_ok`.
16226     */
16227    union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
16228    /**
16229     * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
16230     */
16231    bool result_ok;
16232 } LDKCResult_QueryChannelRangeDecodeErrorZ;
16233
16234 /**
16235  * The contents of CResult_ReplyChannelRangeDecodeErrorZ
16236  */
16237 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
16238    /**
16239     * A pointer to the contents in the success state.
16240     * Reading from this pointer when `result_ok` is not set is undefined.
16241     */
16242    struct LDKReplyChannelRange *result;
16243    /**
16244     * A pointer to the contents in the error state.
16245     * Reading from this pointer when `result_ok` is set is undefined.
16246     */
16247    struct LDKDecodeError *err;
16248 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
16249
16250 /**
16251  * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
16252  * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
16253  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16254  */
16255 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
16256    /**
16257     * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
16258     * `err` or `result` depending on the state of `result_ok`.
16259     */
16260    union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
16261    /**
16262     * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
16263     */
16264    bool result_ok;
16265 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
16266
16267 /**
16268  * The contents of CResult_GossipTimestampFilterDecodeErrorZ
16269  */
16270 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
16271    /**
16272     * A pointer to the contents in the success state.
16273     * Reading from this pointer when `result_ok` is not set is undefined.
16274     */
16275    struct LDKGossipTimestampFilter *result;
16276    /**
16277     * A pointer to the contents in the error state.
16278     * Reading from this pointer when `result_ok` is set is undefined.
16279     */
16280    struct LDKDecodeError *err;
16281 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
16282
16283 /**
16284  * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
16285  * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
16286  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16287  */
16288 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
16289    /**
16290     * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
16291     * `err` or `result` depending on the state of `result_ok`.
16292     */
16293    union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
16294    /**
16295     * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
16296     */
16297    bool result_ok;
16298 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
16299
16300 /**
16301  * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
16302  * This corresponds to std::vector in C++
16303  */
16304 typedef struct LDKCVec_PhantomRouteHintsZ {
16305    /**
16306     * The elements in the array.
16307     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16308     */
16309    struct LDKPhantomRouteHints *data;
16310    /**
16311     * The number of elements pointed to by `data`.
16312     */
16313    uintptr_t datalen;
16314 } LDKCVec_PhantomRouteHintsZ;
16315
16316
16317
16318 /**
16319  * Represents a syntactically and semantically correct lightning BOLT11 invoice.
16320  *
16321  * There are three ways to construct a `Bolt11Invoice`:
16322  *  1. using [`InvoiceBuilder`]
16323  *  2. using [`Bolt11Invoice::from_signed`]
16324  *  3. using `str::parse::<Bolt11Invoice>(&str)` (see [`Bolt11Invoice::from_str`])
16325  *
16326  * [`Bolt11Invoice::from_str`]: crate::Bolt11Invoice#impl-FromStr
16327  */
16328 typedef struct MUST_USE_STRUCT LDKBolt11Invoice {
16329    /**
16330     * A pointer to the opaque Rust object.
16331     * Nearly everywhere, inner must be non-null, however in places where
16332     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16333     */
16334    LDKnativeBolt11Invoice *inner;
16335    /**
16336     * Indicates that this is the only struct which contains the same pointer.
16337     * Rust functions which take ownership of an object provided via an argument require
16338     * this to be true and invalidate the object pointed to by inner.
16339     */
16340    bool is_owned;
16341 } LDKBolt11Invoice;
16342
16343 /**
16344  * When signing using a fallible method either an user-supplied `SignError` or a [`CreationError`]
16345  * may occur.
16346  */
16347 typedef enum LDKSignOrCreationError_Tag {
16348    /**
16349     * An error occurred during signing
16350     */
16351    LDKSignOrCreationError_SignError,
16352    /**
16353     * An error occurred while building the transaction
16354     */
16355    LDKSignOrCreationError_CreationError,
16356    /**
16357     * Must be last for serialization purposes
16358     */
16359    LDKSignOrCreationError_Sentinel,
16360 } LDKSignOrCreationError_Tag;
16361
16362 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
16363    LDKSignOrCreationError_Tag tag;
16364    union {
16365       struct {
16366          enum LDKCreationError creation_error;
16367       };
16368    };
16369 } LDKSignOrCreationError;
16370
16371 /**
16372  * The contents of CResult_Bolt11InvoiceSignOrCreationErrorZ
16373  */
16374 typedef union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr {
16375    /**
16376     * A pointer to the contents in the success state.
16377     * Reading from this pointer when `result_ok` is not set is undefined.
16378     */
16379    struct LDKBolt11Invoice *result;
16380    /**
16381     * A pointer to the contents in the error state.
16382     * Reading from this pointer when `result_ok` is set is undefined.
16383     */
16384    struct LDKSignOrCreationError *err;
16385 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr;
16386
16387 /**
16388  * A CResult_Bolt11InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
16389  * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
16390  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16391  */
16392 typedef struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ {
16393    /**
16394     * The contents of this CResult_Bolt11InvoiceSignOrCreationErrorZ, accessible via either
16395     * `err` or `result` depending on the state of `result_ok`.
16396     */
16397    union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr contents;
16398    /**
16399     * Whether this CResult_Bolt11InvoiceSignOrCreationErrorZ represents a success state.
16400     */
16401    bool result_ok;
16402 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZ;
16403
16404 /**
16405  * An enum which can either contain a crate::lightning::ln::channel_state::InboundHTLCStateDetails or not
16406  */
16407 typedef enum LDKCOption_InboundHTLCStateDetailsZ_Tag {
16408    /**
16409     * When we're in this state, this COption_InboundHTLCStateDetailsZ contains a crate::lightning::ln::channel_state::InboundHTLCStateDetails
16410     */
16411    LDKCOption_InboundHTLCStateDetailsZ_Some,
16412    /**
16413     * When we're in this state, this COption_InboundHTLCStateDetailsZ contains nothing
16414     */
16415    LDKCOption_InboundHTLCStateDetailsZ_None,
16416    /**
16417     * Must be last for serialization purposes
16418     */
16419    LDKCOption_InboundHTLCStateDetailsZ_Sentinel,
16420 } LDKCOption_InboundHTLCStateDetailsZ_Tag;
16421
16422 typedef struct LDKCOption_InboundHTLCStateDetailsZ {
16423    LDKCOption_InboundHTLCStateDetailsZ_Tag tag;
16424    union {
16425       struct {
16426          enum LDKInboundHTLCStateDetails some;
16427       };
16428    };
16429 } LDKCOption_InboundHTLCStateDetailsZ;
16430
16431 /**
16432  * The contents of CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ
16433  */
16434 typedef union LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZPtr {
16435    /**
16436     * A pointer to the contents in the success state.
16437     * Reading from this pointer when `result_ok` is not set is undefined.
16438     */
16439    struct LDKCOption_InboundHTLCStateDetailsZ *result;
16440    /**
16441     * A pointer to the contents in the error state.
16442     * Reading from this pointer when `result_ok` is set is undefined.
16443     */
16444    struct LDKDecodeError *err;
16445 } LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZPtr;
16446
16447 /**
16448  * A CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ represents the result of a fallible operation,
16449  * containing a crate::c_types::derived::COption_InboundHTLCStateDetailsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
16450  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16451  */
16452 typedef struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ {
16453    /**
16454     * The contents of this CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ, accessible via either
16455     * `err` or `result` depending on the state of `result_ok`.
16456     */
16457    union LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZPtr contents;
16458    /**
16459     * Whether this CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ represents a success state.
16460     */
16461    bool result_ok;
16462 } LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ;
16463
16464
16465
16466 /**
16467  * Exposes details around pending inbound HTLCs.
16468  */
16469 typedef struct MUST_USE_STRUCT LDKInboundHTLCDetails {
16470    /**
16471     * A pointer to the opaque Rust object.
16472     * Nearly everywhere, inner must be non-null, however in places where
16473     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16474     */
16475    LDKnativeInboundHTLCDetails *inner;
16476    /**
16477     * Indicates that this is the only struct which contains the same pointer.
16478     * Rust functions which take ownership of an object provided via an argument require
16479     * this to be true and invalidate the object pointed to by inner.
16480     */
16481    bool is_owned;
16482 } LDKInboundHTLCDetails;
16483
16484 /**
16485  * The contents of CResult_InboundHTLCDetailsDecodeErrorZ
16486  */
16487 typedef union LDKCResult_InboundHTLCDetailsDecodeErrorZPtr {
16488    /**
16489     * A pointer to the contents in the success state.
16490     * Reading from this pointer when `result_ok` is not set is undefined.
16491     */
16492    struct LDKInboundHTLCDetails *result;
16493    /**
16494     * A pointer to the contents in the error state.
16495     * Reading from this pointer when `result_ok` is set is undefined.
16496     */
16497    struct LDKDecodeError *err;
16498 } LDKCResult_InboundHTLCDetailsDecodeErrorZPtr;
16499
16500 /**
16501  * A CResult_InboundHTLCDetailsDecodeErrorZ represents the result of a fallible operation,
16502  * containing a crate::lightning::ln::channel_state::InboundHTLCDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
16503  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16504  */
16505 typedef struct LDKCResult_InboundHTLCDetailsDecodeErrorZ {
16506    /**
16507     * The contents of this CResult_InboundHTLCDetailsDecodeErrorZ, accessible via either
16508     * `err` or `result` depending on the state of `result_ok`.
16509     */
16510    union LDKCResult_InboundHTLCDetailsDecodeErrorZPtr contents;
16511    /**
16512     * Whether this CResult_InboundHTLCDetailsDecodeErrorZ represents a success state.
16513     */
16514    bool result_ok;
16515 } LDKCResult_InboundHTLCDetailsDecodeErrorZ;
16516
16517 /**
16518  * An enum which can either contain a crate::lightning::ln::channel_state::OutboundHTLCStateDetails or not
16519  */
16520 typedef enum LDKCOption_OutboundHTLCStateDetailsZ_Tag {
16521    /**
16522     * When we're in this state, this COption_OutboundHTLCStateDetailsZ contains a crate::lightning::ln::channel_state::OutboundHTLCStateDetails
16523     */
16524    LDKCOption_OutboundHTLCStateDetailsZ_Some,
16525    /**
16526     * When we're in this state, this COption_OutboundHTLCStateDetailsZ contains nothing
16527     */
16528    LDKCOption_OutboundHTLCStateDetailsZ_None,
16529    /**
16530     * Must be last for serialization purposes
16531     */
16532    LDKCOption_OutboundHTLCStateDetailsZ_Sentinel,
16533 } LDKCOption_OutboundHTLCStateDetailsZ_Tag;
16534
16535 typedef struct LDKCOption_OutboundHTLCStateDetailsZ {
16536    LDKCOption_OutboundHTLCStateDetailsZ_Tag tag;
16537    union {
16538       struct {
16539          enum LDKOutboundHTLCStateDetails some;
16540       };
16541    };
16542 } LDKCOption_OutboundHTLCStateDetailsZ;
16543
16544 /**
16545  * The contents of CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ
16546  */
16547 typedef union LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZPtr {
16548    /**
16549     * A pointer to the contents in the success state.
16550     * Reading from this pointer when `result_ok` is not set is undefined.
16551     */
16552    struct LDKCOption_OutboundHTLCStateDetailsZ *result;
16553    /**
16554     * A pointer to the contents in the error state.
16555     * Reading from this pointer when `result_ok` is set is undefined.
16556     */
16557    struct LDKDecodeError *err;
16558 } LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZPtr;
16559
16560 /**
16561  * A CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ represents the result of a fallible operation,
16562  * containing a crate::c_types::derived::COption_OutboundHTLCStateDetailsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
16563  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16564  */
16565 typedef struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ {
16566    /**
16567     * The contents of this CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ, accessible via either
16568     * `err` or `result` depending on the state of `result_ok`.
16569     */
16570    union LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZPtr contents;
16571    /**
16572     * Whether this CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ represents a success state.
16573     */
16574    bool result_ok;
16575 } LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ;
16576
16577
16578
16579 /**
16580  * Exposes details around pending outbound HTLCs.
16581  */
16582 typedef struct MUST_USE_STRUCT LDKOutboundHTLCDetails {
16583    /**
16584     * A pointer to the opaque Rust object.
16585     * Nearly everywhere, inner must be non-null, however in places where
16586     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16587     */
16588    LDKnativeOutboundHTLCDetails *inner;
16589    /**
16590     * Indicates that this is the only struct which contains the same pointer.
16591     * Rust functions which take ownership of an object provided via an argument require
16592     * this to be true and invalidate the object pointed to by inner.
16593     */
16594    bool is_owned;
16595 } LDKOutboundHTLCDetails;
16596
16597 /**
16598  * The contents of CResult_OutboundHTLCDetailsDecodeErrorZ
16599  */
16600 typedef union LDKCResult_OutboundHTLCDetailsDecodeErrorZPtr {
16601    /**
16602     * A pointer to the contents in the success state.
16603     * Reading from this pointer when `result_ok` is not set is undefined.
16604     */
16605    struct LDKOutboundHTLCDetails *result;
16606    /**
16607     * A pointer to the contents in the error state.
16608     * Reading from this pointer when `result_ok` is set is undefined.
16609     */
16610    struct LDKDecodeError *err;
16611 } LDKCResult_OutboundHTLCDetailsDecodeErrorZPtr;
16612
16613 /**
16614  * A CResult_OutboundHTLCDetailsDecodeErrorZ represents the result of a fallible operation,
16615  * containing a crate::lightning::ln::channel_state::OutboundHTLCDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
16616  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16617  */
16618 typedef struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ {
16619    /**
16620     * The contents of this CResult_OutboundHTLCDetailsDecodeErrorZ, accessible via either
16621     * `err` or `result` depending on the state of `result_ok`.
16622     */
16623    union LDKCResult_OutboundHTLCDetailsDecodeErrorZPtr contents;
16624    /**
16625     * Whether this CResult_OutboundHTLCDetailsDecodeErrorZ represents a success state.
16626     */
16627    bool result_ok;
16628 } LDKCResult_OutboundHTLCDetailsDecodeErrorZ;
16629
16630
16631
16632 /**
16633  * Information needed for constructing an invoice route hint for this channel.
16634  */
16635 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
16636    /**
16637     * A pointer to the opaque Rust object.
16638     * Nearly everywhere, inner must be non-null, however in places where
16639     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16640     */
16641    LDKnativeCounterpartyForwardingInfo *inner;
16642    /**
16643     * Indicates that this is the only struct which contains the same pointer.
16644     * Rust functions which take ownership of an object provided via an argument require
16645     * this to be true and invalidate the object pointed to by inner.
16646     */
16647    bool is_owned;
16648 } LDKCounterpartyForwardingInfo;
16649
16650 /**
16651  * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
16652  */
16653 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
16654    /**
16655     * A pointer to the contents in the success state.
16656     * Reading from this pointer when `result_ok` is not set is undefined.
16657     */
16658    struct LDKCounterpartyForwardingInfo *result;
16659    /**
16660     * A pointer to the contents in the error state.
16661     * Reading from this pointer when `result_ok` is set is undefined.
16662     */
16663    struct LDKDecodeError *err;
16664 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
16665
16666 /**
16667  * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
16668  * containing a crate::lightning::ln::channel_state::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
16669  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16670  */
16671 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
16672    /**
16673     * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
16674     * `err` or `result` depending on the state of `result_ok`.
16675     */
16676    union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
16677    /**
16678     * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
16679     */
16680    bool result_ok;
16681 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
16682
16683
16684
16685 /**
16686  * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
16687  * to better separate parameters.
16688  */
16689 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
16690    /**
16691     * A pointer to the opaque Rust object.
16692     * Nearly everywhere, inner must be non-null, however in places where
16693     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16694     */
16695    LDKnativeChannelCounterparty *inner;
16696    /**
16697     * Indicates that this is the only struct which contains the same pointer.
16698     * Rust functions which take ownership of an object provided via an argument require
16699     * this to be true and invalidate the object pointed to by inner.
16700     */
16701    bool is_owned;
16702 } LDKChannelCounterparty;
16703
16704 /**
16705  * The contents of CResult_ChannelCounterpartyDecodeErrorZ
16706  */
16707 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
16708    /**
16709     * A pointer to the contents in the success state.
16710     * Reading from this pointer when `result_ok` is not set is undefined.
16711     */
16712    struct LDKChannelCounterparty *result;
16713    /**
16714     * A pointer to the contents in the error state.
16715     * Reading from this pointer when `result_ok` is set is undefined.
16716     */
16717    struct LDKDecodeError *err;
16718 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
16719
16720 /**
16721  * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
16722  * containing a crate::lightning::ln::channel_state::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
16723  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16724  */
16725 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
16726    /**
16727     * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
16728     * `err` or `result` depending on the state of `result_ok`.
16729     */
16730    union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
16731    /**
16732     * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
16733     */
16734    bool result_ok;
16735 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
16736
16737 /**
16738  * An enum which can either contain a crate::lightning::ln::channel_state::ChannelShutdownState or not
16739  */
16740 typedef enum LDKCOption_ChannelShutdownStateZ_Tag {
16741    /**
16742     * When we're in this state, this COption_ChannelShutdownStateZ contains a crate::lightning::ln::channel_state::ChannelShutdownState
16743     */
16744    LDKCOption_ChannelShutdownStateZ_Some,
16745    /**
16746     * When we're in this state, this COption_ChannelShutdownStateZ contains nothing
16747     */
16748    LDKCOption_ChannelShutdownStateZ_None,
16749    /**
16750     * Must be last for serialization purposes
16751     */
16752    LDKCOption_ChannelShutdownStateZ_Sentinel,
16753 } LDKCOption_ChannelShutdownStateZ_Tag;
16754
16755 typedef struct LDKCOption_ChannelShutdownStateZ {
16756    LDKCOption_ChannelShutdownStateZ_Tag tag;
16757    union {
16758       struct {
16759          enum LDKChannelShutdownState some;
16760       };
16761    };
16762 } LDKCOption_ChannelShutdownStateZ;
16763
16764 /**
16765  * A dynamically-allocated array of crate::lightning::ln::channel_state::InboundHTLCDetailss of arbitrary size.
16766  * This corresponds to std::vector in C++
16767  */
16768 typedef struct LDKCVec_InboundHTLCDetailsZ {
16769    /**
16770     * The elements in the array.
16771     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16772     */
16773    struct LDKInboundHTLCDetails *data;
16774    /**
16775     * The number of elements pointed to by `data`.
16776     */
16777    uintptr_t datalen;
16778 } LDKCVec_InboundHTLCDetailsZ;
16779
16780 /**
16781  * A dynamically-allocated array of crate::lightning::ln::channel_state::OutboundHTLCDetailss of arbitrary size.
16782  * This corresponds to std::vector in C++
16783  */
16784 typedef struct LDKCVec_OutboundHTLCDetailsZ {
16785    /**
16786     * The elements in the array.
16787     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16788     */
16789    struct LDKOutboundHTLCDetails *data;
16790    /**
16791     * The number of elements pointed to by `data`.
16792     */
16793    uintptr_t datalen;
16794 } LDKCVec_OutboundHTLCDetailsZ;
16795
16796 /**
16797  * The contents of CResult_ChannelDetailsDecodeErrorZ
16798  */
16799 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
16800    /**
16801     * A pointer to the contents in the success state.
16802     * Reading from this pointer when `result_ok` is not set is undefined.
16803     */
16804    struct LDKChannelDetails *result;
16805    /**
16806     * A pointer to the contents in the error state.
16807     * Reading from this pointer when `result_ok` is set is undefined.
16808     */
16809    struct LDKDecodeError *err;
16810 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
16811
16812 /**
16813  * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
16814  * containing a crate::lightning::ln::channel_state::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
16815  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16816  */
16817 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
16818    /**
16819     * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
16820     * `err` or `result` depending on the state of `result_ok`.
16821     */
16822    union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
16823    /**
16824     * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
16825     */
16826    bool result_ok;
16827 } LDKCResult_ChannelDetailsDecodeErrorZ;
16828
16829 /**
16830  * The contents of CResult_ChannelShutdownStateDecodeErrorZ
16831  */
16832 typedef union LDKCResult_ChannelShutdownStateDecodeErrorZPtr {
16833    /**
16834     * A pointer to the contents in the success state.
16835     * Reading from this pointer when `result_ok` is not set is undefined.
16836     */
16837    enum LDKChannelShutdownState *result;
16838    /**
16839     * A pointer to the contents in the error state.
16840     * Reading from this pointer when `result_ok` is set is undefined.
16841     */
16842    struct LDKDecodeError *err;
16843 } LDKCResult_ChannelShutdownStateDecodeErrorZPtr;
16844
16845 /**
16846  * A CResult_ChannelShutdownStateDecodeErrorZ represents the result of a fallible operation,
16847  * containing a crate::lightning::ln::channel_state::ChannelShutdownState on success and a crate::lightning::ln::msgs::DecodeError on failure.
16848  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16849  */
16850 typedef struct LDKCResult_ChannelShutdownStateDecodeErrorZ {
16851    /**
16852     * The contents of this CResult_ChannelShutdownStateDecodeErrorZ, accessible via either
16853     * `err` or `result` depending on the state of `result_ok`.
16854     */
16855    union LDKCResult_ChannelShutdownStateDecodeErrorZPtr contents;
16856    /**
16857     * Whether this CResult_ChannelShutdownStateDecodeErrorZ represents a success state.
16858     */
16859    bool result_ok;
16860 } LDKCResult_ChannelShutdownStateDecodeErrorZ;
16861
16862
16863
16864 /**
16865  * A simple future which can complete once, and calls some callback(s) when it does so.
16866  */
16867 typedef struct MUST_USE_STRUCT LDKFuture {
16868    /**
16869     * A pointer to the opaque Rust object.
16870     * Nearly everywhere, inner must be non-null, however in places where
16871     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16872     */
16873    LDKnativeFuture *inner;
16874    /**
16875     * Indicates that this is the only struct which contains the same pointer.
16876     * Rust functions which take ownership of an object provided via an argument require
16877     * this to be true and invalidate the object pointed to by inner.
16878     */
16879    bool is_owned;
16880 } LDKFuture;
16881
16882 /**
16883  * A dynamically-allocated array of crate::lightning::util::wakers::Futures of arbitrary size.
16884  * This corresponds to std::vector in C++
16885  */
16886 typedef struct LDKCVec_FutureZ {
16887    /**
16888     * The elements in the array.
16889     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16890     */
16891    struct LDKFuture *data;
16892    /**
16893     * The number of elements pointed to by `data`.
16894     */
16895    uintptr_t datalen;
16896 } LDKCVec_FutureZ;
16897
16898 /**
16899  * The contents of CResult_OffersMessageDecodeErrorZ
16900  */
16901 typedef union LDKCResult_OffersMessageDecodeErrorZPtr {
16902    /**
16903     * A pointer to the contents in the success state.
16904     * Reading from this pointer when `result_ok` is not set is undefined.
16905     */
16906    struct LDKOffersMessage *result;
16907    /**
16908     * A pointer to the contents in the error state.
16909     * Reading from this pointer when `result_ok` is set is undefined.
16910     */
16911    struct LDKDecodeError *err;
16912 } LDKCResult_OffersMessageDecodeErrorZPtr;
16913
16914 /**
16915  * A CResult_OffersMessageDecodeErrorZ represents the result of a fallible operation,
16916  * containing a crate::lightning::onion_message::offers::OffersMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
16917  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16918  */
16919 typedef struct LDKCResult_OffersMessageDecodeErrorZ {
16920    /**
16921     * The contents of this CResult_OffersMessageDecodeErrorZ, accessible via either
16922     * `err` or `result` depending on the state of `result_ok`.
16923     */
16924    union LDKCResult_OffersMessageDecodeErrorZPtr contents;
16925    /**
16926     * Whether this CResult_OffersMessageDecodeErrorZ represents a success state.
16927     */
16928    bool result_ok;
16929 } LDKCResult_OffersMessageDecodeErrorZ;
16930
16931 /**
16932  * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
16933  */
16934 typedef enum LDKCOption_HTLCClaimZ_Tag {
16935    /**
16936     * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
16937     */
16938    LDKCOption_HTLCClaimZ_Some,
16939    /**
16940     * When we're in this state, this COption_HTLCClaimZ contains nothing
16941     */
16942    LDKCOption_HTLCClaimZ_None,
16943    /**
16944     * Must be last for serialization purposes
16945     */
16946    LDKCOption_HTLCClaimZ_Sentinel,
16947 } LDKCOption_HTLCClaimZ_Tag;
16948
16949 typedef struct LDKCOption_HTLCClaimZ {
16950    LDKCOption_HTLCClaimZ_Tag tag;
16951    union {
16952       struct {
16953          enum LDKHTLCClaim some;
16954       };
16955    };
16956 } LDKCOption_HTLCClaimZ;
16957
16958
16959
16960 /**
16961  * Implements the per-commitment secret storage scheme from
16962  * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
16963  *
16964  * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
16965  * or so.
16966  */
16967 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
16968    /**
16969     * A pointer to the opaque Rust object.
16970     * Nearly everywhere, inner must be non-null, however in places where
16971     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16972     */
16973    LDKnativeCounterpartyCommitmentSecrets *inner;
16974    /**
16975     * Indicates that this is the only struct which contains the same pointer.
16976     * Rust functions which take ownership of an object provided via an argument require
16977     * this to be true and invalidate the object pointed to by inner.
16978     */
16979    bool is_owned;
16980 } LDKCounterpartyCommitmentSecrets;
16981
16982 /**
16983  * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
16984  */
16985 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
16986    /**
16987     * A pointer to the contents in the success state.
16988     * Reading from this pointer when `result_ok` is not set is undefined.
16989     */
16990    struct LDKCounterpartyCommitmentSecrets *result;
16991    /**
16992     * A pointer to the contents in the error state.
16993     * Reading from this pointer when `result_ok` is set is undefined.
16994     */
16995    struct LDKDecodeError *err;
16996 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
16997
16998 /**
16999  * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
17000  * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
17001  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17002  */
17003 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
17004    /**
17005     * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
17006     * `err` or `result` depending on the state of `result_ok`.
17007     */
17008    union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
17009    /**
17010     * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
17011     */
17012    bool result_ok;
17013 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
17014
17015
17016
17017 /**
17018  * The set of public keys which are used in the creation of one commitment transaction.
17019  * These are derived from the channel base keys and per-commitment data.
17020  *
17021  * A broadcaster key is provided from potential broadcaster of the computed transaction.
17022  * A countersignatory key is coming from a protocol participant unable to broadcast the
17023  * transaction.
17024  *
17025  * These keys are assumed to be good, either because the code derived them from
17026  * channel basepoints via the new function, or they were obtained via
17027  * CommitmentTransaction.trust().keys() because we trusted the source of the
17028  * pre-calculated keys.
17029  */
17030 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
17031    /**
17032     * A pointer to the opaque Rust object.
17033     * Nearly everywhere, inner must be non-null, however in places where
17034     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17035     */
17036    LDKnativeTxCreationKeys *inner;
17037    /**
17038     * Indicates that this is the only struct which contains the same pointer.
17039     * Rust functions which take ownership of an object provided via an argument require
17040     * this to be true and invalidate the object pointed to by inner.
17041     */
17042    bool is_owned;
17043 } LDKTxCreationKeys;
17044
17045 /**
17046  * The contents of CResult_TxCreationKeysDecodeErrorZ
17047  */
17048 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
17049    /**
17050     * A pointer to the contents in the success state.
17051     * Reading from this pointer when `result_ok` is not set is undefined.
17052     */
17053    struct LDKTxCreationKeys *result;
17054    /**
17055     * A pointer to the contents in the error state.
17056     * Reading from this pointer when `result_ok` is set is undefined.
17057     */
17058    struct LDKDecodeError *err;
17059 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
17060
17061 /**
17062  * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
17063  * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
17064  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17065  */
17066 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
17067    /**
17068     * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
17069     * `err` or `result` depending on the state of `result_ok`.
17070     */
17071    union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
17072    /**
17073     * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
17074     */
17075    bool result_ok;
17076 } LDKCResult_TxCreationKeysDecodeErrorZ;
17077
17078 /**
17079  * The contents of CResult_ChannelPublicKeysDecodeErrorZ
17080  */
17081 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
17082    /**
17083     * A pointer to the contents in the success state.
17084     * Reading from this pointer when `result_ok` is not set is undefined.
17085     */
17086    struct LDKChannelPublicKeys *result;
17087    /**
17088     * A pointer to the contents in the error state.
17089     * Reading from this pointer when `result_ok` is set is undefined.
17090     */
17091    struct LDKDecodeError *err;
17092 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
17093
17094 /**
17095  * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
17096  * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
17097  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17098  */
17099 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
17100    /**
17101     * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
17102     * `err` or `result` depending on the state of `result_ok`.
17103     */
17104    union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
17105    /**
17106     * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
17107     */
17108    bool result_ok;
17109 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
17110
17111 /**
17112  * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
17113  */
17114 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
17115    /**
17116     * A pointer to the contents in the success state.
17117     * Reading from this pointer when `result_ok` is not set is undefined.
17118     */
17119    struct LDKHTLCOutputInCommitment *result;
17120    /**
17121     * A pointer to the contents in the error state.
17122     * Reading from this pointer when `result_ok` is set is undefined.
17123     */
17124    struct LDKDecodeError *err;
17125 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
17126
17127 /**
17128  * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
17129  * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
17130  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17131  */
17132 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
17133    /**
17134     * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
17135     * `err` or `result` depending on the state of `result_ok`.
17136     */
17137    union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
17138    /**
17139     * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
17140     */
17141    bool result_ok;
17142 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
17143
17144
17145
17146 /**
17147  * Late-bound per-channel counterparty data used to build transactions.
17148  */
17149 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
17150    /**
17151     * A pointer to the opaque Rust object.
17152     * Nearly everywhere, inner must be non-null, however in places where
17153     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17154     */
17155    LDKnativeCounterpartyChannelTransactionParameters *inner;
17156    /**
17157     * Indicates that this is the only struct which contains the same pointer.
17158     * Rust functions which take ownership of an object provided via an argument require
17159     * this to be true and invalidate the object pointed to by inner.
17160     */
17161    bool is_owned;
17162 } LDKCounterpartyChannelTransactionParameters;
17163
17164 /**
17165  * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
17166  */
17167 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
17168    /**
17169     * A pointer to the contents in the success state.
17170     * Reading from this pointer when `result_ok` is not set is undefined.
17171     */
17172    struct LDKCounterpartyChannelTransactionParameters *result;
17173    /**
17174     * A pointer to the contents in the error state.
17175     * Reading from this pointer when `result_ok` is set is undefined.
17176     */
17177    struct LDKDecodeError *err;
17178 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
17179
17180 /**
17181  * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
17182  * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
17183  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17184  */
17185 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
17186    /**
17187     * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
17188     * `err` or `result` depending on the state of `result_ok`.
17189     */
17190    union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
17191    /**
17192     * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
17193     */
17194    bool result_ok;
17195 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
17196
17197 /**
17198  * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
17199  */
17200 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
17201    /**
17202     * A pointer to the contents in the success state.
17203     * Reading from this pointer when `result_ok` is not set is undefined.
17204     */
17205    struct LDKChannelTransactionParameters *result;
17206    /**
17207     * A pointer to the contents in the error state.
17208     * Reading from this pointer when `result_ok` is set is undefined.
17209     */
17210    struct LDKDecodeError *err;
17211 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
17212
17213 /**
17214  * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
17215  * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
17216  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17217  */
17218 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
17219    /**
17220     * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
17221     * `err` or `result` depending on the state of `result_ok`.
17222     */
17223    union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
17224    /**
17225     * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
17226     */
17227    bool result_ok;
17228 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
17229
17230 /**
17231  * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
17232  */
17233 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
17234    /**
17235     * A pointer to the contents in the success state.
17236     * Reading from this pointer when `result_ok` is not set is undefined.
17237     */
17238    struct LDKHolderCommitmentTransaction *result;
17239    /**
17240     * A pointer to the contents in the error state.
17241     * Reading from this pointer when `result_ok` is set is undefined.
17242     */
17243    struct LDKDecodeError *err;
17244 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
17245
17246 /**
17247  * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
17248  * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
17249  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17250  */
17251 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
17252    /**
17253     * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
17254     * `err` or `result` depending on the state of `result_ok`.
17255     */
17256    union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
17257    /**
17258     * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
17259     */
17260    bool result_ok;
17261 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
17262
17263
17264
17265 /**
17266  * A pre-built Bitcoin commitment transaction and its txid.
17267  */
17268 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
17269    /**
17270     * A pointer to the opaque Rust object.
17271     * Nearly everywhere, inner must be non-null, however in places where
17272     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17273     */
17274    LDKnativeBuiltCommitmentTransaction *inner;
17275    /**
17276     * Indicates that this is the only struct which contains the same pointer.
17277     * Rust functions which take ownership of an object provided via an argument require
17278     * this to be true and invalidate the object pointed to by inner.
17279     */
17280    bool is_owned;
17281 } LDKBuiltCommitmentTransaction;
17282
17283 /**
17284  * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
17285  */
17286 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
17287    /**
17288     * A pointer to the contents in the success state.
17289     * Reading from this pointer when `result_ok` is not set is undefined.
17290     */
17291    struct LDKBuiltCommitmentTransaction *result;
17292    /**
17293     * A pointer to the contents in the error state.
17294     * Reading from this pointer when `result_ok` is set is undefined.
17295     */
17296    struct LDKDecodeError *err;
17297 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
17298
17299 /**
17300  * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
17301  * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
17302  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17303  */
17304 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
17305    /**
17306     * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
17307     * `err` or `result` depending on the state of `result_ok`.
17308     */
17309    union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
17310    /**
17311     * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
17312     */
17313    bool result_ok;
17314 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
17315
17316
17317
17318 /**
17319  * A wrapper on ClosingTransaction indicating that the built bitcoin
17320  * transaction is trusted.
17321  *
17322  * See trust() and verify() functions on CommitmentTransaction.
17323  *
17324  * This structure implements Deref.
17325  */
17326 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
17327    /**
17328     * A pointer to the opaque Rust object.
17329     * Nearly everywhere, inner must be non-null, however in places where
17330     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17331     */
17332    LDKnativeTrustedClosingTransaction *inner;
17333    /**
17334     * Indicates that this is the only struct which contains the same pointer.
17335     * Rust functions which take ownership of an object provided via an argument require
17336     * this to be true and invalidate the object pointed to by inner.
17337     */
17338    bool is_owned;
17339 } LDKTrustedClosingTransaction;
17340
17341 /**
17342  * The contents of CResult_TrustedClosingTransactionNoneZ
17343  */
17344 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
17345    /**
17346     * A pointer to the contents in the success state.
17347     * Reading from this pointer when `result_ok` is not set is undefined.
17348     */
17349    struct LDKTrustedClosingTransaction *result;
17350    /**
17351     * Note that this value is always NULL, as there are no contents in the Err variant
17352     */
17353    void *err;
17354 } LDKCResult_TrustedClosingTransactionNoneZPtr;
17355
17356 /**
17357  * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
17358  * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
17359  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17360  */
17361 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
17362    /**
17363     * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
17364     * `err` or `result` depending on the state of `result_ok`.
17365     */
17366    union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
17367    /**
17368     * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
17369     */
17370    bool result_ok;
17371 } LDKCResult_TrustedClosingTransactionNoneZ;
17372
17373 /**
17374  * The contents of CResult_CommitmentTransactionDecodeErrorZ
17375  */
17376 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
17377    /**
17378     * A pointer to the contents in the success state.
17379     * Reading from this pointer when `result_ok` is not set is undefined.
17380     */
17381    struct LDKCommitmentTransaction *result;
17382    /**
17383     * A pointer to the contents in the error state.
17384     * Reading from this pointer when `result_ok` is set is undefined.
17385     */
17386    struct LDKDecodeError *err;
17387 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
17388
17389 /**
17390  * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
17391  * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
17392  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17393  */
17394 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
17395    /**
17396     * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
17397     * `err` or `result` depending on the state of `result_ok`.
17398     */
17399    union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
17400    /**
17401     * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
17402     */
17403    bool result_ok;
17404 } LDKCResult_CommitmentTransactionDecodeErrorZ;
17405
17406
17407
17408 /**
17409  * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
17410  * transaction and the transaction creation keys) are trusted.
17411  *
17412  * See trust() and verify() functions on CommitmentTransaction.
17413  *
17414  * This structure implements Deref.
17415  */
17416 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
17417    /**
17418     * A pointer to the opaque Rust object.
17419     * Nearly everywhere, inner must be non-null, however in places where
17420     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17421     */
17422    LDKnativeTrustedCommitmentTransaction *inner;
17423    /**
17424     * Indicates that this is the only struct which contains the same pointer.
17425     * Rust functions which take ownership of an object provided via an argument require
17426     * this to be true and invalidate the object pointed to by inner.
17427     */
17428    bool is_owned;
17429 } LDKTrustedCommitmentTransaction;
17430
17431 /**
17432  * The contents of CResult_TrustedCommitmentTransactionNoneZ
17433  */
17434 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
17435    /**
17436     * A pointer to the contents in the success state.
17437     * Reading from this pointer when `result_ok` is not set is undefined.
17438     */
17439    struct LDKTrustedCommitmentTransaction *result;
17440    /**
17441     * Note that this value is always NULL, as there are no contents in the Err variant
17442     */
17443    void *err;
17444 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
17445
17446 /**
17447  * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
17448  * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
17449  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17450  */
17451 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
17452    /**
17453     * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
17454     * `err` or `result` depending on the state of `result_ok`.
17455     */
17456    union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
17457    /**
17458     * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
17459     */
17460    bool result_ok;
17461 } LDKCResult_TrustedCommitmentTransactionNoneZ;
17462
17463 /**
17464  * The contents of CResult_CVec_ECDSASignatureZNoneZ
17465  */
17466 typedef union LDKCResult_CVec_ECDSASignatureZNoneZPtr {
17467    /**
17468     * A pointer to the contents in the success state.
17469     * Reading from this pointer when `result_ok` is not set is undefined.
17470     */
17471    struct LDKCVec_ECDSASignatureZ *result;
17472    /**
17473     * Note that this value is always NULL, as there are no contents in the Err variant
17474     */
17475    void *err;
17476 } LDKCResult_CVec_ECDSASignatureZNoneZPtr;
17477
17478 /**
17479  * A CResult_CVec_ECDSASignatureZNoneZ represents the result of a fallible operation,
17480  * containing a crate::c_types::derived::CVec_ECDSASignatureZ on success and a () on failure.
17481  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17482  */
17483 typedef struct LDKCResult_CVec_ECDSASignatureZNoneZ {
17484    /**
17485     * The contents of this CResult_CVec_ECDSASignatureZNoneZ, accessible via either
17486     * `err` or `result` depending on the state of `result_ok`.
17487     */
17488    union LDKCResult_CVec_ECDSASignatureZNoneZPtr contents;
17489    /**
17490     * Whether this CResult_CVec_ECDSASignatureZNoneZ represents a success state.
17491     */
17492    bool result_ok;
17493 } LDKCResult_CVec_ECDSASignatureZNoneZ;
17494
17495 /**
17496  * An enum which can either contain a usize or not
17497  */
17498 typedef enum LDKCOption_usizeZ_Tag {
17499    /**
17500     * When we're in this state, this COption_usizeZ contains a usize
17501     */
17502    LDKCOption_usizeZ_Some,
17503    /**
17504     * When we're in this state, this COption_usizeZ contains nothing
17505     */
17506    LDKCOption_usizeZ_None,
17507    /**
17508     * Must be last for serialization purposes
17509     */
17510    LDKCOption_usizeZ_Sentinel,
17511 } LDKCOption_usizeZ_Tag;
17512
17513 typedef struct LDKCOption_usizeZ {
17514    LDKCOption_usizeZ_Tag tag;
17515    union {
17516       struct {
17517          uintptr_t some;
17518       };
17519    };
17520 } LDKCOption_usizeZ;
17521
17522 /**
17523  * The contents of CResult_ShutdownScriptDecodeErrorZ
17524  */
17525 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
17526    /**
17527     * A pointer to the contents in the success state.
17528     * Reading from this pointer when `result_ok` is not set is undefined.
17529     */
17530    struct LDKShutdownScript *result;
17531    /**
17532     * A pointer to the contents in the error state.
17533     * Reading from this pointer when `result_ok` is set is undefined.
17534     */
17535    struct LDKDecodeError *err;
17536 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
17537
17538 /**
17539  * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
17540  * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
17541  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17542  */
17543 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
17544    /**
17545     * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
17546     * `err` or `result` depending on the state of `result_ok`.
17547     */
17548    union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
17549    /**
17550     * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
17551     */
17552    bool result_ok;
17553 } LDKCResult_ShutdownScriptDecodeErrorZ;
17554
17555
17556
17557 /**
17558  * An error occurring when converting from [`ScriptBuf`] to [`ShutdownScript`].
17559  */
17560 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
17561    /**
17562     * A pointer to the opaque Rust object.
17563     * Nearly everywhere, inner must be non-null, however in places where
17564     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17565     */
17566    LDKnativeInvalidShutdownScript *inner;
17567    /**
17568     * Indicates that this is the only struct which contains the same pointer.
17569     * Rust functions which take ownership of an object provided via an argument require
17570     * this to be true and invalidate the object pointed to by inner.
17571     */
17572    bool is_owned;
17573 } LDKInvalidShutdownScript;
17574
17575 /**
17576  * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
17577  */
17578 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
17579    /**
17580     * A pointer to the contents in the success state.
17581     * Reading from this pointer when `result_ok` is not set is undefined.
17582     */
17583    struct LDKShutdownScript *result;
17584    /**
17585     * A pointer to the contents in the error state.
17586     * Reading from this pointer when `result_ok` is set is undefined.
17587     */
17588    struct LDKInvalidShutdownScript *err;
17589 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
17590
17591 /**
17592  * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
17593  * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
17594  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17595  */
17596 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
17597    /**
17598     * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
17599     * `err` or `result` depending on the state of `result_ok`.
17600     */
17601    union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
17602    /**
17603     * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
17604     */
17605    bool result_ok;
17606 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
17607
17608 /**
17609  * Some information provided on receipt of payment depends on whether the payment received is a
17610  * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
17611  */
17612 typedef enum LDKPaymentPurpose_Tag {
17613    /**
17614     * A payment for a BOLT 11 invoice.
17615     */
17616    LDKPaymentPurpose_Bolt11InvoicePayment,
17617    /**
17618     * A payment for a BOLT 12 [`Offer`].
17619     *
17620     * [`Offer`]: crate::offers::offer::Offer
17621     */
17622    LDKPaymentPurpose_Bolt12OfferPayment,
17623    /**
17624     * A payment for a BOLT 12 [`Refund`].
17625     *
17626     * [`Refund`]: crate::offers::refund::Refund
17627     */
17628    LDKPaymentPurpose_Bolt12RefundPayment,
17629    /**
17630     * Because this is a spontaneous payment, the payer generated their own preimage rather than us
17631     * (the payee) providing a preimage.
17632     */
17633    LDKPaymentPurpose_SpontaneousPayment,
17634    /**
17635     * Must be last for serialization purposes
17636     */
17637    LDKPaymentPurpose_Sentinel,
17638 } LDKPaymentPurpose_Tag;
17639
17640 typedef struct LDKPaymentPurpose_LDKBolt11InvoicePayment_Body {
17641    /**
17642     * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
17643     * [`ChannelManager::create_inbound_payment`]. When handling [`Event::PaymentClaimable`],
17644     * this can be passed directly to [`ChannelManager::claim_funds`] to claim the payment. No
17645     * action is needed when seen in [`Event::PaymentClaimed`].
17646     *
17647     * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
17648     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
17649     */
17650    struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
17651    /**
17652     * The \"payment secret\". This authenticates the sender to the recipient, preventing a
17653     * number of deanonymization attacks during the routing process.
17654     * It is provided here for your reference, however its accuracy is enforced directly by
17655     * [`ChannelManager`] using the values you previously provided to
17656     * [`ChannelManager::create_inbound_payment`] or
17657     * [`ChannelManager::create_inbound_payment_for_hash`].
17658     *
17659     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17660     * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
17661     * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
17662     */
17663    struct LDKThirtyTwoBytes payment_secret;
17664 } LDKPaymentPurpose_LDKBolt11InvoicePayment_Body;
17665
17666 typedef struct LDKPaymentPurpose_LDKBolt12OfferPayment_Body {
17667    /**
17668     * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
17669     * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
17670     * when seen in [`Event::PaymentClaimed`].
17671     *
17672     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
17673     */
17674    struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
17675    /**
17676     * The secret used to authenticate the sender to the recipient, preventing a number of
17677     * de-anonymization attacks while routing a payment.
17678     *
17679     * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
17680     */
17681    struct LDKThirtyTwoBytes payment_secret;
17682    /**
17683     * The context of the payment such as information about the corresponding [`Offer`] and
17684     * [`InvoiceRequest`].
17685     *
17686     * [`Offer`]: crate::offers::offer::Offer
17687     * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
17688     */
17689    struct LDKBolt12OfferContext payment_context;
17690 } LDKPaymentPurpose_LDKBolt12OfferPayment_Body;
17691
17692 typedef struct LDKPaymentPurpose_LDKBolt12RefundPayment_Body {
17693    /**
17694     * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
17695     * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
17696     * when seen in [`Event::PaymentClaimed`].
17697     *
17698     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
17699     */
17700    struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
17701    /**
17702     * The secret used to authenticate the sender to the recipient, preventing a number of
17703     * de-anonymization attacks while routing a payment.
17704     *
17705     * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
17706     */
17707    struct LDKThirtyTwoBytes payment_secret;
17708    /**
17709     * The context of the payment such as information about the corresponding [`Refund`].
17710     *
17711     * [`Refund`]: crate::offers::refund::Refund
17712     */
17713    struct LDKBolt12RefundContext payment_context;
17714 } LDKPaymentPurpose_LDKBolt12RefundPayment_Body;
17715
17716 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
17717    LDKPaymentPurpose_Tag tag;
17718    union {
17719       LDKPaymentPurpose_LDKBolt11InvoicePayment_Body bolt11_invoice_payment;
17720       LDKPaymentPurpose_LDKBolt12OfferPayment_Body bolt12_offer_payment;
17721       LDKPaymentPurpose_LDKBolt12RefundPayment_Body bolt12_refund_payment;
17722       struct {
17723          struct LDKThirtyTwoBytes spontaneous_payment;
17724       };
17725    };
17726 } LDKPaymentPurpose;
17727
17728 /**
17729  * The contents of CResult_PaymentPurposeDecodeErrorZ
17730  */
17731 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
17732    /**
17733     * A pointer to the contents in the success state.
17734     * Reading from this pointer when `result_ok` is not set is undefined.
17735     */
17736    struct LDKPaymentPurpose *result;
17737    /**
17738     * A pointer to the contents in the error state.
17739     * Reading from this pointer when `result_ok` is set is undefined.
17740     */
17741    struct LDKDecodeError *err;
17742 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
17743
17744 /**
17745  * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
17746  * containing a crate::lightning::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
17747  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17748  */
17749 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
17750    /**
17751     * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
17752     * `err` or `result` depending on the state of `result_ok`.
17753     */
17754    union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
17755    /**
17756     * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
17757     */
17758    bool result_ok;
17759 } LDKCResult_PaymentPurposeDecodeErrorZ;
17760
17761
17762
17763 /**
17764  * Information about an HTLC that is part of a payment that can be claimed.
17765  */
17766 typedef struct MUST_USE_STRUCT LDKClaimedHTLC {
17767    /**
17768     * A pointer to the opaque Rust object.
17769     * Nearly everywhere, inner must be non-null, however in places where
17770     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17771     */
17772    LDKnativeClaimedHTLC *inner;
17773    /**
17774     * Indicates that this is the only struct which contains the same pointer.
17775     * Rust functions which take ownership of an object provided via an argument require
17776     * this to be true and invalidate the object pointed to by inner.
17777     */
17778    bool is_owned;
17779 } LDKClaimedHTLC;
17780
17781 /**
17782  * The contents of CResult_ClaimedHTLCDecodeErrorZ
17783  */
17784 typedef union LDKCResult_ClaimedHTLCDecodeErrorZPtr {
17785    /**
17786     * A pointer to the contents in the success state.
17787     * Reading from this pointer when `result_ok` is not set is undefined.
17788     */
17789    struct LDKClaimedHTLC *result;
17790    /**
17791     * A pointer to the contents in the error state.
17792     * Reading from this pointer when `result_ok` is set is undefined.
17793     */
17794    struct LDKDecodeError *err;
17795 } LDKCResult_ClaimedHTLCDecodeErrorZPtr;
17796
17797 /**
17798  * A CResult_ClaimedHTLCDecodeErrorZ represents the result of a fallible operation,
17799  * containing a crate::lightning::events::ClaimedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
17800  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17801  */
17802 typedef struct LDKCResult_ClaimedHTLCDecodeErrorZ {
17803    /**
17804     * The contents of this CResult_ClaimedHTLCDecodeErrorZ, accessible via either
17805     * `err` or `result` depending on the state of `result_ok`.
17806     */
17807    union LDKCResult_ClaimedHTLCDecodeErrorZPtr contents;
17808    /**
17809     * Whether this CResult_ClaimedHTLCDecodeErrorZ represents a success state.
17810     */
17811    bool result_ok;
17812 } LDKCResult_ClaimedHTLCDecodeErrorZ;
17813
17814 /**
17815  * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may
17816  * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`].
17817  *
17818  * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
17819  * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
17820  */
17821 typedef enum LDKPathFailure_Tag {
17822    /**
17823     * We failed to initially send the payment and no HTLC was committed to. Contains the relevant
17824     * error.
17825     */
17826    LDKPathFailure_InitialSend,
17827    /**
17828     * A hop on the path failed to forward our payment.
17829     */
17830    LDKPathFailure_OnPath,
17831    /**
17832     * Must be last for serialization purposes
17833     */
17834    LDKPathFailure_Sentinel,
17835 } LDKPathFailure_Tag;
17836
17837 typedef struct LDKPathFailure_LDKInitialSend_Body {
17838    /**
17839     * The error surfaced from initial send.
17840     */
17841    struct LDKAPIError err;
17842 } LDKPathFailure_LDKInitialSend_Body;
17843
17844 typedef struct LDKPathFailure_LDKOnPath_Body {
17845    /**
17846     * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing
17847     * decisions can take into account the update.
17848     *
17849     * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
17850     * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
17851     */
17852    struct LDKCOption_NetworkUpdateZ network_update;
17853 } LDKPathFailure_LDKOnPath_Body;
17854
17855 typedef struct MUST_USE_STRUCT LDKPathFailure {
17856    LDKPathFailure_Tag tag;
17857    union {
17858       LDKPathFailure_LDKInitialSend_Body initial_send;
17859       LDKPathFailure_LDKOnPath_Body on_path;
17860    };
17861 } LDKPathFailure;
17862
17863 /**
17864  * An enum which can either contain a crate::lightning::events::PathFailure or not
17865  */
17866 typedef enum LDKCOption_PathFailureZ_Tag {
17867    /**
17868     * When we're in this state, this COption_PathFailureZ contains a crate::lightning::events::PathFailure
17869     */
17870    LDKCOption_PathFailureZ_Some,
17871    /**
17872     * When we're in this state, this COption_PathFailureZ contains nothing
17873     */
17874    LDKCOption_PathFailureZ_None,
17875    /**
17876     * Must be last for serialization purposes
17877     */
17878    LDKCOption_PathFailureZ_Sentinel,
17879 } LDKCOption_PathFailureZ_Tag;
17880
17881 typedef struct LDKCOption_PathFailureZ {
17882    LDKCOption_PathFailureZ_Tag tag;
17883    union {
17884       struct {
17885          struct LDKPathFailure some;
17886       };
17887    };
17888 } LDKCOption_PathFailureZ;
17889
17890 /**
17891  * The contents of CResult_COption_PathFailureZDecodeErrorZ
17892  */
17893 typedef union LDKCResult_COption_PathFailureZDecodeErrorZPtr {
17894    /**
17895     * A pointer to the contents in the success state.
17896     * Reading from this pointer when `result_ok` is not set is undefined.
17897     */
17898    struct LDKCOption_PathFailureZ *result;
17899    /**
17900     * A pointer to the contents in the error state.
17901     * Reading from this pointer when `result_ok` is set is undefined.
17902     */
17903    struct LDKDecodeError *err;
17904 } LDKCResult_COption_PathFailureZDecodeErrorZPtr;
17905
17906 /**
17907  * A CResult_COption_PathFailureZDecodeErrorZ represents the result of a fallible operation,
17908  * containing a crate::c_types::derived::COption_PathFailureZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
17909  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17910  */
17911 typedef struct LDKCResult_COption_PathFailureZDecodeErrorZ {
17912    /**
17913     * The contents of this CResult_COption_PathFailureZDecodeErrorZ, accessible via either
17914     * `err` or `result` depending on the state of `result_ok`.
17915     */
17916    union LDKCResult_COption_PathFailureZDecodeErrorZPtr contents;
17917    /**
17918     * Whether this CResult_COption_PathFailureZDecodeErrorZ represents a success state.
17919     */
17920    bool result_ok;
17921 } LDKCResult_COption_PathFailureZDecodeErrorZ;
17922
17923 /**
17924  * An enum which can either contain a crate::lightning::events::ClosureReason or not
17925  */
17926 typedef enum LDKCOption_ClosureReasonZ_Tag {
17927    /**
17928     * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::events::ClosureReason
17929     */
17930    LDKCOption_ClosureReasonZ_Some,
17931    /**
17932     * When we're in this state, this COption_ClosureReasonZ contains nothing
17933     */
17934    LDKCOption_ClosureReasonZ_None,
17935    /**
17936     * Must be last for serialization purposes
17937     */
17938    LDKCOption_ClosureReasonZ_Sentinel,
17939 } LDKCOption_ClosureReasonZ_Tag;
17940
17941 typedef struct LDKCOption_ClosureReasonZ {
17942    LDKCOption_ClosureReasonZ_Tag tag;
17943    union {
17944       struct {
17945          struct LDKClosureReason some;
17946       };
17947    };
17948 } LDKCOption_ClosureReasonZ;
17949
17950 /**
17951  * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
17952  */
17953 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
17954    /**
17955     * A pointer to the contents in the success state.
17956     * Reading from this pointer when `result_ok` is not set is undefined.
17957     */
17958    struct LDKCOption_ClosureReasonZ *result;
17959    /**
17960     * A pointer to the contents in the error state.
17961     * Reading from this pointer when `result_ok` is set is undefined.
17962     */
17963    struct LDKDecodeError *err;
17964 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
17965
17966 /**
17967  * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
17968  * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
17969  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17970  */
17971 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
17972    /**
17973     * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
17974     * `err` or `result` depending on the state of `result_ok`.
17975     */
17976    union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
17977    /**
17978     * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
17979     */
17980    bool result_ok;
17981 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
17982
17983 /**
17984  * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
17985  */
17986 typedef enum LDKHTLCDestination_Tag {
17987    /**
17988     * We tried forwarding to a channel but failed to do so. An example of such an instance is when
17989     * there is insufficient capacity in our outbound channel.
17990     */
17991    LDKHTLCDestination_NextHopChannel,
17992    /**
17993     * Scenario where we are unsure of the next node to forward the HTLC to.
17994     */
17995    LDKHTLCDestination_UnknownNextHop,
17996    /**
17997     * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
17998     * intercept HTLC.
17999     */
18000    LDKHTLCDestination_InvalidForward,
18001    /**
18002     * We couldn't decode the incoming onion to obtain the forwarding details.
18003     */
18004    LDKHTLCDestination_InvalidOnion,
18005    /**
18006     * Failure scenario where an HTLC may have been forwarded to be intended for us,
18007     * but is invalid for some reason, so we reject it.
18008     *
18009     * Some of the reasons may include:
18010     * * HTLC Timeouts
18011     * * Excess HTLCs for a payment that we have already fully received, over-paying for the
18012     *   payment,
18013     * * The counterparty node modified the HTLC in transit,
18014     * * A probing attack where an intermediary node is trying to detect if we are the ultimate
18015     *   recipient for a payment.
18016     */
18017    LDKHTLCDestination_FailedPayment,
18018    /**
18019     * Must be last for serialization purposes
18020     */
18021    LDKHTLCDestination_Sentinel,
18022 } LDKHTLCDestination_Tag;
18023
18024 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
18025    /**
18026     * The `node_id` of the next node. For backwards compatibility, this field is
18027     * marked as optional, versions prior to 0.0.110 may not always be able to provide
18028     * counterparty node information.
18029     *
18030     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18031     */
18032    struct LDKPublicKey node_id;
18033    /**
18034     * The outgoing `channel_id` between us and the next node.
18035     */
18036    struct LDKChannelId channel_id;
18037 } LDKHTLCDestination_LDKNextHopChannel_Body;
18038
18039 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
18040    /**
18041     * Short channel id we are requesting to forward an HTLC to.
18042     */
18043    uint64_t requested_forward_scid;
18044 } LDKHTLCDestination_LDKUnknownNextHop_Body;
18045
18046 typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
18047    /**
18048     * Short channel id we are requesting to forward an HTLC to.
18049     */
18050    uint64_t requested_forward_scid;
18051 } LDKHTLCDestination_LDKInvalidForward_Body;
18052
18053 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
18054    /**
18055     * The payment hash of the payment we attempted to process.
18056     */
18057    struct LDKThirtyTwoBytes payment_hash;
18058 } LDKHTLCDestination_LDKFailedPayment_Body;
18059
18060 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
18061    LDKHTLCDestination_Tag tag;
18062    union {
18063       LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
18064       LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
18065       LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
18066       LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
18067    };
18068 } LDKHTLCDestination;
18069
18070 /**
18071  * An enum which can either contain a crate::lightning::events::HTLCDestination or not
18072  */
18073 typedef enum LDKCOption_HTLCDestinationZ_Tag {
18074    /**
18075     * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::events::HTLCDestination
18076     */
18077    LDKCOption_HTLCDestinationZ_Some,
18078    /**
18079     * When we're in this state, this COption_HTLCDestinationZ contains nothing
18080     */
18081    LDKCOption_HTLCDestinationZ_None,
18082    /**
18083     * Must be last for serialization purposes
18084     */
18085    LDKCOption_HTLCDestinationZ_Sentinel,
18086 } LDKCOption_HTLCDestinationZ_Tag;
18087
18088 typedef struct LDKCOption_HTLCDestinationZ {
18089    LDKCOption_HTLCDestinationZ_Tag tag;
18090    union {
18091       struct {
18092          struct LDKHTLCDestination some;
18093       };
18094    };
18095 } LDKCOption_HTLCDestinationZ;
18096
18097 /**
18098  * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
18099  */
18100 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
18101    /**
18102     * A pointer to the contents in the success state.
18103     * Reading from this pointer when `result_ok` is not set is undefined.
18104     */
18105    struct LDKCOption_HTLCDestinationZ *result;
18106    /**
18107     * A pointer to the contents in the error state.
18108     * Reading from this pointer when `result_ok` is set is undefined.
18109     */
18110    struct LDKDecodeError *err;
18111 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
18112
18113 /**
18114  * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
18115  * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
18116  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18117  */
18118 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
18119    /**
18120     * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
18121     * `err` or `result` depending on the state of `result_ok`.
18122     */
18123    union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
18124    /**
18125     * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
18126     */
18127    bool result_ok;
18128 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
18129
18130 /**
18131  * The contents of CResult_PaymentFailureReasonDecodeErrorZ
18132  */
18133 typedef union LDKCResult_PaymentFailureReasonDecodeErrorZPtr {
18134    /**
18135     * A pointer to the contents in the success state.
18136     * Reading from this pointer when `result_ok` is not set is undefined.
18137     */
18138    enum LDKPaymentFailureReason *result;
18139    /**
18140     * A pointer to the contents in the error state.
18141     * Reading from this pointer when `result_ok` is set is undefined.
18142     */
18143    struct LDKDecodeError *err;
18144 } LDKCResult_PaymentFailureReasonDecodeErrorZPtr;
18145
18146 /**
18147  * A CResult_PaymentFailureReasonDecodeErrorZ represents the result of a fallible operation,
18148  * containing a crate::lightning::events::PaymentFailureReason on success and a crate::lightning::ln::msgs::DecodeError on failure.
18149  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18150  */
18151 typedef struct LDKCResult_PaymentFailureReasonDecodeErrorZ {
18152    /**
18153     * The contents of this CResult_PaymentFailureReasonDecodeErrorZ, accessible via either
18154     * `err` or `result` depending on the state of `result_ok`.
18155     */
18156    union LDKCResult_PaymentFailureReasonDecodeErrorZPtr contents;
18157    /**
18158     * Whether this CResult_PaymentFailureReasonDecodeErrorZ represents a success state.
18159     */
18160    bool result_ok;
18161 } LDKCResult_PaymentFailureReasonDecodeErrorZ;
18162
18163 /**
18164  * An enum which can either contain a crate::c_types::U128 or not
18165  */
18166 typedef enum LDKCOption_U128Z_Tag {
18167    /**
18168     * When we're in this state, this COption_U128Z contains a crate::c_types::U128
18169     */
18170    LDKCOption_U128Z_Some,
18171    /**
18172     * When we're in this state, this COption_U128Z contains nothing
18173     */
18174    LDKCOption_U128Z_None,
18175    /**
18176     * Must be last for serialization purposes
18177     */
18178    LDKCOption_U128Z_Sentinel,
18179 } LDKCOption_U128Z_Tag;
18180
18181 typedef struct LDKCOption_U128Z {
18182    LDKCOption_U128Z_Tag tag;
18183    union {
18184       struct {
18185          struct LDKU128 some;
18186       };
18187    };
18188 } LDKCOption_U128Z;
18189
18190 /**
18191  * A dynamically-allocated array of crate::lightning::events::ClaimedHTLCs of arbitrary size.
18192  * This corresponds to std::vector in C++
18193  */
18194 typedef struct LDKCVec_ClaimedHTLCZ {
18195    /**
18196     * The elements in the array.
18197     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
18198     */
18199    struct LDKClaimedHTLC *data;
18200    /**
18201     * The number of elements pointed to by `data`.
18202     */
18203    uintptr_t datalen;
18204 } LDKCVec_ClaimedHTLCZ;
18205
18206 /**
18207  * An enum which can either contain a crate::lightning::events::PaymentFailureReason or not
18208  */
18209 typedef enum LDKCOption_PaymentFailureReasonZ_Tag {
18210    /**
18211     * When we're in this state, this COption_PaymentFailureReasonZ contains a crate::lightning::events::PaymentFailureReason
18212     */
18213    LDKCOption_PaymentFailureReasonZ_Some,
18214    /**
18215     * When we're in this state, this COption_PaymentFailureReasonZ contains nothing
18216     */
18217    LDKCOption_PaymentFailureReasonZ_None,
18218    /**
18219     * Must be last for serialization purposes
18220     */
18221    LDKCOption_PaymentFailureReasonZ_Sentinel,
18222 } LDKCOption_PaymentFailureReasonZ_Tag;
18223
18224 typedef struct LDKCOption_PaymentFailureReasonZ {
18225    LDKCOption_PaymentFailureReasonZ_Tag tag;
18226    union {
18227       struct {
18228          enum LDKPaymentFailureReason some;
18229       };
18230    };
18231 } LDKCOption_PaymentFailureReasonZ;
18232
18233
18234
18235 /**
18236  * A descriptor used to sign for a commitment transaction's anchor output.
18237  */
18238 typedef struct MUST_USE_STRUCT LDKAnchorDescriptor {
18239    /**
18240     * A pointer to the opaque Rust object.
18241     * Nearly everywhere, inner must be non-null, however in places where
18242     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18243     */
18244    LDKnativeAnchorDescriptor *inner;
18245    /**
18246     * Indicates that this is the only struct which contains the same pointer.
18247     * Rust functions which take ownership of an object provided via an argument require
18248     * this to be true and invalidate the object pointed to by inner.
18249     */
18250    bool is_owned;
18251 } LDKAnchorDescriptor;
18252
18253 /**
18254  * Represents the different types of transactions, originating from LDK, to be bumped.
18255  */
18256 typedef enum LDKBumpTransactionEvent_Tag {
18257    /**
18258     * Indicates that a channel featuring anchor outputs is to be closed by broadcasting the local
18259     * commitment transaction. Since commitment transactions have a static feerate pre-agreed upon,
18260     * they may need additional fees to be attached through a child transaction using the popular
18261     * [Child-Pays-For-Parent](https://bitcoinops.org/en/topics/cpfp) fee bumping technique. This
18262     * child transaction must include the anchor input described within `anchor_descriptor` along
18263     * with additional inputs to meet the target feerate. Failure to meet the target feerate
18264     * decreases the confirmation odds of the transaction package (which includes the commitment
18265     * and child anchor transactions), possibly resulting in a loss of funds. Once the transaction
18266     * is constructed, it must be fully signed for and broadcast by the consumer of the event
18267     * along with the `commitment_tx` enclosed. Note that the `commitment_tx` must always be
18268     * broadcast first, as the child anchor transaction depends on it.
18269     *
18270     * The consumer should be able to sign for any of the additional inputs included within the
18271     * child anchor transaction. To sign its anchor input, an [`EcdsaChannelSigner`] should be
18272     * re-derived through [`AnchorDescriptor::derive_channel_signer`]. The anchor input signature
18273     * can be computed with [`EcdsaChannelSigner::sign_holder_anchor_input`], which can then be
18274     * provided to [`build_anchor_input_witness`] along with the `funding_pubkey` to obtain the
18275     * full witness required to spend.
18276     *
18277     * It is possible to receive more than one instance of this event if a valid child anchor
18278     * transaction is never broadcast or is but not with a sufficient fee to be mined. Care should
18279     * be taken by the consumer of the event to ensure any future iterations of the child anchor
18280     * transaction adhere to the [Replace-By-Fee
18281     * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
18282     * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
18283     * these events is not user-controlled, users may ignore/drop the event if they are no longer
18284     * able to commit external confirmed funds to the child anchor transaction.
18285     *
18286     * The set of `pending_htlcs` on the commitment transaction to be broadcast can be inspected to
18287     * determine whether a significant portion of the channel's funds are allocated to HTLCs,
18288     * enabling users to make their own decisions regarding the importance of the commitment
18289     * transaction's confirmation. Note that this is not required, but simply exists as an option
18290     * for users to override LDK's behavior. On commitments with no HTLCs (indicated by those with
18291     * an empty `pending_htlcs`), confirmation of the commitment transaction can be considered to
18292     * be not urgent.
18293     *
18294     * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
18295     * [`EcdsaChannelSigner::sign_holder_anchor_input`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_anchor_input
18296     * [`build_anchor_input_witness`]: crate::ln::chan_utils::build_anchor_input_witness
18297     */
18298    LDKBumpTransactionEvent_ChannelClose,
18299    /**
18300     * Indicates that a channel featuring anchor outputs has unilaterally closed on-chain by a
18301     * holder commitment transaction and its HTLC(s) need to be resolved on-chain. With the
18302     * zero-HTLC-transaction-fee variant of anchor outputs, the pre-signed HTLC
18303     * transactions have a zero fee, thus requiring additional inputs and/or outputs to be attached
18304     * for a timely confirmation within the chain. These additional inputs and/or outputs must be
18305     * appended to the resulting HTLC transaction to meet the target feerate. Failure to meet the
18306     * target feerate decreases the confirmation odds of the transaction, possibly resulting in a
18307     * loss of funds. Once the transaction meets the target feerate, it must be signed for and
18308     * broadcast by the consumer of the event.
18309     *
18310     * The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
18311     * HTLC transaction. To sign HTLC inputs, an [`EcdsaChannelSigner`] should be re-derived
18312     * through [`HTLCDescriptor::derive_channel_signer`]. Each HTLC input's signature can be
18313     * computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
18314     * provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
18315     * to spend.
18316     *
18317     * It is possible to receive more than one instance of this event if a valid HTLC transaction
18318     * is never broadcast or is but not with a sufficient fee to be mined. Care should be taken by
18319     * the consumer of the event to ensure any future iterations of the HTLC transaction adhere to
18320     * the [Replace-By-Fee
18321     * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
18322     * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
18323     * these events is not user-controlled, users may ignore/drop the event if either they are no
18324     * longer able to commit external confirmed funds to the HTLC transaction or the fee committed
18325     * to the HTLC transaction is greater in value than the HTLCs being claimed.
18326     *
18327     * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
18328     * [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_htlc_transaction
18329     */
18330    LDKBumpTransactionEvent_HTLCResolution,
18331    /**
18332     * Must be last for serialization purposes
18333     */
18334    LDKBumpTransactionEvent_Sentinel,
18335 } LDKBumpTransactionEvent_Tag;
18336
18337 typedef struct LDKBumpTransactionEvent_LDKChannelClose_Body {
18338    /**
18339     * The `channel_id` of the channel which has been closed.
18340     */
18341    struct LDKChannelId channel_id;
18342    /**
18343     * Counterparty in the closed channel.
18344     */
18345    struct LDKPublicKey counterparty_node_id;
18346    /**
18347     * The unique identifier for the claim of the anchor output in the commitment transaction.
18348     *
18349     * The identifier must map to the set of external UTXOs assigned to the claim, such that
18350     * they can be reused when a new claim with the same identifier needs to be made, resulting
18351     * in a fee-bumping attempt.
18352     */
18353    struct LDKThirtyTwoBytes claim_id;
18354    /**
18355     * The target feerate that the transaction package, which consists of the commitment
18356     * transaction and the to-be-crafted child anchor transaction, must meet.
18357     */
18358    uint32_t package_target_feerate_sat_per_1000_weight;
18359    /**
18360     * The channel's commitment transaction to bump the fee of. This transaction should be
18361     * broadcast along with the anchor transaction constructed as a result of consuming this
18362     * event.
18363     */
18364    struct LDKTransaction commitment_tx;
18365    /**
18366     * The absolute fee in satoshis of the commitment transaction. This can be used along the
18367     * with weight of the commitment transaction to determine its feerate.
18368     */
18369    uint64_t commitment_tx_fee_satoshis;
18370    /**
18371     * The descriptor to sign the anchor input of the anchor transaction constructed as a
18372     * result of consuming this event.
18373     */
18374    struct LDKAnchorDescriptor anchor_descriptor;
18375    /**
18376     * The set of pending HTLCs on the commitment transaction that need to be resolved once the
18377     * commitment transaction confirms.
18378     */
18379    struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs;
18380 } LDKBumpTransactionEvent_LDKChannelClose_Body;
18381
18382 typedef struct LDKBumpTransactionEvent_LDKHTLCResolution_Body {
18383    /**
18384     * The `channel_id` of the channel which has been closed.
18385     */
18386    struct LDKChannelId channel_id;
18387    /**
18388     * Counterparty in the closed channel.
18389     */
18390    struct LDKPublicKey counterparty_node_id;
18391    /**
18392     * The unique identifier for the claim of the HTLCs in the confirmed commitment
18393     * transaction.
18394     *
18395     * The identifier must map to the set of external UTXOs assigned to the claim, such that
18396     * they can be reused when a new claim with the same identifier needs to be made, resulting
18397     * in a fee-bumping attempt.
18398     */
18399    struct LDKThirtyTwoBytes claim_id;
18400    /**
18401     * The target feerate that the resulting HTLC transaction must meet.
18402     */
18403    uint32_t target_feerate_sat_per_1000_weight;
18404    /**
18405     * The set of pending HTLCs on the confirmed commitment that need to be claimed, preferably
18406     * by the same transaction.
18407     */
18408    struct LDKCVec_HTLCDescriptorZ htlc_descriptors;
18409    /**
18410     * The locktime required for the resulting HTLC transaction.
18411     */
18412    uint32_t tx_lock_time;
18413 } LDKBumpTransactionEvent_LDKHTLCResolution_Body;
18414
18415 typedef struct MUST_USE_STRUCT LDKBumpTransactionEvent {
18416    LDKBumpTransactionEvent_Tag tag;
18417    union {
18418       LDKBumpTransactionEvent_LDKChannelClose_Body channel_close;
18419       LDKBumpTransactionEvent_LDKHTLCResolution_Body htlc_resolution;
18420    };
18421 } LDKBumpTransactionEvent;
18422
18423 /**
18424  * An Event which you should probably take some action in response to.
18425  *
18426  * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
18427  * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
18428  * written as it makes no sense to respond to it after reconnecting to peers).
18429  */
18430 typedef enum LDKEvent_Tag {
18431    /**
18432     * Used to indicate that the client should generate a funding transaction with the given
18433     * parameters and then call [`ChannelManager::funding_transaction_generated`].
18434     * Generated in [`ChannelManager`] message handling.
18435     * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
18436     * counterparty can steal your funds!
18437     *
18438     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
18439     * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
18440     */
18441    LDKEvent_FundingGenerationReady,
18442    /**
18443     * Indicates that we've been offered a payment and it needs to be claimed via calling
18444     * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
18445     *
18446     * Note that if the preimage is not known, you should call
18447     * [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
18448     * to free up resources for this HTLC and avoid network congestion.
18449     *
18450     * If [`Event::PaymentClaimable::onion_fields`] is `Some`, and includes custom TLVs with even type
18451     * numbers, you should use [`ChannelManager::fail_htlc_backwards_with_reason`] with
18452     * [`FailureCode::InvalidOnionPayload`] if you fail to understand and handle the contents, or
18453     * [`ChannelManager::claim_funds_with_known_custom_tlvs`] upon successful handling.
18454     * If you don't intend to check for custom TLVs, you can simply use
18455     * [`ChannelManager::claim_funds`], which will automatically fail back even custom TLVs.
18456     *
18457     * If you fail to call [`ChannelManager::claim_funds`],
18458     * [`ChannelManager::claim_funds_with_known_custom_tlvs`],
18459     * [`ChannelManager::fail_htlc_backwards`], or
18460     * [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will
18461     * be automatically failed.
18462     *
18463     * # Note
18464     * LDK will not stop an inbound payment from being paid multiple times, so multiple
18465     * `PaymentClaimable` events may be generated for the same payment. In such a case it is
18466     * polite (and required in the lightning specification) to fail the payment the second time
18467     * and give the sender their money back rather than accepting double payment.
18468     *
18469     * # Note
18470     * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
18471     *
18472     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
18473     * [`ChannelManager::claim_funds_with_known_custom_tlvs`]: crate::ln::channelmanager::ChannelManager::claim_funds_with_known_custom_tlvs
18474     * [`FailureCode::InvalidOnionPayload`]: crate::ln::channelmanager::FailureCode::InvalidOnionPayload
18475     * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
18476     * [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
18477     */
18478    LDKEvent_PaymentClaimable,
18479    /**
18480     * Indicates a payment has been claimed and we've received money!
18481     *
18482     * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
18483     * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
18484     * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
18485     * [`Event::PaymentClaimable`] event.
18486     *
18487     * # Note
18488     * LDK will not stop an inbound payment from being paid multiple times, so multiple
18489     * `PaymentClaimable` events may be generated for the same payment. If you then call
18490     * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
18491     * multiple `PaymentClaimed` events.
18492     *
18493     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
18494     */
18495    LDKEvent_PaymentClaimed,
18496    /**
18497     * Indicates that a peer connection with a node is needed in order to send an [`OnionMessage`].
18498     *
18499     * Typically, this happens when a [`MessageRouter`] is unable to find a complete path to a
18500     * [`Destination`]. Once a connection is established, any messages buffered by an
18501     * [`OnionMessageHandler`] may be sent.
18502     *
18503     * This event will not be generated for onion message forwards; only for sends including
18504     * replies. Handlers should connect to the node otherwise any buffered messages may be lost.
18505     *
18506     * [`OnionMessage`]: msgs::OnionMessage
18507     * [`MessageRouter`]: crate::onion_message::messenger::MessageRouter
18508     * [`Destination`]: crate::onion_message::messenger::Destination
18509     * [`OnionMessageHandler`]: crate::ln::msgs::OnionMessageHandler
18510     */
18511    LDKEvent_ConnectionNeeded,
18512    /**
18513     * Indicates a request for an invoice failed to yield a response in a reasonable amount of time
18514     * or was explicitly abandoned by [`ChannelManager::abandon_payment`]. This may be for an
18515     * [`InvoiceRequest`] sent for an [`Offer`] or for a [`Refund`] that hasn't been redeemed.
18516     *
18517     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18518     * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
18519     * [`Offer`]: crate::offers::offer::Offer
18520     * [`Refund`]: crate::offers::refund::Refund
18521     */
18522    LDKEvent_InvoiceRequestFailed,
18523    /**
18524     * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
18525     * and we got back the payment preimage for it).
18526     *
18527     * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
18528     * event. In this situation, you SHOULD treat this payment as having succeeded.
18529     */
18530    LDKEvent_PaymentSent,
18531    /**
18532     * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
18533     * provide failure information for each path attempt in the payment, including retries.
18534     *
18535     * This event is provided once there are no further pending HTLCs for the payment and the
18536     * payment is no longer retryable, due either to the [`Retry`] provided or
18537     * [`ChannelManager::abandon_payment`] having been called for the corresponding payment.
18538     *
18539     * In exceedingly rare cases, it is possible that an [`Event::PaymentFailed`] is generated for
18540     * a payment after an [`Event::PaymentSent`] event for this same payment has already been
18541     * received and processed. In this case, the [`Event::PaymentFailed`] event MUST be ignored,
18542     * and the payment MUST be treated as having succeeded.
18543     *
18544     * [`Retry`]: crate::ln::channelmanager::Retry
18545     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18546     */
18547    LDKEvent_PaymentFailed,
18548    /**
18549     * Indicates that a path for an outbound payment was successful.
18550     *
18551     * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
18552     * [`Event::PaymentSent`] for obtaining the payment preimage.
18553     */
18554    LDKEvent_PaymentPathSuccessful,
18555    /**
18556     * Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
18557     * handle the HTLC.
18558     *
18559     * Note that this does *not* indicate that all paths for an MPP payment have failed, see
18560     * [`Event::PaymentFailed`].
18561     *
18562     * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have
18563     * been exhausted.
18564     *
18565     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18566     */
18567    LDKEvent_PaymentPathFailed,
18568    /**
18569     * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
18570     */
18571    LDKEvent_ProbeSuccessful,
18572    /**
18573     * Indicates that a probe payment we sent failed at an intermediary node on the path.
18574     */
18575    LDKEvent_ProbeFailed,
18576    /**
18577     * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
18578     * a time in the future.
18579     *
18580     * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
18581     */
18582    LDKEvent_PendingHTLCsForwardable,
18583    /**
18584     * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
18585     * you've encoded an intercept scid in the receiver's invoice route hints using
18586     * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
18587     *
18588     * [`ChannelManager::forward_intercepted_htlc`] or
18589     * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
18590     * their docs for more information.
18591     *
18592     * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
18593     * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
18594     * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
18595     * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
18596     */
18597    LDKEvent_HTLCIntercepted,
18598    /**
18599     * Used to indicate that an output which you should know how to spend was confirmed on chain
18600     * and is now spendable.
18601     *
18602     * Such an output will *never* be spent directly by LDK, and are not at risk of your
18603     * counterparty spending them due to some kind of timeout. Thus, you need to store them
18604     * somewhere and spend them when you create on-chain transactions.
18605     *
18606     * You may hand them to the [`OutputSweeper`] utility which will store and (re-)generate spending
18607     * transactions for you.
18608     *
18609     * [`OutputSweeper`]: crate::util::sweep::OutputSweeper
18610     */
18611    LDKEvent_SpendableOutputs,
18612    /**
18613     * This event is generated when a payment has been successfully forwarded through us and a
18614     * forwarding fee earned.
18615     */
18616    LDKEvent_PaymentForwarded,
18617    /**
18618     * Used to indicate that a channel with the given `channel_id` is being opened and pending
18619     * confirmation on-chain.
18620     *
18621     * This event is emitted when the funding transaction has been signed and is broadcast to the
18622     * network. For 0conf channels it will be immediately followed by the corresponding
18623     * [`Event::ChannelReady`] event.
18624     */
18625    LDKEvent_ChannelPending,
18626    /**
18627     * Used to indicate that a channel with the given `channel_id` is ready to
18628     * be used. This event is emitted either when the funding transaction has been confirmed
18629     * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
18630     * establishment.
18631     */
18632    LDKEvent_ChannelReady,
18633    /**
18634     * Used to indicate that a channel that got past the initial handshake with the given `channel_id` is in the
18635     * process of closure. This includes previously opened channels, and channels that time out from not being funded.
18636     *
18637     * Note that this event is only triggered for accepted channels: if the
18638     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true and the channel is
18639     * rejected, no `ChannelClosed` event will be sent.
18640     *
18641     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18642     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18643     */
18644    LDKEvent_ChannelClosed,
18645    /**
18646     * Used to indicate to the user that they can abandon the funding transaction and recycle the
18647     * inputs for another purpose.
18648     *
18649     * This event is not guaranteed to be generated for channels that are closed due to a restart.
18650     */
18651    LDKEvent_DiscardFunding,
18652    /**
18653     * Indicates a request to open a new channel by a peer.
18654     *
18655     * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
18656     * call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
18657     * event will _not_ be triggered if the channel is rejected.
18658     *
18659     * The event is only triggered when a new open channel request is received and the
18660     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
18661     *
18662     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18663     * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
18664     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18665     */
18666    LDKEvent_OpenChannelRequest,
18667    /**
18668     * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
18669     * forward it.
18670     *
18671     * Some scenarios where this event may be sent include:
18672     * * Insufficient capacity in the outbound channel
18673     * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
18674     * * When an unknown SCID is requested for forwarding a payment.
18675     * * Expected MPP amount has already been reached
18676     * * The HTLC has timed out
18677     *
18678     * This event, however, does not get generated if an HTLC fails to meet the forwarding
18679     * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
18680     */
18681    LDKEvent_HTLCHandlingFailed,
18682    /**
18683     * Indicates that a transaction originating from LDK needs to have its fee bumped. This event
18684     * requires confirmed external funds to be readily available to spend.
18685     *
18686     * LDK does not currently generate this event unless the
18687     * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`] config flag is set to true.
18688     * It is limited to the scope of channels with anchor outputs.
18689     *
18690     * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx
18691     */
18692    LDKEvent_BumpTransaction,
18693    /**
18694     * Must be last for serialization purposes
18695     */
18696    LDKEvent_Sentinel,
18697 } LDKEvent_Tag;
18698
18699 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
18700    /**
18701     * The random channel_id we picked which you'll need to pass into
18702     * [`ChannelManager::funding_transaction_generated`].
18703     *
18704     * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
18705     */
18706    struct LDKChannelId temporary_channel_id;
18707    /**
18708     * The counterparty's node_id, which you'll need to pass back into
18709     * [`ChannelManager::funding_transaction_generated`].
18710     *
18711     * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
18712     */
18713    struct LDKPublicKey counterparty_node_id;
18714    /**
18715     * The value, in satoshis, that the output should have.
18716     */
18717    uint64_t channel_value_satoshis;
18718    /**
18719     * The script which should be used in the transaction output.
18720     */
18721    struct LDKCVec_u8Z output_script;
18722    /**
18723     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
18724     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
18725     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
18726     * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
18727     * serialized with LDK versions prior to 0.0.113.
18728     *
18729     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
18730     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18731     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18732     */
18733    struct LDKU128 user_channel_id;
18734 } LDKEvent_LDKFundingGenerationReady_Body;
18735
18736 typedef struct LDKEvent_LDKPaymentClaimable_Body {
18737    /**
18738     * The node that will receive the payment after it has been claimed.
18739     * This is useful to identify payments received via [phantom nodes].
18740     * This field will always be filled in when the event was generated by LDK versions
18741     * 0.0.113 and above.
18742     *
18743     * [phantom nodes]: crate::sign::PhantomKeysManager
18744     *
18745     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18746     */
18747    struct LDKPublicKey receiver_node_id;
18748    /**
18749     * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
18750     * not stop you from registering duplicate payment hashes for inbound payments.
18751     */
18752    struct LDKThirtyTwoBytes payment_hash;
18753    /**
18754     * The fields in the onion which were received with each HTLC. Only fields which were
18755     * identical in each HTLC involved in the payment will be included here.
18756     *
18757     * Payments received on LDK versions prior to 0.0.115 will have this field unset.
18758     *
18759     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18760     */
18761    struct LDKRecipientOnionFields onion_fields;
18762    /**
18763     * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
18764     * than the invoice amount.
18765     *
18766     * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
18767     * and the previous hop took an extra fee.
18768     *
18769     * # Note
18770     * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
18771     * field, you may lose money!
18772     *
18773     * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
18774     */
18775    uint64_t amount_msat;
18776    /**
18777     * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
18778     * taken by our channel counterparty.
18779     *
18780     * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
18781     *
18782     * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
18783     */
18784    uint64_t counterparty_skimmed_fee_msat;
18785    /**
18786     * Information for claiming this received payment, based on whether the purpose of the
18787     * payment is to pay an invoice or to send a spontaneous payment.
18788     */
18789    struct LDKPaymentPurpose purpose;
18790    /**
18791     * The `channel_id` indicating over which channel we received the payment.
18792     *
18793     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18794     */
18795    struct LDKChannelId via_channel_id;
18796    /**
18797     * The `user_channel_id` indicating over which channel we received the payment.
18798     */
18799    struct LDKCOption_U128Z via_user_channel_id;
18800    /**
18801     * The block height at which this payment will be failed back and will no longer be
18802     * eligible for claiming.
18803     *
18804     * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
18805     * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
18806     *
18807     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
18808     */
18809    struct LDKCOption_u32Z claim_deadline;
18810 } LDKEvent_LDKPaymentClaimable_Body;
18811
18812 typedef struct LDKEvent_LDKPaymentClaimed_Body {
18813    /**
18814     * The node that received the payment.
18815     * This is useful to identify payments which were received via [phantom nodes].
18816     * This field will always be filled in when the event was generated by LDK versions
18817     * 0.0.113 and above.
18818     *
18819     * [phantom nodes]: crate::sign::PhantomKeysManager
18820     *
18821     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18822     */
18823    struct LDKPublicKey receiver_node_id;
18824    /**
18825     * The payment hash of the claimed payment. Note that LDK will not stop you from
18826     * registering duplicate payment hashes for inbound payments.
18827     */
18828    struct LDKThirtyTwoBytes payment_hash;
18829    /**
18830     * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
18831     * invoice amount.
18832     */
18833    uint64_t amount_msat;
18834    /**
18835     * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
18836     * spontaneous payment.
18837     */
18838    struct LDKPaymentPurpose purpose;
18839    /**
18840     * The HTLCs that comprise the claimed payment. This will be empty for events serialized prior
18841     * to LDK version 0.0.117.
18842     */
18843    struct LDKCVec_ClaimedHTLCZ htlcs;
18844    /**
18845     * The sender-intended sum total of all the MPP parts. This will be `None` for events
18846     * serialized prior to LDK version 0.0.117.
18847     */
18848    struct LDKCOption_u64Z sender_intended_total_msat;
18849 } LDKEvent_LDKPaymentClaimed_Body;
18850
18851 typedef struct LDKEvent_LDKConnectionNeeded_Body {
18852    /**
18853     * The node id for the node needing a connection.
18854     */
18855    struct LDKPublicKey node_id;
18856    /**
18857     * Sockets for connecting to the node.
18858     */
18859    struct LDKCVec_SocketAddressZ addresses;
18860 } LDKEvent_LDKConnectionNeeded_Body;
18861
18862 typedef struct LDKEvent_LDKInvoiceRequestFailed_Body {
18863    /**
18864     * The `payment_id` to have been associated with payment for the requested invoice.
18865     */
18866    struct LDKThirtyTwoBytes payment_id;
18867 } LDKEvent_LDKInvoiceRequestFailed_Body;
18868
18869 typedef struct LDKEvent_LDKPaymentSent_Body {
18870    /**
18871     * The `payment_id` passed to [`ChannelManager::send_payment`].
18872     *
18873     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18874     */
18875    struct LDKCOption_ThirtyTwoBytesZ payment_id;
18876    /**
18877     * The preimage to the hash given to ChannelManager::send_payment.
18878     * Note that this serves as a payment receipt, if you wish to have such a thing, you must
18879     * store it somehow!
18880     */
18881    struct LDKThirtyTwoBytes payment_preimage;
18882    /**
18883     * The hash that was given to [`ChannelManager::send_payment`].
18884     *
18885     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18886     */
18887    struct LDKThirtyTwoBytes payment_hash;
18888    /**
18889     * The total fee which was spent at intermediate hops in this payment, across all paths.
18890     *
18891     * Note that, like [`Route::get_total_fees`] this does *not* include any potential
18892     * overpayment to the recipient node.
18893     *
18894     * If the recipient or an intermediate node misbehaves and gives us free money, this may
18895     * overstate the amount paid, though this is unlikely.
18896     *
18897     * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
18898     */
18899    struct LDKCOption_u64Z fee_paid_msat;
18900 } LDKEvent_LDKPaymentSent_Body;
18901
18902 typedef struct LDKEvent_LDKPaymentFailed_Body {
18903    /**
18904     * The `payment_id` passed to [`ChannelManager::send_payment`].
18905     *
18906     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18907     */
18908    struct LDKThirtyTwoBytes payment_id;
18909    /**
18910     * The hash that was given to [`ChannelManager::send_payment`].
18911     *
18912     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18913     */
18914    struct LDKThirtyTwoBytes payment_hash;
18915    /**
18916     * The reason the payment failed. This is only `None` for events generated or serialized
18917     * by versions prior to 0.0.115.
18918     */
18919    struct LDKCOption_PaymentFailureReasonZ reason;
18920 } LDKEvent_LDKPaymentFailed_Body;
18921
18922 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
18923    /**
18924     * The `payment_id` passed to [`ChannelManager::send_payment`].
18925     *
18926     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18927     */
18928    struct LDKThirtyTwoBytes payment_id;
18929    /**
18930     * The hash that was given to [`ChannelManager::send_payment`].
18931     *
18932     * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
18933     *
18934     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18935     */
18936    struct LDKCOption_ThirtyTwoBytesZ payment_hash;
18937    /**
18938     * The payment path that was successful.
18939     *
18940     * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
18941     */
18942    struct LDKPath path;
18943 } LDKEvent_LDKPaymentPathSuccessful_Body;
18944
18945 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
18946    /**
18947     * The `payment_id` passed to [`ChannelManager::send_payment`].
18948     *
18949     * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
18950     *
18951     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18952     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18953     */
18954    struct LDKCOption_ThirtyTwoBytesZ payment_id;
18955    /**
18956     * The hash that was given to [`ChannelManager::send_payment`].
18957     *
18958     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18959     */
18960    struct LDKThirtyTwoBytes payment_hash;
18961    /**
18962     * Indicates the payment was rejected for some reason by the recipient. This implies that
18963     * the payment has failed, not just the route in question. If this is not set, the payment may
18964     * be retried via a different route.
18965     */
18966    bool payment_failed_permanently;
18967    /**
18968     * Extra error details based on the failure type. May contain an update that needs to be
18969     * applied to the [`NetworkGraph`].
18970     *
18971     * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
18972     */
18973    struct LDKPathFailure failure;
18974    /**
18975     * The payment path that failed.
18976     */
18977    struct LDKPath path;
18978    /**
18979     * The channel responsible for the failed payment path.
18980     *
18981     * Note that for route hints or for the first hop in a path this may be an SCID alias and
18982     * may not refer to a channel in the public network graph. These aliases may also collide
18983     * with channels in the public network graph.
18984     *
18985     * If this is `Some`, then the corresponding channel should be avoided when the payment is
18986     * retried. May be `None` for older [`Event`] serializations.
18987     */
18988    struct LDKCOption_u64Z short_channel_id;
18989 } LDKEvent_LDKPaymentPathFailed_Body;
18990
18991 typedef struct LDKEvent_LDKProbeSuccessful_Body {
18992    /**
18993     * The id returned by [`ChannelManager::send_probe`].
18994     *
18995     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
18996     */
18997    struct LDKThirtyTwoBytes payment_id;
18998    /**
18999     * The hash generated by [`ChannelManager::send_probe`].
19000     *
19001     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
19002     */
19003    struct LDKThirtyTwoBytes payment_hash;
19004    /**
19005     * The payment path that was successful.
19006     */
19007    struct LDKPath path;
19008 } LDKEvent_LDKProbeSuccessful_Body;
19009
19010 typedef struct LDKEvent_LDKProbeFailed_Body {
19011    /**
19012     * The id returned by [`ChannelManager::send_probe`].
19013     *
19014     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
19015     */
19016    struct LDKThirtyTwoBytes payment_id;
19017    /**
19018     * The hash generated by [`ChannelManager::send_probe`].
19019     *
19020     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
19021     */
19022    struct LDKThirtyTwoBytes payment_hash;
19023    /**
19024     * The payment path that failed.
19025     */
19026    struct LDKPath path;
19027    /**
19028     * The channel responsible for the failed probe.
19029     *
19030     * Note that for route hints or for the first hop in a path this may be an SCID alias and
19031     * may not refer to a channel in the public network graph. These aliases may also collide
19032     * with channels in the public network graph.
19033     */
19034    struct LDKCOption_u64Z short_channel_id;
19035 } LDKEvent_LDKProbeFailed_Body;
19036
19037 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
19038    /**
19039     * The minimum amount of time that should be waited prior to calling
19040     * process_pending_htlc_forwards. To increase the effort required to correlate payments,
19041     * you should wait a random amount of time in roughly the range (now + time_forwardable,
19042     * now + 5*time_forwardable).
19043     */
19044    uint64_t time_forwardable;
19045 } LDKEvent_LDKPendingHTLCsForwardable_Body;
19046
19047 typedef struct LDKEvent_LDKHTLCIntercepted_Body {
19048    /**
19049     * An id to help LDK identify which HTLC is being forwarded or failed.
19050     */
19051    struct LDKThirtyTwoBytes intercept_id;
19052    /**
19053     * The fake scid that was programmed as the next hop's scid, generated using
19054     * [`ChannelManager::get_intercept_scid`].
19055     *
19056     * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
19057     */
19058    uint64_t requested_next_hop_scid;
19059    /**
19060     * The payment hash used for this HTLC.
19061     */
19062    struct LDKThirtyTwoBytes payment_hash;
19063    /**
19064     * How many msats were received on the inbound edge of this HTLC.
19065     */
19066    uint64_t inbound_amount_msat;
19067    /**
19068     * How many msats the payer intended to route to the next node. Depending on the reason you are
19069     * intercepting this payment, you might take a fee by forwarding less than this amount.
19070     * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
19071     *
19072     * Note that LDK will NOT check that expected fees were factored into this value. You MUST
19073     * check that whatever fee you want has been included here or subtract it as required. Further,
19074     * LDK will not stop you from forwarding more than you received.
19075     */
19076    uint64_t expected_outbound_amount_msat;
19077 } LDKEvent_LDKHTLCIntercepted_Body;
19078
19079 typedef struct LDKEvent_LDKSpendableOutputs_Body {
19080    /**
19081     * The outputs which you should store as spendable by you.
19082     */
19083    struct LDKCVec_SpendableOutputDescriptorZ outputs;
19084    /**
19085     * The `channel_id` indicating which channel the spendable outputs belong to.
19086     *
19087     * This will always be `Some` for events generated by LDK versions 0.0.117 and above.
19088     *
19089     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19090     */
19091    struct LDKChannelId channel_id;
19092 } LDKEvent_LDKSpendableOutputs_Body;
19093
19094 typedef struct LDKEvent_LDKPaymentForwarded_Body {
19095    /**
19096     * The channel id of the incoming channel between the previous node and us.
19097     *
19098     * This is only `None` for events generated or serialized by versions prior to 0.0.107.
19099     *
19100     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19101     */
19102    struct LDKChannelId prev_channel_id;
19103    /**
19104     * The channel id of the outgoing channel between the next node and us.
19105     *
19106     * This is only `None` for events generated or serialized by versions prior to 0.0.107.
19107     *
19108     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19109     */
19110    struct LDKChannelId next_channel_id;
19111    /**
19112     * The `user_channel_id` of the incoming channel between the previous node and us.
19113     *
19114     * This is only `None` for events generated or serialized by versions prior to 0.0.122.
19115     */
19116    struct LDKCOption_U128Z prev_user_channel_id;
19117    /**
19118     * The `user_channel_id` of the outgoing channel between the next node and us.
19119     *
19120     * This will be `None` if the payment was settled via an on-chain transaction. See the
19121     * caveat described for the `total_fee_earned_msat` field. Moreover it will be `None` for
19122     * events generated or serialized by versions prior to 0.0.122.
19123     */
19124    struct LDKCOption_U128Z next_user_channel_id;
19125    /**
19126     * The total fee, in milli-satoshis, which was earned as a result of the payment.
19127     *
19128     * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
19129     * was pending, the amount the next hop claimed will have been rounded down to the nearest
19130     * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
19131     * claimed the full value in millisatoshis from the source. In this case,
19132     * `claim_from_onchain_tx` will be set.
19133     *
19134     * If the channel which sent us the payment has been force-closed, we will claim the funds
19135     * via an on-chain transaction. In that case we do not yet know the on-chain transaction
19136     * fees which we will spend and will instead set this to `None`. It is possible duplicate
19137     * `PaymentForwarded` events are generated for the same payment iff `total_fee_earned_msat` is
19138     * `None`.
19139     */
19140    struct LDKCOption_u64Z total_fee_earned_msat;
19141    /**
19142     * The share of the total fee, in milli-satoshis, which was withheld in addition to the
19143     * forwarding fee.
19144     *
19145     * This will only be `Some` if we forwarded an intercepted HTLC with less than the
19146     * expected amount. This means our counterparty accepted to receive less than the invoice
19147     * amount, e.g., by claiming the payment featuring a corresponding
19148     * [`PaymentClaimable::counterparty_skimmed_fee_msat`].
19149     *
19150     * Will also always be `None` for events serialized with LDK prior to version 0.0.122.
19151     *
19152     * The caveat described above the `total_fee_earned_msat` field applies here as well.
19153     *
19154     * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: Self::PaymentClaimable::counterparty_skimmed_fee_msat
19155     */
19156    struct LDKCOption_u64Z skimmed_fee_msat;
19157    /**
19158     * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
19159     * transaction.
19160     */
19161    bool claim_from_onchain_tx;
19162    /**
19163     * The final amount forwarded, in milli-satoshis, after the fee is deducted.
19164     *
19165     * The caveat described above the `total_fee_earned_msat` field applies here as well.
19166     */
19167    struct LDKCOption_u64Z outbound_amount_forwarded_msat;
19168 } LDKEvent_LDKPaymentForwarded_Body;
19169
19170 typedef struct LDKEvent_LDKChannelPending_Body {
19171    /**
19172     * The `channel_id` of the channel that is pending confirmation.
19173     */
19174    struct LDKChannelId channel_id;
19175    /**
19176     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
19177     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
19178     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
19179     * `user_channel_id` will be randomized for an inbound channel.
19180     *
19181     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
19182     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
19183     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
19184     */
19185    struct LDKU128 user_channel_id;
19186    /**
19187     * The `temporary_channel_id` this channel used to be known by during channel establishment.
19188     *
19189     * Will be `None` for channels created prior to LDK version 0.0.115.
19190     *
19191     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19192     */
19193    struct LDKChannelId former_temporary_channel_id;
19194    /**
19195     * The `node_id` of the channel counterparty.
19196     */
19197    struct LDKPublicKey counterparty_node_id;
19198    /**
19199     * The outpoint of the channel's funding transaction.
19200     */
19201    struct LDKOutPoint funding_txo;
19202    /**
19203     * The features that this channel will operate with.
19204     *
19205     * Will be `None` for channels created prior to LDK version 0.0.122.
19206     *
19207     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19208     */
19209    struct LDKChannelTypeFeatures channel_type;
19210 } LDKEvent_LDKChannelPending_Body;
19211
19212 typedef struct LDKEvent_LDKChannelReady_Body {
19213    /**
19214     * The `channel_id` of the channel that is ready.
19215     */
19216    struct LDKChannelId channel_id;
19217    /**
19218     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
19219     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
19220     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
19221     * `user_channel_id` will be randomized for an inbound channel.
19222     *
19223     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
19224     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
19225     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
19226     */
19227    struct LDKU128 user_channel_id;
19228    /**
19229     * The `node_id` of the channel counterparty.
19230     */
19231    struct LDKPublicKey counterparty_node_id;
19232    /**
19233     * The features that this channel will operate with.
19234     */
19235    struct LDKChannelTypeFeatures channel_type;
19236 } LDKEvent_LDKChannelReady_Body;
19237
19238 typedef struct LDKEvent_LDKChannelClosed_Body {
19239    /**
19240     * The `channel_id` of the channel which has been closed. Note that on-chain transactions
19241     * resolving the channel are likely still awaiting confirmation.
19242     */
19243    struct LDKChannelId channel_id;
19244    /**
19245     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
19246     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
19247     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
19248     * `user_channel_id` will be randomized for inbound channels.
19249     * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
19250     * zero for objects serialized with LDK versions prior to 0.0.102.
19251     *
19252     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
19253     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
19254     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
19255     */
19256    struct LDKU128 user_channel_id;
19257    /**
19258     * The reason the channel was closed.
19259     */
19260    struct LDKClosureReason reason;
19261    /**
19262     * Counterparty in the closed channel.
19263     *
19264     * This field will be `None` for objects serialized prior to LDK 0.0.117.
19265     *
19266     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19267     */
19268    struct LDKPublicKey counterparty_node_id;
19269    /**
19270     * Channel capacity of the closing channel (sats).
19271     *
19272     * This field will be `None` for objects serialized prior to LDK 0.0.117.
19273     */
19274    struct LDKCOption_u64Z channel_capacity_sats;
19275    /**
19276     * The original channel funding TXO; this helps checking for the existence and confirmation
19277     * status of the closing tx.
19278     * Note that for instances serialized in v0.0.119 or prior this will be missing (None).
19279     *
19280     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19281     */
19282    struct LDKOutPoint channel_funding_txo;
19283 } LDKEvent_LDKChannelClosed_Body;
19284
19285 typedef struct LDKEvent_LDKDiscardFunding_Body {
19286    /**
19287     * The channel_id of the channel which has been closed.
19288     */
19289    struct LDKChannelId channel_id;
19290    /**
19291     * The full transaction received from the user
19292     */
19293    struct LDKTransaction transaction;
19294 } LDKEvent_LDKDiscardFunding_Body;
19295
19296 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
19297    /**
19298     * The temporary channel ID of the channel requested to be opened.
19299     *
19300     * When responding to the request, the `temporary_channel_id` should be passed
19301     * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
19302     * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
19303     *
19304     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
19305     * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
19306     */
19307    struct LDKChannelId temporary_channel_id;
19308    /**
19309     * The node_id of the counterparty requesting to open the channel.
19310     *
19311     * When responding to the request, the `counterparty_node_id` should be passed
19312     * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
19313     * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
19314     * request.
19315     *
19316     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
19317     * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
19318     */
19319    struct LDKPublicKey counterparty_node_id;
19320    /**
19321     * The channel value of the requested channel.
19322     */
19323    uint64_t funding_satoshis;
19324    /**
19325     * Our starting balance in the channel if the request is accepted, in milli-satoshi.
19326     */
19327    uint64_t push_msat;
19328    /**
19329     * The features that this channel will operate with. If you reject the channel, a
19330     * well-behaved counterparty may automatically re-attempt the channel with a new set of
19331     * feature flags.
19332     *
19333     * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
19334     * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
19335     * 0.0.106.
19336     *
19337     * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
19338     * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
19339     * 0.0.107. Channels setting this type also need to get manually accepted via
19340     * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
19341     * or will be rejected otherwise.
19342     *
19343     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
19344     */
19345    struct LDKChannelTypeFeatures channel_type;
19346 } LDKEvent_LDKOpenChannelRequest_Body;
19347
19348 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
19349    /**
19350     * The channel over which the HTLC was received.
19351     */
19352    struct LDKChannelId prev_channel_id;
19353    /**
19354     * Destination of the HTLC that failed to be processed.
19355     */
19356    struct LDKHTLCDestination failed_next_destination;
19357 } LDKEvent_LDKHTLCHandlingFailed_Body;
19358
19359 typedef struct MUST_USE_STRUCT LDKEvent {
19360    LDKEvent_Tag tag;
19361    union {
19362       LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
19363       LDKEvent_LDKPaymentClaimable_Body payment_claimable;
19364       LDKEvent_LDKPaymentClaimed_Body payment_claimed;
19365       LDKEvent_LDKConnectionNeeded_Body connection_needed;
19366       LDKEvent_LDKInvoiceRequestFailed_Body invoice_request_failed;
19367       LDKEvent_LDKPaymentSent_Body payment_sent;
19368       LDKEvent_LDKPaymentFailed_Body payment_failed;
19369       LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
19370       LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
19371       LDKEvent_LDKProbeSuccessful_Body probe_successful;
19372       LDKEvent_LDKProbeFailed_Body probe_failed;
19373       LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
19374       LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
19375       LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
19376       LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
19377       LDKEvent_LDKChannelPending_Body channel_pending;
19378       LDKEvent_LDKChannelReady_Body channel_ready;
19379       LDKEvent_LDKChannelClosed_Body channel_closed;
19380       LDKEvent_LDKDiscardFunding_Body discard_funding;
19381       LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
19382       LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
19383       struct {
19384          struct LDKBumpTransactionEvent bump_transaction;
19385       };
19386    };
19387 } LDKEvent;
19388
19389 /**
19390  * An enum which can either contain a crate::lightning::events::Event or not
19391  */
19392 typedef enum LDKCOption_EventZ_Tag {
19393    /**
19394     * When we're in this state, this COption_EventZ contains a crate::lightning::events::Event
19395     */
19396    LDKCOption_EventZ_Some,
19397    /**
19398     * When we're in this state, this COption_EventZ contains nothing
19399     */
19400    LDKCOption_EventZ_None,
19401    /**
19402     * Must be last for serialization purposes
19403     */
19404    LDKCOption_EventZ_Sentinel,
19405 } LDKCOption_EventZ_Tag;
19406
19407 typedef struct LDKCOption_EventZ {
19408    LDKCOption_EventZ_Tag tag;
19409    union {
19410       struct {
19411          struct LDKEvent some;
19412       };
19413    };
19414 } LDKCOption_EventZ;
19415
19416 /**
19417  * The contents of CResult_COption_EventZDecodeErrorZ
19418  */
19419 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
19420    /**
19421     * A pointer to the contents in the success state.
19422     * Reading from this pointer when `result_ok` is not set is undefined.
19423     */
19424    struct LDKCOption_EventZ *result;
19425    /**
19426     * A pointer to the contents in the error state.
19427     * Reading from this pointer when `result_ok` is set is undefined.
19428     */
19429    struct LDKDecodeError *err;
19430 } LDKCResult_COption_EventZDecodeErrorZPtr;
19431
19432 /**
19433  * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
19434  * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
19435  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19436  */
19437 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
19438    /**
19439     * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
19440     * `err` or `result` depending on the state of `result_ok`.
19441     */
19442    union LDKCResult_COption_EventZDecodeErrorZPtr contents;
19443    /**
19444     * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
19445     */
19446    bool result_ok;
19447 } LDKCResult_COption_EventZDecodeErrorZ;
19448
19449 /**
19450  * Sub-errors which don't have specific information in them use this type.
19451  */
19452 typedef struct LDKError {
19453    /**
19454     * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
19455     */
19456    uint8_t _dummy;
19457 } LDKError;
19458
19459 /**
19460  * Errors that indicate what is wrong with the invoice. They have some granularity for debug
19461  * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
19462  */
19463 typedef enum LDKBolt11ParseError_Tag {
19464    LDKBolt11ParseError_Bech32Error,
19465    LDKBolt11ParseError_ParseAmountError,
19466    LDKBolt11ParseError_MalformedSignature,
19467    LDKBolt11ParseError_BadPrefix,
19468    LDKBolt11ParseError_UnknownCurrency,
19469    LDKBolt11ParseError_UnknownSiPrefix,
19470    LDKBolt11ParseError_MalformedHRP,
19471    LDKBolt11ParseError_TooShortDataPart,
19472    LDKBolt11ParseError_UnexpectedEndOfTaggedFields,
19473    LDKBolt11ParseError_DescriptionDecodeError,
19474    LDKBolt11ParseError_PaddingError,
19475    LDKBolt11ParseError_IntegerOverflowError,
19476    LDKBolt11ParseError_InvalidSegWitProgramLength,
19477    LDKBolt11ParseError_InvalidPubKeyHashLength,
19478    LDKBolt11ParseError_InvalidScriptHashLength,
19479    LDKBolt11ParseError_InvalidRecoveryId,
19480    LDKBolt11ParseError_InvalidSliceLength,
19481    /**
19482     * Not an error, but used internally to signal that a part of the invoice should be ignored
19483     * according to BOLT11
19484     */
19485    LDKBolt11ParseError_Skip,
19486    /**
19487     * Must be last for serialization purposes
19488     */
19489    LDKBolt11ParseError_Sentinel,
19490 } LDKBolt11ParseError_Tag;
19491
19492 typedef struct MUST_USE_STRUCT LDKBolt11ParseError {
19493    LDKBolt11ParseError_Tag tag;
19494    union {
19495       struct {
19496          struct LDKBech32Error bech32_error;
19497       };
19498       struct {
19499          struct LDKError parse_amount_error;
19500       };
19501       struct {
19502          enum LDKSecp256k1Error malformed_signature;
19503       };
19504       struct {
19505          struct LDKError description_decode_error;
19506       };
19507       struct {
19508          struct LDKStr invalid_slice_length;
19509       };
19510    };
19511 } LDKBolt11ParseError;
19512
19513 /**
19514  * The contents of CResult_SiPrefixBolt11ParseErrorZ
19515  */
19516 typedef union LDKCResult_SiPrefixBolt11ParseErrorZPtr {
19517    /**
19518     * A pointer to the contents in the success state.
19519     * Reading from this pointer when `result_ok` is not set is undefined.
19520     */
19521    enum LDKSiPrefix *result;
19522    /**
19523     * A pointer to the contents in the error state.
19524     * Reading from this pointer when `result_ok` is set is undefined.
19525     */
19526    struct LDKBolt11ParseError *err;
19527 } LDKCResult_SiPrefixBolt11ParseErrorZPtr;
19528
19529 /**
19530  * A CResult_SiPrefixBolt11ParseErrorZ represents the result of a fallible operation,
19531  * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::Bolt11ParseError on failure.
19532  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19533  */
19534 typedef struct LDKCResult_SiPrefixBolt11ParseErrorZ {
19535    /**
19536     * The contents of this CResult_SiPrefixBolt11ParseErrorZ, accessible via either
19537     * `err` or `result` depending on the state of `result_ok`.
19538     */
19539    union LDKCResult_SiPrefixBolt11ParseErrorZPtr contents;
19540    /**
19541     * Whether this CResult_SiPrefixBolt11ParseErrorZ represents a success state.
19542     */
19543    bool result_ok;
19544 } LDKCResult_SiPrefixBolt11ParseErrorZ;
19545
19546 /**
19547  * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
19548  * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
19549  * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
19550  */
19551 typedef enum LDKParseOrSemanticError_Tag {
19552    /**
19553     * The invoice couldn't be decoded
19554     */
19555    LDKParseOrSemanticError_ParseError,
19556    /**
19557     * The invoice could be decoded but violates the BOLT11 standard
19558     */
19559    LDKParseOrSemanticError_SemanticError,
19560    /**
19561     * Must be last for serialization purposes
19562     */
19563    LDKParseOrSemanticError_Sentinel,
19564 } LDKParseOrSemanticError_Tag;
19565
19566 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
19567    LDKParseOrSemanticError_Tag tag;
19568    union {
19569       struct {
19570          struct LDKBolt11ParseError parse_error;
19571       };
19572       struct {
19573          enum LDKBolt11SemanticError semantic_error;
19574       };
19575    };
19576 } LDKParseOrSemanticError;
19577
19578 /**
19579  * The contents of CResult_Bolt11InvoiceParseOrSemanticErrorZ
19580  */
19581 typedef union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr {
19582    /**
19583     * A pointer to the contents in the success state.
19584     * Reading from this pointer when `result_ok` is not set is undefined.
19585     */
19586    struct LDKBolt11Invoice *result;
19587    /**
19588     * A pointer to the contents in the error state.
19589     * Reading from this pointer when `result_ok` is set is undefined.
19590     */
19591    struct LDKParseOrSemanticError *err;
19592 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr;
19593
19594 /**
19595  * A CResult_Bolt11InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
19596  * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
19597  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19598  */
19599 typedef struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ {
19600    /**
19601     * The contents of this CResult_Bolt11InvoiceParseOrSemanticErrorZ, accessible via either
19602     * `err` or `result` depending on the state of `result_ok`.
19603     */
19604    union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr contents;
19605    /**
19606     * Whether this CResult_Bolt11InvoiceParseOrSemanticErrorZ represents a success state.
19607     */
19608    bool result_ok;
19609 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ;
19610
19611
19612
19613 /**
19614  * Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be
19615  * invalid.
19616  *
19617  * # Invariants
19618  * The hash has to be either from the deserialized invoice or from the serialized [`RawBolt11Invoice`].
19619  */
19620 typedef struct MUST_USE_STRUCT LDKSignedRawBolt11Invoice {
19621    /**
19622     * A pointer to the opaque Rust object.
19623     * Nearly everywhere, inner must be non-null, however in places where
19624     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19625     */
19626    LDKnativeSignedRawBolt11Invoice *inner;
19627    /**
19628     * Indicates that this is the only struct which contains the same pointer.
19629     * Rust functions which take ownership of an object provided via an argument require
19630     * this to be true and invalidate the object pointed to by inner.
19631     */
19632    bool is_owned;
19633 } LDKSignedRawBolt11Invoice;
19634
19635 /**
19636  * The contents of CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ
19637  */
19638 typedef union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr {
19639    /**
19640     * A pointer to the contents in the success state.
19641     * Reading from this pointer when `result_ok` is not set is undefined.
19642     */
19643    struct LDKSignedRawBolt11Invoice *result;
19644    /**
19645     * A pointer to the contents in the error state.
19646     * Reading from this pointer when `result_ok` is set is undefined.
19647     */
19648    struct LDKBolt11ParseError *err;
19649 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr;
19650
19651 /**
19652  * A CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents the result of a fallible operation,
19653  * containing a crate::lightning_invoice::SignedRawBolt11Invoice on success and a crate::lightning_invoice::Bolt11ParseError on failure.
19654  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19655  */
19656 typedef struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ {
19657    /**
19658     * The contents of this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ, accessible via either
19659     * `err` or `result` depending on the state of `result_ok`.
19660     */
19661    union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr contents;
19662    /**
19663     * Whether this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents a success state.
19664     */
19665    bool result_ok;
19666 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ;
19667
19668
19669
19670 /**
19671  * Represents an syntactically correct [`Bolt11Invoice`] for a payment on the lightning network,
19672  * but without the signature information.
19673  * Decoding and encoding should not lead to information loss but may lead to different hashes.
19674  *
19675  * For methods without docs see the corresponding methods in [`Bolt11Invoice`].
19676  */
19677 typedef struct MUST_USE_STRUCT LDKRawBolt11Invoice {
19678    /**
19679     * A pointer to the opaque Rust object.
19680     * Nearly everywhere, inner must be non-null, however in places where
19681     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19682     */
19683    LDKnativeRawBolt11Invoice *inner;
19684    /**
19685     * Indicates that this is the only struct which contains the same pointer.
19686     * Rust functions which take ownership of an object provided via an argument require
19687     * this to be true and invalidate the object pointed to by inner.
19688     */
19689    bool is_owned;
19690 } LDKRawBolt11Invoice;
19691
19692
19693
19694 /**
19695  * Recoverable signature
19696  */
19697 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceSignature {
19698    /**
19699     * A pointer to the opaque Rust object.
19700     * Nearly everywhere, inner must be non-null, however in places where
19701     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19702     */
19703    LDKnativeBolt11InvoiceSignature *inner;
19704    /**
19705     * Indicates that this is the only struct which contains the same pointer.
19706     * Rust functions which take ownership of an object provided via an argument require
19707     * this to be true and invalidate the object pointed to by inner.
19708     */
19709    bool is_owned;
19710 } LDKBolt11InvoiceSignature;
19711
19712 /**
19713  * A tuple of 3 elements. See the individual fields for the types contained.
19714  */
19715 typedef struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ {
19716    /**
19717     * The element at position 0
19718     */
19719    struct LDKRawBolt11Invoice a;
19720    /**
19721     * The element at position 1
19722     */
19723    struct LDKThirtyTwoBytes b;
19724    /**
19725     * The element at position 2
19726     */
19727    struct LDKBolt11InvoiceSignature c;
19728 } LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ;
19729
19730
19731
19732 /**
19733  * Payee public key
19734  */
19735 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
19736    /**
19737     * A pointer to the opaque Rust object.
19738     * Nearly everywhere, inner must be non-null, however in places where
19739     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19740     */
19741    LDKnativePayeePubKey *inner;
19742    /**
19743     * Indicates that this is the only struct which contains the same pointer.
19744     * Rust functions which take ownership of an object provided via an argument require
19745     * this to be true and invalidate the object pointed to by inner.
19746     */
19747    bool is_owned;
19748 } LDKPayeePubKey;
19749
19750 /**
19751  * The contents of CResult_PayeePubKeySecp256k1ErrorZ
19752  */
19753 typedef union LDKCResult_PayeePubKeySecp256k1ErrorZPtr {
19754    /**
19755     * A pointer to the contents in the success state.
19756     * Reading from this pointer when `result_ok` is not set is undefined.
19757     */
19758    struct LDKPayeePubKey *result;
19759    /**
19760     * A pointer to the contents in the error state.
19761     * Reading from this pointer when `result_ok` is set is undefined.
19762     */
19763    enum LDKSecp256k1Error *err;
19764 } LDKCResult_PayeePubKeySecp256k1ErrorZPtr;
19765
19766 /**
19767  * A CResult_PayeePubKeySecp256k1ErrorZ represents the result of a fallible operation,
19768  * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
19769  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19770  */
19771 typedef struct LDKCResult_PayeePubKeySecp256k1ErrorZ {
19772    /**
19773     * The contents of this CResult_PayeePubKeySecp256k1ErrorZ, accessible via either
19774     * `err` or `result` depending on the state of `result_ok`.
19775     */
19776    union LDKCResult_PayeePubKeySecp256k1ErrorZPtr contents;
19777    /**
19778     * Whether this CResult_PayeePubKeySecp256k1ErrorZ represents a success state.
19779     */
19780    bool result_ok;
19781 } LDKCResult_PayeePubKeySecp256k1ErrorZ;
19782
19783
19784
19785 /**
19786  * Private routing information
19787  *
19788  * # Invariants
19789  * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
19790  *
19791  */
19792 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
19793    /**
19794     * A pointer to the opaque Rust object.
19795     * Nearly everywhere, inner must be non-null, however in places where
19796     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19797     */
19798    LDKnativePrivateRoute *inner;
19799    /**
19800     * Indicates that this is the only struct which contains the same pointer.
19801     * Rust functions which take ownership of an object provided via an argument require
19802     * this to be true and invalidate the object pointed to by inner.
19803     */
19804    bool is_owned;
19805 } LDKPrivateRoute;
19806
19807 /**
19808  * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
19809  * This corresponds to std::vector in C++
19810  */
19811 typedef struct LDKCVec_PrivateRouteZ {
19812    /**
19813     * The elements in the array.
19814     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
19815     */
19816    struct LDKPrivateRoute *data;
19817    /**
19818     * The number of elements pointed to by `data`.
19819     */
19820    uintptr_t datalen;
19821 } LDKCVec_PrivateRouteZ;
19822
19823
19824
19825 /**
19826  * A timestamp that refers to a date after 1 January 1970.
19827  *
19828  * # Invariants
19829  *
19830  * The Unix timestamp representing the stored time has to be positive and no greater than
19831  * [`MAX_TIMESTAMP`].
19832  */
19833 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
19834    /**
19835     * A pointer to the opaque Rust object.
19836     * Nearly everywhere, inner must be non-null, however in places where
19837     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19838     */
19839    LDKnativePositiveTimestamp *inner;
19840    /**
19841     * Indicates that this is the only struct which contains the same pointer.
19842     * Rust functions which take ownership of an object provided via an argument require
19843     * this to be true and invalidate the object pointed to by inner.
19844     */
19845    bool is_owned;
19846 } LDKPositiveTimestamp;
19847
19848 /**
19849  * The contents of CResult_PositiveTimestampCreationErrorZ
19850  */
19851 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
19852    /**
19853     * A pointer to the contents in the success state.
19854     * Reading from this pointer when `result_ok` is not set is undefined.
19855     */
19856    struct LDKPositiveTimestamp *result;
19857    /**
19858     * A pointer to the contents in the error state.
19859     * Reading from this pointer when `result_ok` is set is undefined.
19860     */
19861    enum LDKCreationError *err;
19862 } LDKCResult_PositiveTimestampCreationErrorZPtr;
19863
19864 /**
19865  * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
19866  * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
19867  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19868  */
19869 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
19870    /**
19871     * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
19872     * `err` or `result` depending on the state of `result_ok`.
19873     */
19874    union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
19875    /**
19876     * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
19877     */
19878    bool result_ok;
19879 } LDKCResult_PositiveTimestampCreationErrorZ;
19880
19881 /**
19882  * The contents of CResult_NoneBolt11SemanticErrorZ
19883  */
19884 typedef union LDKCResult_NoneBolt11SemanticErrorZPtr {
19885    /**
19886     * Note that this value is always NULL, as there are no contents in the OK variant
19887     */
19888    void *result;
19889    /**
19890     * A pointer to the contents in the error state.
19891     * Reading from this pointer when `result_ok` is set is undefined.
19892     */
19893    enum LDKBolt11SemanticError *err;
19894 } LDKCResult_NoneBolt11SemanticErrorZPtr;
19895
19896 /**
19897  * A CResult_NoneBolt11SemanticErrorZ represents the result of a fallible operation,
19898  * containing a () on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
19899  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19900  */
19901 typedef struct LDKCResult_NoneBolt11SemanticErrorZ {
19902    /**
19903     * The contents of this CResult_NoneBolt11SemanticErrorZ, accessible via either
19904     * `err` or `result` depending on the state of `result_ok`.
19905     */
19906    union LDKCResult_NoneBolt11SemanticErrorZPtr contents;
19907    /**
19908     * Whether this CResult_NoneBolt11SemanticErrorZ represents a success state.
19909     */
19910    bool result_ok;
19911 } LDKCResult_NoneBolt11SemanticErrorZ;
19912
19913 /**
19914  * The contents of CResult_Bolt11InvoiceBolt11SemanticErrorZ
19915  */
19916 typedef union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr {
19917    /**
19918     * A pointer to the contents in the success state.
19919     * Reading from this pointer when `result_ok` is not set is undefined.
19920     */
19921    struct LDKBolt11Invoice *result;
19922    /**
19923     * A pointer to the contents in the error state.
19924     * Reading from this pointer when `result_ok` is set is undefined.
19925     */
19926    enum LDKBolt11SemanticError *err;
19927 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr;
19928
19929 /**
19930  * A CResult_Bolt11InvoiceBolt11SemanticErrorZ represents the result of a fallible operation,
19931  * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
19932  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19933  */
19934 typedef struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ {
19935    /**
19936     * The contents of this CResult_Bolt11InvoiceBolt11SemanticErrorZ, accessible via either
19937     * `err` or `result` depending on the state of `result_ok`.
19938     */
19939    union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr contents;
19940    /**
19941     * Whether this CResult_Bolt11InvoiceBolt11SemanticErrorZ represents a success state.
19942     */
19943    bool result_ok;
19944 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ;
19945
19946
19947
19948 /**
19949  * Description string
19950  *
19951  * # Invariants
19952  * The description can be at most 639 __bytes__ long
19953  */
19954 typedef struct MUST_USE_STRUCT LDKDescription {
19955    /**
19956     * A pointer to the opaque Rust object.
19957     * Nearly everywhere, inner must be non-null, however in places where
19958     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19959     */
19960    LDKnativeDescription *inner;
19961    /**
19962     * Indicates that this is the only struct which contains the same pointer.
19963     * Rust functions which take ownership of an object provided via an argument require
19964     * this to be true and invalidate the object pointed to by inner.
19965     */
19966    bool is_owned;
19967 } LDKDescription;
19968
19969 /**
19970  * The contents of CResult_DescriptionCreationErrorZ
19971  */
19972 typedef union LDKCResult_DescriptionCreationErrorZPtr {
19973    /**
19974     * A pointer to the contents in the success state.
19975     * Reading from this pointer when `result_ok` is not set is undefined.
19976     */
19977    struct LDKDescription *result;
19978    /**
19979     * A pointer to the contents in the error state.
19980     * Reading from this pointer when `result_ok` is set is undefined.
19981     */
19982    enum LDKCreationError *err;
19983 } LDKCResult_DescriptionCreationErrorZPtr;
19984
19985 /**
19986  * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
19987  * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
19988  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19989  */
19990 typedef struct LDKCResult_DescriptionCreationErrorZ {
19991    /**
19992     * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
19993     * `err` or `result` depending on the state of `result_ok`.
19994     */
19995    union LDKCResult_DescriptionCreationErrorZPtr contents;
19996    /**
19997     * Whether this CResult_DescriptionCreationErrorZ represents a success state.
19998     */
19999    bool result_ok;
20000 } LDKCResult_DescriptionCreationErrorZ;
20001
20002 /**
20003  * The contents of CResult_PrivateRouteCreationErrorZ
20004  */
20005 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
20006    /**
20007     * A pointer to the contents in the success state.
20008     * Reading from this pointer when `result_ok` is not set is undefined.
20009     */
20010    struct LDKPrivateRoute *result;
20011    /**
20012     * A pointer to the contents in the error state.
20013     * Reading from this pointer when `result_ok` is set is undefined.
20014     */
20015    enum LDKCreationError *err;
20016 } LDKCResult_PrivateRouteCreationErrorZPtr;
20017
20018 /**
20019  * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
20020  * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
20021  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20022  */
20023 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
20024    /**
20025     * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
20026     * `err` or `result` depending on the state of `result_ok`.
20027     */
20028    union LDKCResult_PrivateRouteCreationErrorZPtr contents;
20029    /**
20030     * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
20031     */
20032    bool result_ok;
20033 } LDKCResult_PrivateRouteCreationErrorZ;
20034
20035 /**
20036  * The contents of CResult_OutPointDecodeErrorZ
20037  */
20038 typedef union LDKCResult_OutPointDecodeErrorZPtr {
20039    /**
20040     * A pointer to the contents in the success state.
20041     * Reading from this pointer when `result_ok` is not set is undefined.
20042     */
20043    struct LDKOutPoint *result;
20044    /**
20045     * A pointer to the contents in the error state.
20046     * Reading from this pointer when `result_ok` is set is undefined.
20047     */
20048    struct LDKDecodeError *err;
20049 } LDKCResult_OutPointDecodeErrorZPtr;
20050
20051 /**
20052  * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
20053  * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
20054  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20055  */
20056 typedef struct LDKCResult_OutPointDecodeErrorZ {
20057    /**
20058     * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
20059     * `err` or `result` depending on the state of `result_ok`.
20060     */
20061    union LDKCResult_OutPointDecodeErrorZPtr contents;
20062    /**
20063     * Whether this CResult_OutPointDecodeErrorZ represents a success state.
20064     */
20065    bool result_ok;
20066 } LDKCResult_OutPointDecodeErrorZ;
20067
20068
20069
20070 /**
20071  * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's
20072  * variable-length integers except that it is serialized in big-endian instead of little-endian.
20073  *
20074  * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
20075  * encoded in several different ways, which we must check for at deserialization-time. Thus, if
20076  * you're looking for an example of a variable-length integer to use for your own project, move
20077  * along, this is a rather poor design.
20078  */
20079 typedef struct MUST_USE_STRUCT LDKBigSize {
20080    /**
20081     * A pointer to the opaque Rust object.
20082     * Nearly everywhere, inner must be non-null, however in places where
20083     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20084     */
20085    LDKnativeBigSize *inner;
20086    /**
20087     * Indicates that this is the only struct which contains the same pointer.
20088     * Rust functions which take ownership of an object provided via an argument require
20089     * this to be true and invalidate the object pointed to by inner.
20090     */
20091    bool is_owned;
20092 } LDKBigSize;
20093
20094 /**
20095  * The contents of CResult_BigSizeDecodeErrorZ
20096  */
20097 typedef union LDKCResult_BigSizeDecodeErrorZPtr {
20098    /**
20099     * A pointer to the contents in the success state.
20100     * Reading from this pointer when `result_ok` is not set is undefined.
20101     */
20102    struct LDKBigSize *result;
20103    /**
20104     * A pointer to the contents in the error state.
20105     * Reading from this pointer when `result_ok` is set is undefined.
20106     */
20107    struct LDKDecodeError *err;
20108 } LDKCResult_BigSizeDecodeErrorZPtr;
20109
20110 /**
20111  * A CResult_BigSizeDecodeErrorZ represents the result of a fallible operation,
20112  * containing a crate::lightning::util::ser::BigSize on success and a crate::lightning::ln::msgs::DecodeError on failure.
20113  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20114  */
20115 typedef struct LDKCResult_BigSizeDecodeErrorZ {
20116    /**
20117     * The contents of this CResult_BigSizeDecodeErrorZ, accessible via either
20118     * `err` or `result` depending on the state of `result_ok`.
20119     */
20120    union LDKCResult_BigSizeDecodeErrorZPtr contents;
20121    /**
20122     * Whether this CResult_BigSizeDecodeErrorZ represents a success state.
20123     */
20124    bool result_ok;
20125 } LDKCResult_BigSizeDecodeErrorZ;
20126
20127 /**
20128  * The contents of CResult_HostnameDecodeErrorZ
20129  */
20130 typedef union LDKCResult_HostnameDecodeErrorZPtr {
20131    /**
20132     * A pointer to the contents in the success state.
20133     * Reading from this pointer when `result_ok` is not set is undefined.
20134     */
20135    struct LDKHostname *result;
20136    /**
20137     * A pointer to the contents in the error state.
20138     * Reading from this pointer when `result_ok` is set is undefined.
20139     */
20140    struct LDKDecodeError *err;
20141 } LDKCResult_HostnameDecodeErrorZPtr;
20142
20143 /**
20144  * A CResult_HostnameDecodeErrorZ represents the result of a fallible operation,
20145  * containing a crate::lightning::util::ser::Hostname on success and a crate::lightning::ln::msgs::DecodeError on failure.
20146  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20147  */
20148 typedef struct LDKCResult_HostnameDecodeErrorZ {
20149    /**
20150     * The contents of this CResult_HostnameDecodeErrorZ, accessible via either
20151     * `err` or `result` depending on the state of `result_ok`.
20152     */
20153    union LDKCResult_HostnameDecodeErrorZPtr contents;
20154    /**
20155     * Whether this CResult_HostnameDecodeErrorZ represents a success state.
20156     */
20157    bool result_ok;
20158 } LDKCResult_HostnameDecodeErrorZ;
20159
20160
20161
20162 /**
20163  * A wrapper for a `Transaction` which can only be constructed with [`TransactionU16LenLimited::new`]
20164  * if the `Transaction`'s consensus-serialized length is <= u16::MAX.
20165  *
20166  * Use [`TransactionU16LenLimited::into_transaction`] to convert into the contained `Transaction`.
20167  */
20168 typedef struct MUST_USE_STRUCT LDKTransactionU16LenLimited {
20169    /**
20170     * A pointer to the opaque Rust object.
20171     * Nearly everywhere, inner must be non-null, however in places where
20172     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20173     */
20174    LDKnativeTransactionU16LenLimited *inner;
20175    /**
20176     * Indicates that this is the only struct which contains the same pointer.
20177     * Rust functions which take ownership of an object provided via an argument require
20178     * this to be true and invalidate the object pointed to by inner.
20179     */
20180    bool is_owned;
20181 } LDKTransactionU16LenLimited;
20182
20183 /**
20184  * The contents of CResult_TransactionU16LenLimitedNoneZ
20185  */
20186 typedef union LDKCResult_TransactionU16LenLimitedNoneZPtr {
20187    /**
20188     * A pointer to the contents in the success state.
20189     * Reading from this pointer when `result_ok` is not set is undefined.
20190     */
20191    struct LDKTransactionU16LenLimited *result;
20192    /**
20193     * Note that this value is always NULL, as there are no contents in the Err variant
20194     */
20195    void *err;
20196 } LDKCResult_TransactionU16LenLimitedNoneZPtr;
20197
20198 /**
20199  * A CResult_TransactionU16LenLimitedNoneZ represents the result of a fallible operation,
20200  * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a () on failure.
20201  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20202  */
20203 typedef struct LDKCResult_TransactionU16LenLimitedNoneZ {
20204    /**
20205     * The contents of this CResult_TransactionU16LenLimitedNoneZ, accessible via either
20206     * `err` or `result` depending on the state of `result_ok`.
20207     */
20208    union LDKCResult_TransactionU16LenLimitedNoneZPtr contents;
20209    /**
20210     * Whether this CResult_TransactionU16LenLimitedNoneZ represents a success state.
20211     */
20212    bool result_ok;
20213 } LDKCResult_TransactionU16LenLimitedNoneZ;
20214
20215 /**
20216  * The contents of CResult_TransactionU16LenLimitedDecodeErrorZ
20217  */
20218 typedef union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr {
20219    /**
20220     * A pointer to the contents in the success state.
20221     * Reading from this pointer when `result_ok` is not set is undefined.
20222     */
20223    struct LDKTransactionU16LenLimited *result;
20224    /**
20225     * A pointer to the contents in the error state.
20226     * Reading from this pointer when `result_ok` is set is undefined.
20227     */
20228    struct LDKDecodeError *err;
20229 } LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr;
20230
20231 /**
20232  * A CResult_TransactionU16LenLimitedDecodeErrorZ represents the result of a fallible operation,
20233  * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a crate::lightning::ln::msgs::DecodeError on failure.
20234  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20235  */
20236 typedef struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ {
20237    /**
20238     * The contents of this CResult_TransactionU16LenLimitedDecodeErrorZ, accessible via either
20239     * `err` or `result` depending on the state of `result_ok`.
20240     */
20241    union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr contents;
20242    /**
20243     * Whether this CResult_TransactionU16LenLimitedDecodeErrorZ represents a success state.
20244     */
20245    bool result_ok;
20246 } LDKCResult_TransactionU16LenLimitedDecodeErrorZ;
20247
20248 /**
20249  * The contents of CResult_UntrustedStringDecodeErrorZ
20250  */
20251 typedef union LDKCResult_UntrustedStringDecodeErrorZPtr {
20252    /**
20253     * A pointer to the contents in the success state.
20254     * Reading from this pointer when `result_ok` is not set is undefined.
20255     */
20256    struct LDKUntrustedString *result;
20257    /**
20258     * A pointer to the contents in the error state.
20259     * Reading from this pointer when `result_ok` is set is undefined.
20260     */
20261    struct LDKDecodeError *err;
20262 } LDKCResult_UntrustedStringDecodeErrorZPtr;
20263
20264 /**
20265  * A CResult_UntrustedStringDecodeErrorZ represents the result of a fallible operation,
20266  * containing a crate::lightning::util::string::UntrustedString on success and a crate::lightning::ln::msgs::DecodeError on failure.
20267  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20268  */
20269 typedef struct LDKCResult_UntrustedStringDecodeErrorZ {
20270    /**
20271     * The contents of this CResult_UntrustedStringDecodeErrorZ, accessible via either
20272     * `err` or `result` depending on the state of `result_ok`.
20273     */
20274    union LDKCResult_UntrustedStringDecodeErrorZPtr contents;
20275    /**
20276     * Whether this CResult_UntrustedStringDecodeErrorZ represents a success state.
20277     */
20278    bool result_ok;
20279 } LDKCResult_UntrustedStringDecodeErrorZ;
20280
20281 /**
20282  * The contents of CResult_ChannelIdDecodeErrorZ
20283  */
20284 typedef union LDKCResult_ChannelIdDecodeErrorZPtr {
20285    /**
20286     * A pointer to the contents in the success state.
20287     * Reading from this pointer when `result_ok` is not set is undefined.
20288     */
20289    struct LDKChannelId *result;
20290    /**
20291     * A pointer to the contents in the error state.
20292     * Reading from this pointer when `result_ok` is set is undefined.
20293     */
20294    struct LDKDecodeError *err;
20295 } LDKCResult_ChannelIdDecodeErrorZPtr;
20296
20297 /**
20298  * A CResult_ChannelIdDecodeErrorZ represents the result of a fallible operation,
20299  * containing a crate::lightning::ln::types::ChannelId on success and a crate::lightning::ln::msgs::DecodeError on failure.
20300  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20301  */
20302 typedef struct LDKCResult_ChannelIdDecodeErrorZ {
20303    /**
20304     * The contents of this CResult_ChannelIdDecodeErrorZ, accessible via either
20305     * `err` or `result` depending on the state of `result_ok`.
20306     */
20307    union LDKCResult_ChannelIdDecodeErrorZPtr contents;
20308    /**
20309     * Whether this CResult_ChannelIdDecodeErrorZ represents a success state.
20310     */
20311    bool result_ok;
20312 } LDKCResult_ChannelIdDecodeErrorZ;
20313
20314 /**
20315  * A tuple of 2 elements. See the individual fields for the types contained.
20316  */
20317 typedef struct LDKC2Tuple__u832u16Z {
20318    /**
20319     * The element at position 0
20320     */
20321    struct LDKThirtyTwoBytes a;
20322    /**
20323     * The element at position 1
20324     */
20325    uint16_t b;
20326 } LDKC2Tuple__u832u16Z;
20327
20328
20329
20330 /**
20331  * Parameters for relaying over a given [`BlindedHop`].
20332  *
20333  * [`BlindedHop`]: crate::blinded_path::BlindedHop
20334  */
20335 typedef struct MUST_USE_STRUCT LDKPaymentRelay {
20336    /**
20337     * A pointer to the opaque Rust object.
20338     * Nearly everywhere, inner must be non-null, however in places where
20339     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20340     */
20341    LDKnativePaymentRelay *inner;
20342    /**
20343     * Indicates that this is the only struct which contains the same pointer.
20344     * Rust functions which take ownership of an object provided via an argument require
20345     * this to be true and invalidate the object pointed to by inner.
20346     */
20347    bool is_owned;
20348 } LDKPaymentRelay;
20349
20350 /**
20351  * The contents of CResult_PaymentRelayDecodeErrorZ
20352  */
20353 typedef union LDKCResult_PaymentRelayDecodeErrorZPtr {
20354    /**
20355     * A pointer to the contents in the success state.
20356     * Reading from this pointer when `result_ok` is not set is undefined.
20357     */
20358    struct LDKPaymentRelay *result;
20359    /**
20360     * A pointer to the contents in the error state.
20361     * Reading from this pointer when `result_ok` is set is undefined.
20362     */
20363    struct LDKDecodeError *err;
20364 } LDKCResult_PaymentRelayDecodeErrorZPtr;
20365
20366 /**
20367  * A CResult_PaymentRelayDecodeErrorZ represents the result of a fallible operation,
20368  * containing a crate::lightning::blinded_path::payment::PaymentRelay on success and a crate::lightning::ln::msgs::DecodeError on failure.
20369  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20370  */
20371 typedef struct LDKCResult_PaymentRelayDecodeErrorZ {
20372    /**
20373     * The contents of this CResult_PaymentRelayDecodeErrorZ, accessible via either
20374     * `err` or `result` depending on the state of `result_ok`.
20375     */
20376    union LDKCResult_PaymentRelayDecodeErrorZPtr contents;
20377    /**
20378     * Whether this CResult_PaymentRelayDecodeErrorZ represents a success state.
20379     */
20380    bool result_ok;
20381 } LDKCResult_PaymentRelayDecodeErrorZ;
20382
20383
20384
20385 /**
20386  * Constraints for relaying over a given [`BlindedHop`].
20387  *
20388  * [`BlindedHop`]: crate::blinded_path::BlindedHop
20389  */
20390 typedef struct MUST_USE_STRUCT LDKPaymentConstraints {
20391    /**
20392     * A pointer to the opaque Rust object.
20393     * Nearly everywhere, inner must be non-null, however in places where
20394     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20395     */
20396    LDKnativePaymentConstraints *inner;
20397    /**
20398     * Indicates that this is the only struct which contains the same pointer.
20399     * Rust functions which take ownership of an object provided via an argument require
20400     * this to be true and invalidate the object pointed to by inner.
20401     */
20402    bool is_owned;
20403 } LDKPaymentConstraints;
20404
20405 /**
20406  * The contents of CResult_PaymentConstraintsDecodeErrorZ
20407  */
20408 typedef union LDKCResult_PaymentConstraintsDecodeErrorZPtr {
20409    /**
20410     * A pointer to the contents in the success state.
20411     * Reading from this pointer when `result_ok` is not set is undefined.
20412     */
20413    struct LDKPaymentConstraints *result;
20414    /**
20415     * A pointer to the contents in the error state.
20416     * Reading from this pointer when `result_ok` is set is undefined.
20417     */
20418    struct LDKDecodeError *err;
20419 } LDKCResult_PaymentConstraintsDecodeErrorZPtr;
20420
20421 /**
20422  * A CResult_PaymentConstraintsDecodeErrorZ represents the result of a fallible operation,
20423  * containing a crate::lightning::blinded_path::payment::PaymentConstraints on success and a crate::lightning::ln::msgs::DecodeError on failure.
20424  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20425  */
20426 typedef struct LDKCResult_PaymentConstraintsDecodeErrorZ {
20427    /**
20428     * The contents of this CResult_PaymentConstraintsDecodeErrorZ, accessible via either
20429     * `err` or `result` depending on the state of `result_ok`.
20430     */
20431    union LDKCResult_PaymentConstraintsDecodeErrorZPtr contents;
20432    /**
20433     * Whether this CResult_PaymentConstraintsDecodeErrorZ represents a success state.
20434     */
20435    bool result_ok;
20436 } LDKCResult_PaymentConstraintsDecodeErrorZ;
20437
20438 /**
20439  * The contents of CResult_PaymentContextDecodeErrorZ
20440  */
20441 typedef union LDKCResult_PaymentContextDecodeErrorZPtr {
20442    /**
20443     * A pointer to the contents in the success state.
20444     * Reading from this pointer when `result_ok` is not set is undefined.
20445     */
20446    struct LDKPaymentContext *result;
20447    /**
20448     * A pointer to the contents in the error state.
20449     * Reading from this pointer when `result_ok` is set is undefined.
20450     */
20451    struct LDKDecodeError *err;
20452 } LDKCResult_PaymentContextDecodeErrorZPtr;
20453
20454 /**
20455  * A CResult_PaymentContextDecodeErrorZ represents the result of a fallible operation,
20456  * containing a crate::lightning::blinded_path::payment::PaymentContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20457  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20458  */
20459 typedef struct LDKCResult_PaymentContextDecodeErrorZ {
20460    /**
20461     * The contents of this CResult_PaymentContextDecodeErrorZ, accessible via either
20462     * `err` or `result` depending on the state of `result_ok`.
20463     */
20464    union LDKCResult_PaymentContextDecodeErrorZPtr contents;
20465    /**
20466     * Whether this CResult_PaymentContextDecodeErrorZ represents a success state.
20467     */
20468    bool result_ok;
20469 } LDKCResult_PaymentContextDecodeErrorZ;
20470
20471 /**
20472  * The contents of CResult_UnknownPaymentContextDecodeErrorZ
20473  */
20474 typedef union LDKCResult_UnknownPaymentContextDecodeErrorZPtr {
20475    /**
20476     * A pointer to the contents in the success state.
20477     * Reading from this pointer when `result_ok` is not set is undefined.
20478     */
20479    struct LDKUnknownPaymentContext *result;
20480    /**
20481     * A pointer to the contents in the error state.
20482     * Reading from this pointer when `result_ok` is set is undefined.
20483     */
20484    struct LDKDecodeError *err;
20485 } LDKCResult_UnknownPaymentContextDecodeErrorZPtr;
20486
20487 /**
20488  * A CResult_UnknownPaymentContextDecodeErrorZ represents the result of a fallible operation,
20489  * containing a crate::lightning::blinded_path::payment::UnknownPaymentContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20490  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20491  */
20492 typedef struct LDKCResult_UnknownPaymentContextDecodeErrorZ {
20493    /**
20494     * The contents of this CResult_UnknownPaymentContextDecodeErrorZ, accessible via either
20495     * `err` or `result` depending on the state of `result_ok`.
20496     */
20497    union LDKCResult_UnknownPaymentContextDecodeErrorZPtr contents;
20498    /**
20499     * Whether this CResult_UnknownPaymentContextDecodeErrorZ represents a success state.
20500     */
20501    bool result_ok;
20502 } LDKCResult_UnknownPaymentContextDecodeErrorZ;
20503
20504 /**
20505  * The contents of CResult_Bolt12OfferContextDecodeErrorZ
20506  */
20507 typedef union LDKCResult_Bolt12OfferContextDecodeErrorZPtr {
20508    /**
20509     * A pointer to the contents in the success state.
20510     * Reading from this pointer when `result_ok` is not set is undefined.
20511     */
20512    struct LDKBolt12OfferContext *result;
20513    /**
20514     * A pointer to the contents in the error state.
20515     * Reading from this pointer when `result_ok` is set is undefined.
20516     */
20517    struct LDKDecodeError *err;
20518 } LDKCResult_Bolt12OfferContextDecodeErrorZPtr;
20519
20520 /**
20521  * A CResult_Bolt12OfferContextDecodeErrorZ represents the result of a fallible operation,
20522  * containing a crate::lightning::blinded_path::payment::Bolt12OfferContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20523  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20524  */
20525 typedef struct LDKCResult_Bolt12OfferContextDecodeErrorZ {
20526    /**
20527     * The contents of this CResult_Bolt12OfferContextDecodeErrorZ, accessible via either
20528     * `err` or `result` depending on the state of `result_ok`.
20529     */
20530    union LDKCResult_Bolt12OfferContextDecodeErrorZPtr contents;
20531    /**
20532     * Whether this CResult_Bolt12OfferContextDecodeErrorZ represents a success state.
20533     */
20534    bool result_ok;
20535 } LDKCResult_Bolt12OfferContextDecodeErrorZ;
20536
20537 /**
20538  * The contents of CResult_Bolt12RefundContextDecodeErrorZ
20539  */
20540 typedef union LDKCResult_Bolt12RefundContextDecodeErrorZPtr {
20541    /**
20542     * A pointer to the contents in the success state.
20543     * Reading from this pointer when `result_ok` is not set is undefined.
20544     */
20545    struct LDKBolt12RefundContext *result;
20546    /**
20547     * A pointer to the contents in the error state.
20548     * Reading from this pointer when `result_ok` is set is undefined.
20549     */
20550    struct LDKDecodeError *err;
20551 } LDKCResult_Bolt12RefundContextDecodeErrorZPtr;
20552
20553 /**
20554  * A CResult_Bolt12RefundContextDecodeErrorZ represents the result of a fallible operation,
20555  * containing a crate::lightning::blinded_path::payment::Bolt12RefundContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20556  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20557  */
20558 typedef struct LDKCResult_Bolt12RefundContextDecodeErrorZ {
20559    /**
20560     * The contents of this CResult_Bolt12RefundContextDecodeErrorZ, accessible via either
20561     * `err` or `result` depending on the state of `result_ok`.
20562     */
20563    union LDKCResult_Bolt12RefundContextDecodeErrorZPtr contents;
20564    /**
20565     * Whether this CResult_Bolt12RefundContextDecodeErrorZ represents a success state.
20566     */
20567    bool result_ok;
20568 } LDKCResult_Bolt12RefundContextDecodeErrorZ;
20569
20570 /**
20571  * The contents of CResult_StrSecp256k1ErrorZ
20572  */
20573 typedef union LDKCResult_StrSecp256k1ErrorZPtr {
20574    /**
20575     * A pointer to the contents in the success state.
20576     * Reading from this pointer when `result_ok` is not set is undefined.
20577     */
20578    struct LDKStr *result;
20579    /**
20580     * A pointer to the contents in the error state.
20581     * Reading from this pointer when `result_ok` is set is undefined.
20582     */
20583    enum LDKSecp256k1Error *err;
20584 } LDKCResult_StrSecp256k1ErrorZPtr;
20585
20586 /**
20587  * A CResult_StrSecp256k1ErrorZ represents the result of a fallible operation,
20588  * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
20589  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20590  */
20591 typedef struct LDKCResult_StrSecp256k1ErrorZ {
20592    /**
20593     * The contents of this CResult_StrSecp256k1ErrorZ, accessible via either
20594     * `err` or `result` depending on the state of `result_ok`.
20595     */
20596    union LDKCResult_StrSecp256k1ErrorZPtr contents;
20597    /**
20598     * Whether this CResult_StrSecp256k1ErrorZ represents a success state.
20599     */
20600    bool result_ok;
20601 } LDKCResult_StrSecp256k1ErrorZ;
20602
20603 /**
20604  * A tuple of 3 elements. See the individual fields for the types contained.
20605  */
20606 typedef struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ {
20607    /**
20608     * The element at position 0
20609     */
20610    struct LDKThirtyTwoBytes a;
20611    /**
20612     * The element at position 1
20613     */
20614    struct LDKRecipientOnionFields b;
20615    /**
20616     * The element at position 2
20617     */
20618    struct LDKRouteParameters c;
20619 } LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ;
20620
20621 /**
20622  * The contents of CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ
20623  */
20624 typedef union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr {
20625    /**
20626     * A pointer to the contents in the success state.
20627     * Reading from this pointer when `result_ok` is not set is undefined.
20628     */
20629    struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *result;
20630    /**
20631     * Note that this value is always NULL, as there are no contents in the Err variant
20632     */
20633    void *err;
20634 } LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr;
20635
20636 /**
20637  * A CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents the result of a fallible operation,
20638  * containing a crate::c_types::derived::C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ on success and a () on failure.
20639  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20640  */
20641 typedef struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ {
20642    /**
20643     * The contents of this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ, accessible via either
20644     * `err` or `result` depending on the state of `result_ok`.
20645     */
20646    union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr contents;
20647    /**
20648     * Whether this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents a success state.
20649     */
20650    bool result_ok;
20651 } LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ;
20652
20653 /**
20654  * A tuple of 3 elements. See the individual fields for the types contained.
20655  */
20656 typedef struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ {
20657    /**
20658     * The element at position 0
20659     */
20660    struct LDKPublicKey a;
20661    /**
20662     * The element at position 1
20663     */
20664    struct LDKOnionMessage b;
20665    /**
20666     * The element at position 2
20667     */
20668    struct LDKCOption_CVec_SocketAddressZZ c;
20669 } LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ;
20670
20671 /**
20672  * Errors that may occur when [sending an onion message].
20673  *
20674  * [sending an onion message]: OnionMessenger::send_onion_message
20675  */
20676 typedef enum LDKSendError_Tag {
20677    /**
20678     * Errored computing onion message packet keys.
20679     */
20680    LDKSendError_Secp256k1,
20681    /**
20682     * Because implementations such as Eclair will drop onion messages where the message packet
20683     * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
20684     */
20685    LDKSendError_TooBigPacket,
20686    /**
20687     * The provided [`Destination`] was an invalid [`BlindedPath`] due to not having any blinded
20688     * hops.
20689     */
20690    LDKSendError_TooFewBlindedHops,
20691    /**
20692     * The first hop is not a peer and doesn't have a known [`SocketAddress`].
20693     */
20694    LDKSendError_InvalidFirstHop,
20695    /**
20696     * A path from the sender to the destination could not be found by the [`MessageRouter`].
20697     */
20698    LDKSendError_PathNotFound,
20699    /**
20700     * Onion message contents must have a TLV type >= 64.
20701     */
20702    LDKSendError_InvalidMessage,
20703    /**
20704     * Our next-hop peer's buffer was full or our total outbound buffer was full.
20705     */
20706    LDKSendError_BufferFull,
20707    /**
20708     * Failed to retrieve our node id from the provided [`NodeSigner`].
20709     *
20710     * [`NodeSigner`]: crate::sign::NodeSigner
20711     */
20712    LDKSendError_GetNodeIdFailed,
20713    /**
20714     * The provided [`Destination`] has a blinded path with an unresolved introduction node. An
20715     * attempt to resolve it in the [`MessageRouter`] when finding an [`OnionMessagePath`] likely
20716     * failed.
20717     */
20718    LDKSendError_UnresolvedIntroductionNode,
20719    /**
20720     * We attempted to send to a blinded path where we are the introduction node, and failed to
20721     * advance the blinded path to make the second hop the new introduction node. Either
20722     * [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the
20723     * new blinding point, or we were attempting to send to ourselves.
20724     */
20725    LDKSendError_BlindedPathAdvanceFailed,
20726    /**
20727     * Must be last for serialization purposes
20728     */
20729    LDKSendError_Sentinel,
20730 } LDKSendError_Tag;
20731
20732 typedef struct MUST_USE_STRUCT LDKSendError {
20733    LDKSendError_Tag tag;
20734    union {
20735       struct {
20736          enum LDKSecp256k1Error secp256k1;
20737       };
20738       struct {
20739          struct LDKPublicKey invalid_first_hop;
20740       };
20741    };
20742 } LDKSendError;
20743
20744 /**
20745  * The contents of CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ
20746  */
20747 typedef union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr {
20748    /**
20749     * A pointer to the contents in the success state.
20750     * Reading from this pointer when `result_ok` is not set is undefined.
20751     */
20752    struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *result;
20753    /**
20754     * A pointer to the contents in the error state.
20755     * Reading from this pointer when `result_ok` is set is undefined.
20756     */
20757    struct LDKSendError *err;
20758 } LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr;
20759
20760 /**
20761  * A CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents the result of a fallible operation,
20762  * containing a crate::c_types::derived::C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ on success and a crate::lightning::onion_message::messenger::SendError on failure.
20763  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20764  */
20765 typedef struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ {
20766    /**
20767     * The contents of this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ, accessible via either
20768     * `err` or `result` depending on the state of `result_ok`.
20769     */
20770    union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr contents;
20771    /**
20772     * Whether this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents a success state.
20773     */
20774    bool result_ok;
20775 } LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ;
20776
20777 /**
20778  * The next hop to forward an onion message along its path.
20779  *
20780  * Note that payment blinded paths always specify their next hop using an explicit node id.
20781  */
20782 typedef enum LDKNextMessageHop_Tag {
20783    /**
20784     * The node id of the next hop.
20785     */
20786    LDKNextMessageHop_NodeId,
20787    /**
20788     * The short channel id leading to the next hop.
20789     */
20790    LDKNextMessageHop_ShortChannelId,
20791    /**
20792     * Must be last for serialization purposes
20793     */
20794    LDKNextMessageHop_Sentinel,
20795 } LDKNextMessageHop_Tag;
20796
20797 typedef struct MUST_USE_STRUCT LDKNextMessageHop {
20798    LDKNextMessageHop_Tag tag;
20799    union {
20800       struct {
20801          struct LDKPublicKey node_id;
20802       };
20803       struct {
20804          uint64_t short_channel_id;
20805       };
20806    };
20807 } LDKNextMessageHop;
20808
20809 /**
20810  * The contents of an [`OnionMessage`] as read from the wire.
20811  *
20812  * [`OnionMessage`]: crate::ln::msgs::OnionMessage
20813  */
20814 typedef enum LDKParsedOnionMessageContents_Tag {
20815    /**
20816     * A message related to BOLT 12 Offers.
20817     */
20818    LDKParsedOnionMessageContents_Offers,
20819    /**
20820     * A custom onion message specified by the user.
20821     */
20822    LDKParsedOnionMessageContents_Custom,
20823    /**
20824     * Must be last for serialization purposes
20825     */
20826    LDKParsedOnionMessageContents_Sentinel,
20827 } LDKParsedOnionMessageContents_Tag;
20828
20829 typedef struct MUST_USE_STRUCT LDKParsedOnionMessageContents {
20830    LDKParsedOnionMessageContents_Tag tag;
20831    union {
20832       struct {
20833          struct LDKOffersMessage offers;
20834       };
20835       struct {
20836          struct LDKOnionMessageContents custom;
20837       };
20838    };
20839 } LDKParsedOnionMessageContents;
20840
20841 /**
20842  * A processed incoming onion message, containing either a Forward (another onion message)
20843  * or a Receive payload with decrypted contents.
20844  */
20845 typedef enum LDKPeeledOnion_Tag {
20846    /**
20847     * Forwarded onion, with the next node id and a new onion
20848     */
20849    LDKPeeledOnion_Forward,
20850    /**
20851     * Received onion message, with decrypted contents, path_id, and reply path
20852     */
20853    LDKPeeledOnion_Receive,
20854    /**
20855     * Must be last for serialization purposes
20856     */
20857    LDKPeeledOnion_Sentinel,
20858 } LDKPeeledOnion_Tag;
20859
20860 typedef struct LDKPeeledOnion_LDKForward_Body {
20861    struct LDKNextMessageHop _0;
20862    struct LDKOnionMessage _1;
20863 } LDKPeeledOnion_LDKForward_Body;
20864
20865 typedef struct LDKPeeledOnion_LDKReceive_Body {
20866    struct LDKParsedOnionMessageContents _0;
20867    /**
20868     *
20869     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
20870     */
20871    struct LDKThirtyTwoBytes _1;
20872    /**
20873     *
20874     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
20875     */
20876    struct LDKBlindedPath _2;
20877 } LDKPeeledOnion_LDKReceive_Body;
20878
20879 typedef struct MUST_USE_STRUCT LDKPeeledOnion {
20880    LDKPeeledOnion_Tag tag;
20881    union {
20882       LDKPeeledOnion_LDKForward_Body forward;
20883       LDKPeeledOnion_LDKReceive_Body receive;
20884    };
20885 } LDKPeeledOnion;
20886
20887 /**
20888  * The contents of CResult_PeeledOnionNoneZ
20889  */
20890 typedef union LDKCResult_PeeledOnionNoneZPtr {
20891    /**
20892     * A pointer to the contents in the success state.
20893     * Reading from this pointer when `result_ok` is not set is undefined.
20894     */
20895    struct LDKPeeledOnion *result;
20896    /**
20897     * Note that this value is always NULL, as there are no contents in the Err variant
20898     */
20899    void *err;
20900 } LDKCResult_PeeledOnionNoneZPtr;
20901
20902 /**
20903  * A CResult_PeeledOnionNoneZ represents the result of a fallible operation,
20904  * containing a crate::lightning::onion_message::messenger::PeeledOnion on success and a () on failure.
20905  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20906  */
20907 typedef struct LDKCResult_PeeledOnionNoneZ {
20908    /**
20909     * The contents of this CResult_PeeledOnionNoneZ, accessible via either
20910     * `err` or `result` depending on the state of `result_ok`.
20911     */
20912    union LDKCResult_PeeledOnionNoneZPtr contents;
20913    /**
20914     * Whether this CResult_PeeledOnionNoneZ represents a success state.
20915     */
20916    bool result_ok;
20917 } LDKCResult_PeeledOnionNoneZ;
20918
20919 /**
20920  * Result of successfully [sending an onion message].
20921  *
20922  * [sending an onion message]: OnionMessenger::send_onion_message
20923  */
20924 typedef enum LDKSendSuccess_Tag {
20925    /**
20926     * The message was buffered and will be sent once it is processed by
20927     * [`OnionMessageHandler::next_onion_message_for_peer`].
20928     */
20929    LDKSendSuccess_Buffered,
20930    /**
20931     * The message was buffered and will be sent once the node is connected as a peer and it is
20932     * processed by [`OnionMessageHandler::next_onion_message_for_peer`].
20933     */
20934    LDKSendSuccess_BufferedAwaitingConnection,
20935    /**
20936     * Must be last for serialization purposes
20937     */
20938    LDKSendSuccess_Sentinel,
20939 } LDKSendSuccess_Tag;
20940
20941 typedef struct MUST_USE_STRUCT LDKSendSuccess {
20942    LDKSendSuccess_Tag tag;
20943    union {
20944       struct {
20945          struct LDKPublicKey buffered_awaiting_connection;
20946       };
20947    };
20948 } LDKSendSuccess;
20949
20950 /**
20951  * The contents of CResult_SendSuccessSendErrorZ
20952  */
20953 typedef union LDKCResult_SendSuccessSendErrorZPtr {
20954    /**
20955     * A pointer to the contents in the success state.
20956     * Reading from this pointer when `result_ok` is not set is undefined.
20957     */
20958    struct LDKSendSuccess *result;
20959    /**
20960     * A pointer to the contents in the error state.
20961     * Reading from this pointer when `result_ok` is set is undefined.
20962     */
20963    struct LDKSendError *err;
20964 } LDKCResult_SendSuccessSendErrorZPtr;
20965
20966 /**
20967  * A CResult_SendSuccessSendErrorZ represents the result of a fallible operation,
20968  * containing a crate::lightning::onion_message::messenger::SendSuccess on success and a crate::lightning::onion_message::messenger::SendError on failure.
20969  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20970  */
20971 typedef struct LDKCResult_SendSuccessSendErrorZ {
20972    /**
20973     * The contents of this CResult_SendSuccessSendErrorZ, accessible via either
20974     * `err` or `result` depending on the state of `result_ok`.
20975     */
20976    union LDKCResult_SendSuccessSendErrorZPtr contents;
20977    /**
20978     * Whether this CResult_SendSuccessSendErrorZ represents a success state.
20979     */
20980    bool result_ok;
20981 } LDKCResult_SendSuccessSendErrorZ;
20982
20983 /**
20984  * The contents of CResult_BlindedPathNoneZ
20985  */
20986 typedef union LDKCResult_BlindedPathNoneZPtr {
20987    /**
20988     * A pointer to the contents in the success state.
20989     * Reading from this pointer when `result_ok` is not set is undefined.
20990     */
20991    struct LDKBlindedPath *result;
20992    /**
20993     * Note that this value is always NULL, as there are no contents in the Err variant
20994     */
20995    void *err;
20996 } LDKCResult_BlindedPathNoneZPtr;
20997
20998 /**
20999  * A CResult_BlindedPathNoneZ represents the result of a fallible operation,
21000  * containing a crate::lightning::blinded_path::BlindedPath on success and a () on failure.
21001  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21002  */
21003 typedef struct LDKCResult_BlindedPathNoneZ {
21004    /**
21005     * The contents of this CResult_BlindedPathNoneZ, accessible via either
21006     * `err` or `result` depending on the state of `result_ok`.
21007     */
21008    union LDKCResult_BlindedPathNoneZPtr contents;
21009    /**
21010     * Whether this CResult_BlindedPathNoneZ represents a success state.
21011     */
21012    bool result_ok;
21013 } LDKCResult_BlindedPathNoneZ;
21014
21015 /**
21016  * The contents of CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ
21017  */
21018 typedef union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr {
21019    /**
21020     * A pointer to the contents in the success state.
21021     * Reading from this pointer when `result_ok` is not set is undefined.
21022     */
21023    struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *result;
21024    /**
21025     * Note that this value is always NULL, as there are no contents in the Err variant
21026     */
21027    void *err;
21028 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr;
21029
21030 /**
21031  * A CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents the result of a fallible operation,
21032  * containing a crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZ on success and a () on failure.
21033  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21034  */
21035 typedef struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ {
21036    /**
21037     * The contents of this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ, accessible via either
21038     * `err` or `result` depending on the state of `result_ok`.
21039     */
21040    union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr contents;
21041    /**
21042     * Whether this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents a success state.
21043     */
21044    bool result_ok;
21045 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ;
21046
21047
21048
21049 /**
21050  * An intermediate node, its outbound channel, and relay parameters.
21051  */
21052 typedef struct MUST_USE_STRUCT LDKForwardNode {
21053    /**
21054     * A pointer to the opaque Rust object.
21055     * Nearly everywhere, inner must be non-null, however in places where
21056     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21057     */
21058    LDKnativeForwardNode *inner;
21059    /**
21060     * Indicates that this is the only struct which contains the same pointer.
21061     * Rust functions which take ownership of an object provided via an argument require
21062     * this to be true and invalidate the object pointed to by inner.
21063     */
21064    bool is_owned;
21065 } LDKForwardNode;
21066
21067 /**
21068  * A dynamically-allocated array of crate::lightning::blinded_path::payment::ForwardNodes of arbitrary size.
21069  * This corresponds to std::vector in C++
21070  */
21071 typedef struct LDKCVec_ForwardNodeZ {
21072    /**
21073     * The elements in the array.
21074     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
21075     */
21076    struct LDKForwardNode *data;
21077    /**
21078     * The number of elements pointed to by `data`.
21079     */
21080    uintptr_t datalen;
21081 } LDKCVec_ForwardNodeZ;
21082
21083 /**
21084  * The contents of CResult_BlindedPathDecodeErrorZ
21085  */
21086 typedef union LDKCResult_BlindedPathDecodeErrorZPtr {
21087    /**
21088     * A pointer to the contents in the success state.
21089     * Reading from this pointer when `result_ok` is not set is undefined.
21090     */
21091    struct LDKBlindedPath *result;
21092    /**
21093     * A pointer to the contents in the error state.
21094     * Reading from this pointer when `result_ok` is set is undefined.
21095     */
21096    struct LDKDecodeError *err;
21097 } LDKCResult_BlindedPathDecodeErrorZPtr;
21098
21099 /**
21100  * A CResult_BlindedPathDecodeErrorZ represents the result of a fallible operation,
21101  * containing a crate::lightning::blinded_path::BlindedPath on success and a crate::lightning::ln::msgs::DecodeError on failure.
21102  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21103  */
21104 typedef struct LDKCResult_BlindedPathDecodeErrorZ {
21105    /**
21106     * The contents of this CResult_BlindedPathDecodeErrorZ, accessible via either
21107     * `err` or `result` depending on the state of `result_ok`.
21108     */
21109    union LDKCResult_BlindedPathDecodeErrorZPtr contents;
21110    /**
21111     * Whether this CResult_BlindedPathDecodeErrorZ represents a success state.
21112     */
21113    bool result_ok;
21114 } LDKCResult_BlindedPathDecodeErrorZ;
21115
21116 /**
21117  * The contents of CResult_BlindedHopDecodeErrorZ
21118  */
21119 typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
21120    /**
21121     * A pointer to the contents in the success state.
21122     * Reading from this pointer when `result_ok` is not set is undefined.
21123     */
21124    struct LDKBlindedHop *result;
21125    /**
21126     * A pointer to the contents in the error state.
21127     * Reading from this pointer when `result_ok` is set is undefined.
21128     */
21129    struct LDKDecodeError *err;
21130 } LDKCResult_BlindedHopDecodeErrorZPtr;
21131
21132 /**
21133  * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
21134  * containing a crate::lightning::blinded_path::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
21135  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21136  */
21137 typedef struct LDKCResult_BlindedHopDecodeErrorZ {
21138    /**
21139     * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
21140     * `err` or `result` depending on the state of `result_ok`.
21141     */
21142    union LDKCResult_BlindedHopDecodeErrorZPtr contents;
21143    /**
21144     * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
21145     */
21146    bool result_ok;
21147 } LDKCResult_BlindedHopDecodeErrorZ;
21148
21149 /**
21150  * The contents of CResult_InvoiceErrorDecodeErrorZ
21151  */
21152 typedef union LDKCResult_InvoiceErrorDecodeErrorZPtr {
21153    /**
21154     * A pointer to the contents in the success state.
21155     * Reading from this pointer when `result_ok` is not set is undefined.
21156     */
21157    struct LDKInvoiceError *result;
21158    /**
21159     * A pointer to the contents in the error state.
21160     * Reading from this pointer when `result_ok` is set is undefined.
21161     */
21162    struct LDKDecodeError *err;
21163 } LDKCResult_InvoiceErrorDecodeErrorZPtr;
21164
21165 /**
21166  * A CResult_InvoiceErrorDecodeErrorZ represents the result of a fallible operation,
21167  * containing a crate::lightning::offers::invoice_error::InvoiceError on success and a crate::lightning::ln::msgs::DecodeError on failure.
21168  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21169  */
21170 typedef struct LDKCResult_InvoiceErrorDecodeErrorZ {
21171    /**
21172     * The contents of this CResult_InvoiceErrorDecodeErrorZ, accessible via either
21173     * `err` or `result` depending on the state of `result_ok`.
21174     */
21175    union LDKCResult_InvoiceErrorDecodeErrorZPtr contents;
21176    /**
21177     * Whether this CResult_InvoiceErrorDecodeErrorZ represents a success state.
21178     */
21179    bool result_ok;
21180 } LDKCResult_InvoiceErrorDecodeErrorZ;
21181
21182
21183
21184 /**
21185  * The state of a spendable output currently tracked by an [`OutputSweeper`].
21186  */
21187 typedef struct MUST_USE_STRUCT LDKTrackedSpendableOutput {
21188    /**
21189     * A pointer to the opaque Rust object.
21190     * Nearly everywhere, inner must be non-null, however in places where
21191     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21192     */
21193    LDKnativeTrackedSpendableOutput *inner;
21194    /**
21195     * Indicates that this is the only struct which contains the same pointer.
21196     * Rust functions which take ownership of an object provided via an argument require
21197     * this to be true and invalidate the object pointed to by inner.
21198     */
21199    bool is_owned;
21200 } LDKTrackedSpendableOutput;
21201
21202 /**
21203  * The contents of CResult_TrackedSpendableOutputDecodeErrorZ
21204  */
21205 typedef union LDKCResult_TrackedSpendableOutputDecodeErrorZPtr {
21206    /**
21207     * A pointer to the contents in the success state.
21208     * Reading from this pointer when `result_ok` is not set is undefined.
21209     */
21210    struct LDKTrackedSpendableOutput *result;
21211    /**
21212     * A pointer to the contents in the error state.
21213     * Reading from this pointer when `result_ok` is set is undefined.
21214     */
21215    struct LDKDecodeError *err;
21216 } LDKCResult_TrackedSpendableOutputDecodeErrorZPtr;
21217
21218 /**
21219  * A CResult_TrackedSpendableOutputDecodeErrorZ represents the result of a fallible operation,
21220  * containing a crate::lightning::util::sweep::TrackedSpendableOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
21221  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21222  */
21223 typedef struct LDKCResult_TrackedSpendableOutputDecodeErrorZ {
21224    /**
21225     * The contents of this CResult_TrackedSpendableOutputDecodeErrorZ, accessible via either
21226     * `err` or `result` depending on the state of `result_ok`.
21227     */
21228    union LDKCResult_TrackedSpendableOutputDecodeErrorZPtr contents;
21229    /**
21230     * Whether this CResult_TrackedSpendableOutputDecodeErrorZ represents a success state.
21231     */
21232    bool result_ok;
21233 } LDKCResult_TrackedSpendableOutputDecodeErrorZ;
21234
21235 /**
21236  * The current status of the output spend.
21237  */
21238 typedef enum LDKOutputSpendStatus_Tag {
21239    /**
21240     * The output is tracked but an initial spending transaction hasn't been generated and
21241     * broadcasted yet.
21242     */
21243    LDKOutputSpendStatus_PendingInitialBroadcast,
21244    /**
21245     * A transaction spending the output has been broadcasted but is pending its first confirmation on-chain.
21246     */
21247    LDKOutputSpendStatus_PendingFirstConfirmation,
21248    /**
21249     * A transaction spending the output has been confirmed on-chain but will be tracked until it
21250     * reaches [`ANTI_REORG_DELAY`] confirmations.
21251     */
21252    LDKOutputSpendStatus_PendingThresholdConfirmations,
21253    /**
21254     * Must be last for serialization purposes
21255     */
21256    LDKOutputSpendStatus_Sentinel,
21257 } LDKOutputSpendStatus_Tag;
21258
21259 typedef struct LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body {
21260    /**
21261     * The height at which we will first generate and broadcast a spending transaction.
21262     */
21263    struct LDKCOption_u32Z delayed_until_height;
21264 } LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body;
21265
21266 typedef struct LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body {
21267    /**
21268     * The hash of the chain tip when we first broadcast a transaction spending this output.
21269     */
21270    struct LDKThirtyTwoBytes first_broadcast_hash;
21271    /**
21272     * The best height when we last broadcast a transaction spending this output.
21273     */
21274    uint32_t latest_broadcast_height;
21275    /**
21276     * The transaction spending this output we last broadcasted.
21277     */
21278    struct LDKTransaction latest_spending_tx;
21279 } LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body;
21280
21281 typedef struct LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body {
21282    /**
21283     * The hash of the chain tip when we first broadcast a transaction spending this output.
21284     */
21285    struct LDKThirtyTwoBytes first_broadcast_hash;
21286    /**
21287     * The best height when we last broadcast a transaction spending this output.
21288     */
21289    uint32_t latest_broadcast_height;
21290    /**
21291     * The transaction spending this output we saw confirmed on-chain.
21292     */
21293    struct LDKTransaction latest_spending_tx;
21294    /**
21295     * The height at which the spending transaction was confirmed.
21296     */
21297    uint32_t confirmation_height;
21298    /**
21299     * The hash of the block in which the spending transaction was confirmed.
21300     */
21301    struct LDKThirtyTwoBytes confirmation_hash;
21302 } LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body;
21303
21304 typedef struct MUST_USE_STRUCT LDKOutputSpendStatus {
21305    LDKOutputSpendStatus_Tag tag;
21306    union {
21307       LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body pending_initial_broadcast;
21308       LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body pending_first_confirmation;
21309       LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body pending_threshold_confirmations;
21310    };
21311 } LDKOutputSpendStatus;
21312
21313 /**
21314  * The contents of CResult_OutputSpendStatusDecodeErrorZ
21315  */
21316 typedef union LDKCResult_OutputSpendStatusDecodeErrorZPtr {
21317    /**
21318     * A pointer to the contents in the success state.
21319     * Reading from this pointer when `result_ok` is not set is undefined.
21320     */
21321    struct LDKOutputSpendStatus *result;
21322    /**
21323     * A pointer to the contents in the error state.
21324     * Reading from this pointer when `result_ok` is set is undefined.
21325     */
21326    struct LDKDecodeError *err;
21327 } LDKCResult_OutputSpendStatusDecodeErrorZPtr;
21328
21329 /**
21330  * A CResult_OutputSpendStatusDecodeErrorZ represents the result of a fallible operation,
21331  * containing a crate::lightning::util::sweep::OutputSpendStatus on success and a crate::lightning::ln::msgs::DecodeError on failure.
21332  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21333  */
21334 typedef struct LDKCResult_OutputSpendStatusDecodeErrorZ {
21335    /**
21336     * The contents of this CResult_OutputSpendStatusDecodeErrorZ, accessible via either
21337     * `err` or `result` depending on the state of `result_ok`.
21338     */
21339    union LDKCResult_OutputSpendStatusDecodeErrorZPtr contents;
21340    /**
21341     * Whether this CResult_OutputSpendStatusDecodeErrorZ represents a success state.
21342     */
21343    bool result_ok;
21344 } LDKCResult_OutputSpendStatusDecodeErrorZ;
21345
21346
21347
21348 /**
21349  * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
21350  *
21351  * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
21352  * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
21353  * [`Confirm::transactions_confirmed`].
21354  *
21355  * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
21356  * may have been spent there. See [`Filter::register_output`] for details.
21357  *
21358  * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
21359  * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
21360  */
21361 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
21362    /**
21363     * A pointer to the opaque Rust object.
21364     * Nearly everywhere, inner must be non-null, however in places where
21365     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21366     */
21367    LDKnativeWatchedOutput *inner;
21368    /**
21369     * Indicates that this is the only struct which contains the same pointer.
21370     * Rust functions which take ownership of an object provided via an argument require
21371     * this to be true and invalidate the object pointed to by inner.
21372     */
21373    bool is_owned;
21374 } LDKWatchedOutput;
21375
21376 /**
21377  * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
21378  * channels.
21379  *
21380  * This is useful in order to have a [`Watch`] implementation convey to a chain source which
21381  * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
21382  * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
21383  * receiving full blocks from a chain source, any further filtering is unnecessary.
21384  *
21385  * After an output has been registered, subsequent block retrievals from the chain source must not
21386  * exclude any transactions matching the new criteria nor any in-block descendants of such
21387  * transactions.
21388  *
21389  * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
21390  * should not block on I/O. Implementations should instead queue the newly monitored data to be
21391  * processed later. Then, in order to block until the data has been processed, any [`Watch`]
21392  * invocation that has called the `Filter` must return [`InProgress`].
21393  *
21394  * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
21395  * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
21396  * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
21397  */
21398 typedef struct LDKFilter {
21399    /**
21400     * An opaque pointer which is passed to your function implementations as an argument.
21401     * This has no meaning in the LDK, and can be NULL or any other value.
21402     */
21403    void *this_arg;
21404    /**
21405     * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
21406     * a spending condition.
21407     */
21408    void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
21409    /**
21410     * Registers interest in spends of a transaction output.
21411     *
21412     * Note that this method might be called during processing of a new block. You therefore need
21413     * to ensure that also dependent output spents within an already connected block are correctly
21414     * handled, e.g., by re-scanning the block in question whenever new outputs have been
21415     * registered mid-processing.
21416     */
21417    void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
21418    /**
21419     * Frees any resources associated with this object given its this_arg pointer.
21420     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21421     */
21422    void (*free)(void *this_arg);
21423 } LDKFilter;
21424
21425 /**
21426  * An enum which can either contain a crate::lightning::chain::Filter or not
21427  */
21428 typedef enum LDKCOption_FilterZ_Tag {
21429    /**
21430     * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
21431     */
21432    LDKCOption_FilterZ_Some,
21433    /**
21434     * When we're in this state, this COption_FilterZ contains nothing
21435     */
21436    LDKCOption_FilterZ_None,
21437    /**
21438     * Must be last for serialization purposes
21439     */
21440    LDKCOption_FilterZ_Sentinel,
21441 } LDKCOption_FilterZ_Tag;
21442
21443 typedef struct LDKCOption_FilterZ {
21444    LDKCOption_FilterZ_Tag tag;
21445    union {
21446       struct {
21447          struct LDKFilter some;
21448       };
21449    };
21450 } LDKCOption_FilterZ;
21451
21452 /**
21453  * A dynamically-allocated array of crate::lightning::util::sweep::TrackedSpendableOutputs of arbitrary size.
21454  * This corresponds to std::vector in C++
21455  */
21456 typedef struct LDKCVec_TrackedSpendableOutputZ {
21457    /**
21458     * The elements in the array.
21459     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
21460     */
21461    struct LDKTrackedSpendableOutput *data;
21462    /**
21463     * The number of elements pointed to by `data`.
21464     */
21465    uintptr_t datalen;
21466 } LDKCVec_TrackedSpendableOutputZ;
21467
21468 /**
21469  * A helper trait that describes an on-chain wallet capable of returning a (change) destination
21470  * script.
21471  */
21472 typedef struct LDKChangeDestinationSource {
21473    /**
21474     * An opaque pointer which is passed to your function implementations as an argument.
21475     * This has no meaning in the LDK, and can be NULL or any other value.
21476     */
21477    void *this_arg;
21478    /**
21479     * Returns a script pubkey which can be used as a change destination for
21480     * [`OutputSpender::spend_spendable_outputs`].
21481     *
21482     * This method should return a different value each time it is called, to avoid linking
21483     * on-chain funds controlled to the same user.
21484     */
21485    struct LDKCResult_CVec_u8ZNoneZ (*get_change_destination_script)(const void *this_arg);
21486    /**
21487     * Frees any resources associated with this object given its this_arg pointer.
21488     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21489     */
21490    void (*free)(void *this_arg);
21491 } LDKChangeDestinationSource;
21492
21493 /**
21494  * Provides an interface that allows storage and retrieval of persisted values that are associated
21495  * with given keys.
21496  *
21497  * In order to avoid collisions the key space is segmented based on the given `primary_namespace`s
21498  * and `secondary_namespace`s. Implementations of this trait are free to handle them in different
21499  * ways, as long as per-namespace key uniqueness is asserted.
21500  *
21501  * Keys and namespaces are required to be valid ASCII strings in the range of
21502  * [`KVSTORE_NAMESPACE_KEY_ALPHABET`] and no longer than [`KVSTORE_NAMESPACE_KEY_MAX_LEN`]. Empty
21503  * primary namespaces and secondary namespaces (`\"\"`) are assumed to be a valid, however, if
21504  * `primary_namespace` is empty, `secondary_namespace` is required to be empty, too. This means
21505  * that concerns should always be separated by primary namespace first, before secondary
21506  * namespaces are used. While the number of primary namespaces will be relatively small and is
21507  * determined at compile time, there may be many secondary namespaces per primary namespace. Note
21508  * that per-namespace uniqueness needs to also hold for keys *and* namespaces in any given
21509  * namespace, i.e., conflicts between keys and equally named
21510  * primary namespaces/secondary namespaces must be avoided.
21511  *
21512  * **Note:** Users migrating custom persistence backends from the pre-v0.0.117 `KVStorePersister`
21513  * interface can use a concatenation of `[{primary_namespace}/[{secondary_namespace}/]]{key}` to
21514  * recover a `key` compatible with the data model previously assumed by `KVStorePersister::persist`.
21515  */
21516 typedef struct LDKKVStore {
21517    /**
21518     * An opaque pointer which is passed to your function implementations as an argument.
21519     * This has no meaning in the LDK, and can be NULL or any other value.
21520     */
21521    void *this_arg;
21522    /**
21523     * Returns the data stored for the given `primary_namespace`, `secondary_namespace`, and
21524     * `key`.
21525     *
21526     * Returns an [`ErrorKind::NotFound`] if the given `key` could not be found in the given
21527     * `primary_namespace` and `secondary_namespace`.
21528     *
21529     * [`ErrorKind::NotFound`]: io::ErrorKind::NotFound
21530     */
21531    struct LDKCResult_CVec_u8ZIOErrorZ (*read)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key);
21532    /**
21533     * Persists the given data under the given `key`.
21534     *
21535     * Will create the given `primary_namespace` and `secondary_namespace` if not already present
21536     * in the store.
21537     */
21538    struct LDKCResult_NoneIOErrorZ (*write)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, struct LDKu8slice buf);
21539    /**
21540     * Removes any data that had previously been persisted under the given `key`.
21541     *
21542     * If the `lazy` flag is set to `true`, the backend implementation might choose to lazily
21543     * remove the given `key` at some point in time after the method returns, e.g., as part of an
21544     * eventual batch deletion of multiple keys. As a consequence, subsequent calls to
21545     * [`KVStore::list`] might include the removed key until the changes are actually persisted.
21546     *
21547     * Note that while setting the `lazy` flag reduces the I/O burden of multiple subsequent
21548     * `remove` calls, it also influences the atomicity guarantees as lazy `remove`s could
21549     * potentially get lost on crash after the method returns. Therefore, this flag should only be
21550     * set for `remove` operations that can be safely replayed at a later time.
21551     *
21552     * Returns successfully if no data will be stored for the given `primary_namespace`,
21553     * `secondary_namespace`, and `key`, independently of whether it was present before its
21554     * invokation or not.
21555     */
21556    struct LDKCResult_NoneIOErrorZ (*remove)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, bool lazy);
21557    /**
21558     * Returns a list of keys that are stored under the given `secondary_namespace` in
21559     * `primary_namespace`.
21560     *
21561     * Returns the keys in arbitrary order, so users requiring a particular order need to sort the
21562     * returned keys. Returns an empty list if `primary_namespace` or `secondary_namespace` is unknown.
21563     */
21564    struct LDKCResult_CVec_StrZIOErrorZ (*list)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace);
21565    /**
21566     * Frees any resources associated with this object given its this_arg pointer.
21567     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21568     */
21569    void (*free)(void *this_arg);
21570 } LDKKVStore;
21571
21572 /**
21573  * A trait that describes a wallet capable of creating a spending [`Transaction`] from a set of
21574  * [`SpendableOutputDescriptor`]s.
21575  */
21576 typedef struct LDKOutputSpender {
21577    /**
21578     * An opaque pointer which is passed to your function implementations as an argument.
21579     * This has no meaning in the LDK, and can be NULL or any other value.
21580     */
21581    void *this_arg;
21582    /**
21583     * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
21584     * output to the given change destination (if sufficient change value remains). The
21585     * transaction will have a feerate, at least, of the given value.
21586     *
21587     * The `locktime` argument is used to set the transaction's locktime. If `None`, the
21588     * transaction will have a locktime of 0. It it recommended to set this to the current block
21589     * height to avoid fee sniping, unless you have some specific reason to use a different
21590     * locktime.
21591     *
21592     * Returns `Err(())` if the output value is greater than the input value minus required fee,
21593     * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
21594     * does not match the one we can spend.
21595     */
21596    struct LDKCResult_TransactionNoneZ (*spend_spendable_outputs)(const void *this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
21597    /**
21598     * Frees any resources associated with this object given its this_arg pointer.
21599     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21600     */
21601    void (*free)(void *this_arg);
21602 } LDKOutputSpender;
21603
21604
21605
21606 /**
21607  * A utility that keeps track of [`SpendableOutputDescriptor`]s, persists them in a given
21608  * [`KVStore`] and regularly retries sweeping them based on a callback given to the constructor
21609  * methods.
21610  *
21611  * Users should call [`Self::track_spendable_outputs`] for any [`SpendableOutputDescriptor`]s received via [`Event::SpendableOutputs`].
21612  *
21613  * This needs to be notified of chain state changes either via its [`Listen`] or [`Confirm`]
21614  * implementation and hence has to be connected with the utilized chain data sources.
21615  *
21616  * If chain data is provided via the [`Confirm`] interface or via filtered blocks, users are
21617  * required to give their chain data sources (i.e., [`Filter`] implementation) to the respective
21618  * constructor.
21619  *
21620  * [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs
21621  */
21622 typedef struct MUST_USE_STRUCT LDKOutputSweeper {
21623    /**
21624     * A pointer to the opaque Rust object.
21625     * Nearly everywhere, inner must be non-null, however in places where
21626     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21627     */
21628    LDKnativeOutputSweeper *inner;
21629    /**
21630     * Indicates that this is the only struct which contains the same pointer.
21631     * Rust functions which take ownership of an object provided via an argument require
21632     * this to be true and invalidate the object pointed to by inner.
21633     */
21634    bool is_owned;
21635 } LDKOutputSweeper;
21636
21637 /**
21638  * The contents of CResult_OutputSweeperDecodeErrorZ
21639  */
21640 typedef union LDKCResult_OutputSweeperDecodeErrorZPtr {
21641    /**
21642     * A pointer to the contents in the success state.
21643     * Reading from this pointer when `result_ok` is not set is undefined.
21644     */
21645    struct LDKOutputSweeper *result;
21646    /**
21647     * A pointer to the contents in the error state.
21648     * Reading from this pointer when `result_ok` is set is undefined.
21649     */
21650    struct LDKDecodeError *err;
21651 } LDKCResult_OutputSweeperDecodeErrorZPtr;
21652
21653 /**
21654  * A CResult_OutputSweeperDecodeErrorZ represents the result of a fallible operation,
21655  * containing a crate::lightning::util::sweep::OutputSweeper on success and a crate::lightning::ln::msgs::DecodeError on failure.
21656  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21657  */
21658 typedef struct LDKCResult_OutputSweeperDecodeErrorZ {
21659    /**
21660     * The contents of this CResult_OutputSweeperDecodeErrorZ, accessible via either
21661     * `err` or `result` depending on the state of `result_ok`.
21662     */
21663    union LDKCResult_OutputSweeperDecodeErrorZPtr contents;
21664    /**
21665     * Whether this CResult_OutputSweeperDecodeErrorZ represents a success state.
21666     */
21667    bool result_ok;
21668 } LDKCResult_OutputSweeperDecodeErrorZ;
21669
21670 /**
21671  * A tuple of 2 elements. See the individual fields for the types contained.
21672  */
21673 typedef struct LDKC2Tuple_BestBlockOutputSweeperZ {
21674    /**
21675     * The element at position 0
21676     */
21677    struct LDKBestBlock a;
21678    /**
21679     * The element at position 1
21680     */
21681    struct LDKOutputSweeper b;
21682 } LDKC2Tuple_BestBlockOutputSweeperZ;
21683
21684 /**
21685  * The contents of CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ
21686  */
21687 typedef union LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr {
21688    /**
21689     * A pointer to the contents in the success state.
21690     * Reading from this pointer when `result_ok` is not set is undefined.
21691     */
21692    struct LDKC2Tuple_BestBlockOutputSweeperZ *result;
21693    /**
21694     * A pointer to the contents in the error state.
21695     * Reading from this pointer when `result_ok` is set is undefined.
21696     */
21697    struct LDKDecodeError *err;
21698 } LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr;
21699
21700 /**
21701  * A CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ represents the result of a fallible operation,
21702  * containing a crate::c_types::derived::C2Tuple_BestBlockOutputSweeperZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
21703  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21704  */
21705 typedef struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ {
21706    /**
21707     * The contents of this CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ, accessible via either
21708     * `err` or `result` depending on the state of `result_ok`.
21709     */
21710    union LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr contents;
21711    /**
21712     * Whether this CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ represents a success state.
21713     */
21714    bool result_ok;
21715 } LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ;
21716
21717
21718
21719 /**
21720  * Base key used in conjunction with a `per_commitment_point` to generate a [`DelayedPaymentKey`].
21721  *
21722  * The delayed payment key is used to pay the commitment state broadcaster their
21723  * non-HTLC-encumbered funds after a delay to give their counterparty a chance to punish if the
21724  * state broadcasted was previously revoked.
21725  */
21726 typedef struct MUST_USE_STRUCT LDKDelayedPaymentBasepoint {
21727    /**
21728     * A pointer to the opaque Rust object.
21729     * Nearly everywhere, inner must be non-null, however in places where
21730     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21731     */
21732    LDKnativeDelayedPaymentBasepoint *inner;
21733    /**
21734     * Indicates that this is the only struct which contains the same pointer.
21735     * Rust functions which take ownership of an object provided via an argument require
21736     * this to be true and invalidate the object pointed to by inner.
21737     */
21738    bool is_owned;
21739 } LDKDelayedPaymentBasepoint;
21740
21741 /**
21742  * The contents of CResult_DelayedPaymentBasepointDecodeErrorZ
21743  */
21744 typedef union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr {
21745    /**
21746     * A pointer to the contents in the success state.
21747     * Reading from this pointer when `result_ok` is not set is undefined.
21748     */
21749    struct LDKDelayedPaymentBasepoint *result;
21750    /**
21751     * A pointer to the contents in the error state.
21752     * Reading from this pointer when `result_ok` is set is undefined.
21753     */
21754    struct LDKDecodeError *err;
21755 } LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr;
21756
21757 /**
21758  * A CResult_DelayedPaymentBasepointDecodeErrorZ represents the result of a fallible operation,
21759  * containing a crate::lightning::ln::channel_keys::DelayedPaymentBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
21760  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21761  */
21762 typedef struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ {
21763    /**
21764     * The contents of this CResult_DelayedPaymentBasepointDecodeErrorZ, accessible via either
21765     * `err` or `result` depending on the state of `result_ok`.
21766     */
21767    union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr contents;
21768    /**
21769     * Whether this CResult_DelayedPaymentBasepointDecodeErrorZ represents a success state.
21770     */
21771    bool result_ok;
21772 } LDKCResult_DelayedPaymentBasepointDecodeErrorZ;
21773
21774
21775
21776 /**
21777  * A derived key built from a [`DelayedPaymentBasepoint`] and `per_commitment_point`.
21778  *
21779  * The delayed payment key is used to pay the commitment state broadcaster their
21780  * non-HTLC-encumbered funds after a delay. This delay gives their counterparty a chance to
21781  * punish and claim all the channel funds if the state broadcasted was previously revoked.
21782  *
21783  * [See the BOLT specs]
21784  * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
21785  * for more information on key derivation details.
21786  */
21787 typedef struct MUST_USE_STRUCT LDKDelayedPaymentKey {
21788    /**
21789     * A pointer to the opaque Rust object.
21790     * Nearly everywhere, inner must be non-null, however in places where
21791     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21792     */
21793    LDKnativeDelayedPaymentKey *inner;
21794    /**
21795     * Indicates that this is the only struct which contains the same pointer.
21796     * Rust functions which take ownership of an object provided via an argument require
21797     * this to be true and invalidate the object pointed to by inner.
21798     */
21799    bool is_owned;
21800 } LDKDelayedPaymentKey;
21801
21802 /**
21803  * The contents of CResult_DelayedPaymentKeyDecodeErrorZ
21804  */
21805 typedef union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr {
21806    /**
21807     * A pointer to the contents in the success state.
21808     * Reading from this pointer when `result_ok` is not set is undefined.
21809     */
21810    struct LDKDelayedPaymentKey *result;
21811    /**
21812     * A pointer to the contents in the error state.
21813     * Reading from this pointer when `result_ok` is set is undefined.
21814     */
21815    struct LDKDecodeError *err;
21816 } LDKCResult_DelayedPaymentKeyDecodeErrorZPtr;
21817
21818 /**
21819  * A CResult_DelayedPaymentKeyDecodeErrorZ represents the result of a fallible operation,
21820  * containing a crate::lightning::ln::channel_keys::DelayedPaymentKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
21821  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21822  */
21823 typedef struct LDKCResult_DelayedPaymentKeyDecodeErrorZ {
21824    /**
21825     * The contents of this CResult_DelayedPaymentKeyDecodeErrorZ, accessible via either
21826     * `err` or `result` depending on the state of `result_ok`.
21827     */
21828    union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr contents;
21829    /**
21830     * Whether this CResult_DelayedPaymentKeyDecodeErrorZ represents a success state.
21831     */
21832    bool result_ok;
21833 } LDKCResult_DelayedPaymentKeyDecodeErrorZ;
21834
21835
21836
21837 /**
21838  * Base key used in conjunction with a `per_commitment_point` to generate an [`HtlcKey`].
21839  *
21840  * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
21841  * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
21842  * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
21843  */
21844 typedef struct MUST_USE_STRUCT LDKHtlcBasepoint {
21845    /**
21846     * A pointer to the opaque Rust object.
21847     * Nearly everywhere, inner must be non-null, however in places where
21848     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21849     */
21850    LDKnativeHtlcBasepoint *inner;
21851    /**
21852     * Indicates that this is the only struct which contains the same pointer.
21853     * Rust functions which take ownership of an object provided via an argument require
21854     * this to be true and invalidate the object pointed to by inner.
21855     */
21856    bool is_owned;
21857 } LDKHtlcBasepoint;
21858
21859 /**
21860  * The contents of CResult_HtlcBasepointDecodeErrorZ
21861  */
21862 typedef union LDKCResult_HtlcBasepointDecodeErrorZPtr {
21863    /**
21864     * A pointer to the contents in the success state.
21865     * Reading from this pointer when `result_ok` is not set is undefined.
21866     */
21867    struct LDKHtlcBasepoint *result;
21868    /**
21869     * A pointer to the contents in the error state.
21870     * Reading from this pointer when `result_ok` is set is undefined.
21871     */
21872    struct LDKDecodeError *err;
21873 } LDKCResult_HtlcBasepointDecodeErrorZPtr;
21874
21875 /**
21876  * A CResult_HtlcBasepointDecodeErrorZ represents the result of a fallible operation,
21877  * containing a crate::lightning::ln::channel_keys::HtlcBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
21878  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21879  */
21880 typedef struct LDKCResult_HtlcBasepointDecodeErrorZ {
21881    /**
21882     * The contents of this CResult_HtlcBasepointDecodeErrorZ, accessible via either
21883     * `err` or `result` depending on the state of `result_ok`.
21884     */
21885    union LDKCResult_HtlcBasepointDecodeErrorZPtr contents;
21886    /**
21887     * Whether this CResult_HtlcBasepointDecodeErrorZ represents a success state.
21888     */
21889    bool result_ok;
21890 } LDKCResult_HtlcBasepointDecodeErrorZ;
21891
21892
21893
21894 /**
21895  * A derived key built from a [`HtlcBasepoint`] and `per_commitment_point`.
21896  *
21897  * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
21898  * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
21899  * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
21900  *
21901  * [See the BOLT specs]
21902  * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
21903  * for more information on key derivation details.
21904  */
21905 typedef struct MUST_USE_STRUCT LDKHtlcKey {
21906    /**
21907     * A pointer to the opaque Rust object.
21908     * Nearly everywhere, inner must be non-null, however in places where
21909     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21910     */
21911    LDKnativeHtlcKey *inner;
21912    /**
21913     * Indicates that this is the only struct which contains the same pointer.
21914     * Rust functions which take ownership of an object provided via an argument require
21915     * this to be true and invalidate the object pointed to by inner.
21916     */
21917    bool is_owned;
21918 } LDKHtlcKey;
21919
21920 /**
21921  * The contents of CResult_HtlcKeyDecodeErrorZ
21922  */
21923 typedef union LDKCResult_HtlcKeyDecodeErrorZPtr {
21924    /**
21925     * A pointer to the contents in the success state.
21926     * Reading from this pointer when `result_ok` is not set is undefined.
21927     */
21928    struct LDKHtlcKey *result;
21929    /**
21930     * A pointer to the contents in the error state.
21931     * Reading from this pointer when `result_ok` is set is undefined.
21932     */
21933    struct LDKDecodeError *err;
21934 } LDKCResult_HtlcKeyDecodeErrorZPtr;
21935
21936 /**
21937  * A CResult_HtlcKeyDecodeErrorZ represents the result of a fallible operation,
21938  * containing a crate::lightning::ln::channel_keys::HtlcKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
21939  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21940  */
21941 typedef struct LDKCResult_HtlcKeyDecodeErrorZ {
21942    /**
21943     * The contents of this CResult_HtlcKeyDecodeErrorZ, accessible via either
21944     * `err` or `result` depending on the state of `result_ok`.
21945     */
21946    union LDKCResult_HtlcKeyDecodeErrorZPtr contents;
21947    /**
21948     * Whether this CResult_HtlcKeyDecodeErrorZ represents a success state.
21949     */
21950    bool result_ok;
21951 } LDKCResult_HtlcKeyDecodeErrorZ;
21952
21953
21954
21955 /**
21956  * Master key used in conjunction with per_commitment_point to generate [htlcpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#key-derivation) for the latest state of a channel.
21957  * A watcher can be given a [RevocationBasepoint] to generate per commitment [RevocationKey] to create justice transactions.
21958  */
21959 typedef struct MUST_USE_STRUCT LDKRevocationBasepoint {
21960    /**
21961     * A pointer to the opaque Rust object.
21962     * Nearly everywhere, inner must be non-null, however in places where
21963     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21964     */
21965    LDKnativeRevocationBasepoint *inner;
21966    /**
21967     * Indicates that this is the only struct which contains the same pointer.
21968     * Rust functions which take ownership of an object provided via an argument require
21969     * this to be true and invalidate the object pointed to by inner.
21970     */
21971    bool is_owned;
21972 } LDKRevocationBasepoint;
21973
21974 /**
21975  * The contents of CResult_RevocationBasepointDecodeErrorZ
21976  */
21977 typedef union LDKCResult_RevocationBasepointDecodeErrorZPtr {
21978    /**
21979     * A pointer to the contents in the success state.
21980     * Reading from this pointer when `result_ok` is not set is undefined.
21981     */
21982    struct LDKRevocationBasepoint *result;
21983    /**
21984     * A pointer to the contents in the error state.
21985     * Reading from this pointer when `result_ok` is set is undefined.
21986     */
21987    struct LDKDecodeError *err;
21988 } LDKCResult_RevocationBasepointDecodeErrorZPtr;
21989
21990 /**
21991  * A CResult_RevocationBasepointDecodeErrorZ represents the result of a fallible operation,
21992  * containing a crate::lightning::ln::channel_keys::RevocationBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
21993  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21994  */
21995 typedef struct LDKCResult_RevocationBasepointDecodeErrorZ {
21996    /**
21997     * The contents of this CResult_RevocationBasepointDecodeErrorZ, accessible via either
21998     * `err` or `result` depending on the state of `result_ok`.
21999     */
22000    union LDKCResult_RevocationBasepointDecodeErrorZPtr contents;
22001    /**
22002     * Whether this CResult_RevocationBasepointDecodeErrorZ represents a success state.
22003     */
22004    bool result_ok;
22005 } LDKCResult_RevocationBasepointDecodeErrorZ;
22006
22007
22008
22009 /**
22010  * The revocation key is used to allow a channel party to revoke their state - giving their
22011  * counterparty the required material to claim all of their funds if they broadcast that state.
22012  *
22013  * Each commitment transaction has a revocation key based on the basepoint and
22014  * per_commitment_point which is used in both commitment and HTLC transactions.
22015  *
22016  * See [the BOLT spec for derivation details]
22017  * (https://github.com/lightning/bolts/blob/master/03-transactions.md#revocationpubkey-derivation)
22018  */
22019 typedef struct MUST_USE_STRUCT LDKRevocationKey {
22020    /**
22021     * A pointer to the opaque Rust object.
22022     * Nearly everywhere, inner must be non-null, however in places where
22023     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22024     */
22025    LDKnativeRevocationKey *inner;
22026    /**
22027     * Indicates that this is the only struct which contains the same pointer.
22028     * Rust functions which take ownership of an object provided via an argument require
22029     * this to be true and invalidate the object pointed to by inner.
22030     */
22031    bool is_owned;
22032 } LDKRevocationKey;
22033
22034 /**
22035  * The contents of CResult_RevocationKeyDecodeErrorZ
22036  */
22037 typedef union LDKCResult_RevocationKeyDecodeErrorZPtr {
22038    /**
22039     * A pointer to the contents in the success state.
22040     * Reading from this pointer when `result_ok` is not set is undefined.
22041     */
22042    struct LDKRevocationKey *result;
22043    /**
22044     * A pointer to the contents in the error state.
22045     * Reading from this pointer when `result_ok` is set is undefined.
22046     */
22047    struct LDKDecodeError *err;
22048 } LDKCResult_RevocationKeyDecodeErrorZPtr;
22049
22050 /**
22051  * A CResult_RevocationKeyDecodeErrorZ represents the result of a fallible operation,
22052  * containing a crate::lightning::ln::channel_keys::RevocationKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
22053  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
22054  */
22055 typedef struct LDKCResult_RevocationKeyDecodeErrorZ {
22056    /**
22057     * The contents of this CResult_RevocationKeyDecodeErrorZ, accessible via either
22058     * `err` or `result` depending on the state of `result_ok`.
22059     */
22060    union LDKCResult_RevocationKeyDecodeErrorZPtr contents;
22061    /**
22062     * Whether this CResult_RevocationKeyDecodeErrorZ represents a success state.
22063     */
22064    bool result_ok;
22065 } LDKCResult_RevocationKeyDecodeErrorZ;
22066
22067
22068
22069 /**
22070  * A read-only reference to a current ChannelMonitor.
22071  *
22072  * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
22073  * released.
22074  */
22075 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
22076    /**
22077     * A pointer to the opaque Rust object.
22078     * Nearly everywhere, inner must be non-null, however in places where
22079     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22080     */
22081    LDKnativeLockedChannelMonitor *inner;
22082    /**
22083     * Indicates that this is the only struct which contains the same pointer.
22084     * Rust functions which take ownership of an object provided via an argument require
22085     * this to be true and invalidate the object pointed to by inner.
22086     */
22087    bool is_owned;
22088 } LDKLockedChannelMonitor;
22089
22090 /**
22091  * The contents of CResult_LockedChannelMonitorNoneZ
22092  */
22093 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
22094    /**
22095     * A pointer to the contents in the success state.
22096     * Reading from this pointer when `result_ok` is not set is undefined.
22097     */
22098    struct LDKLockedChannelMonitor *result;
22099    /**
22100     * Note that this value is always NULL, as there are no contents in the Err variant
22101     */
22102    void *err;
22103 } LDKCResult_LockedChannelMonitorNoneZPtr;
22104
22105 /**
22106  * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
22107  * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
22108  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
22109  */
22110 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
22111    /**
22112     * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
22113     * `err` or `result` depending on the state of `result_ok`.
22114     */
22115    union LDKCResult_LockedChannelMonitorNoneZPtr contents;
22116    /**
22117     * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
22118     */
22119    bool result_ok;
22120 } LDKCResult_LockedChannelMonitorNoneZ;
22121
22122 /**
22123  * A tuple of 2 elements. See the individual fields for the types contained.
22124  */
22125 typedef struct LDKC2Tuple_OutPointChannelIdZ {
22126    /**
22127     * The element at position 0
22128     */
22129    struct LDKOutPoint a;
22130    /**
22131     * The element at position 1
22132     */
22133    struct LDKChannelId b;
22134 } LDKC2Tuple_OutPointChannelIdZ;
22135
22136 /**
22137  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointChannelIdZs of arbitrary size.
22138  * This corresponds to std::vector in C++
22139  */
22140 typedef struct LDKCVec_C2Tuple_OutPointChannelIdZZ {
22141    /**
22142     * The elements in the array.
22143     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
22144     */
22145    struct LDKC2Tuple_OutPointChannelIdZ *data;
22146    /**
22147     * The number of elements pointed to by `data`.
22148     */
22149    uintptr_t datalen;
22150 } LDKCVec_C2Tuple_OutPointChannelIdZZ;
22151
22152
22153
22154 /**
22155  * An opaque identifier describing a specific [`Persist`] method call.
22156  */
22157 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
22158    /**
22159     * A pointer to the opaque Rust object.
22160     * Nearly everywhere, inner must be non-null, however in places where
22161     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22162     */
22163    LDKnativeMonitorUpdateId *inner;
22164    /**
22165     * Indicates that this is the only struct which contains the same pointer.
22166     * Rust functions which take ownership of an object provided via an argument require
22167     * this to be true and invalidate the object pointed to by inner.
22168     */
22169    bool is_owned;
22170 } LDKMonitorUpdateId;
22171
22172 /**
22173  * A dynamically-allocated array of crate::lightning::chain::chainmonitor::MonitorUpdateIds of arbitrary size.
22174  * This corresponds to std::vector in C++
22175  */
22176 typedef struct LDKCVec_MonitorUpdateIdZ {
22177    /**
22178     * The elements in the array.
22179     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
22180     */
22181    struct LDKMonitorUpdateId *data;
22182    /**
22183     * The number of elements pointed to by `data`.
22184     */
22185    uintptr_t datalen;
22186 } LDKCVec_MonitorUpdateIdZ;
22187
22188 /**
22189  * A tuple of 2 elements. See the individual fields for the types contained.
22190  */
22191 typedef struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ {
22192    /**
22193     * The element at position 0
22194     */
22195    struct LDKOutPoint a;
22196    /**
22197     * The element at position 1
22198     */
22199    struct LDKCVec_MonitorUpdateIdZ b;
22200 } LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ;
22201
22202 /**
22203  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorUpdateIdZZs of arbitrary size.
22204  * This corresponds to std::vector in C++
22205  */
22206 typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ {
22207    /**
22208     * The elements in the array.
22209     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
22210     */
22211    struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *data;
22212    /**
22213     * The number of elements pointed to by `data`.
22214     */
22215    uintptr_t datalen;
22216 } LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ;
22217
22218 /**
22219  * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
22220  *
22221  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
22222  */
22223 typedef struct LDKPersister {
22224    /**
22225     * An opaque pointer which is passed to your function implementations as an argument.
22226     * This has no meaning in the LDK, and can be NULL or any other value.
22227     */
22228    void *this_arg;
22229    /**
22230     * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
22231     *
22232     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
22233     */
22234    struct LDKCResult_NoneIOErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
22235    /**
22236     * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
22237     */
22238    struct LDKCResult_NoneIOErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
22239    /**
22240     * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
22241     */
22242    struct LDKCResult_NoneIOErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
22243    /**
22244     * Frees any resources associated with this object given its this_arg pointer.
22245     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22246     */
22247    void (*free)(void *this_arg);
22248 } LDKPersister;
22249
22250
22251
22252 /**
22253  * Implements [`Persist`] in a way that writes and reads both [`ChannelMonitor`]s and
22254  * [`ChannelMonitorUpdate`]s.
22255  *
22256  * # Overview
22257  *
22258  * The main benefit this provides over the [`KVStore`]'s [`Persist`] implementation is decreased
22259  * I/O bandwidth and storage churn, at the expense of more IOPS (including listing, reading, and
22260  * deleting) and complexity. This is because it writes channel monitor differential updates,
22261  * whereas the other (default) implementation rewrites the entire monitor on each update. For
22262  * routing nodes, updates can happen many times per second to a channel, and monitors can be tens
22263  * of megabytes (or more). Updates can be as small as a few hundred bytes.
22264  *
22265  * Note that monitors written with `MonitorUpdatingPersister` are _not_ backward-compatible with
22266  * the default [`KVStore`]'s [`Persist`] implementation. They have a prepended byte sequence,
22267  * [`MONITOR_UPDATING_PERSISTER_PREPEND_SENTINEL`], applied to prevent deserialization with other
22268  * persisters. This is because monitors written by this struct _may_ have unapplied updates. In
22269  * order to downgrade, you must ensure that all updates are applied to the monitor, and remove the
22270  * sentinel bytes.
22271  *
22272  * # Storing monitors
22273  *
22274  * Monitors are stored by implementing the [`Persist`] trait, which has two functions:
22275  *
22276  *   - [`Persist::persist_new_channel`], which persists whole [`ChannelMonitor`]s.
22277  *   - [`Persist::update_persisted_channel`], which persists only a [`ChannelMonitorUpdate`]
22278  *
22279  * Whole [`ChannelMonitor`]s are stored in the [`CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE`],
22280  * using the familiar encoding of an [`OutPoint`] (for example, `[SOME-64-CHAR-HEX-STRING]_1`).
22281  *
22282  * Each [`ChannelMonitorUpdate`] is stored in a dynamic secondary namespace, as follows:
22283  *
22284  *   - primary namespace: [`CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE`]
22285  *   - secondary namespace: [the monitor's encoded outpoint name]
22286  *
22287  * Under that secondary namespace, each update is stored with a number string, like `21`, which
22288  * represents its `update_id` value.
22289  *
22290  * For example, consider this channel, named for its transaction ID and index, or [`OutPoint`]:
22291  *
22292  *   - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
22293  *   - Index: `1`
22294  *
22295  * Full channel monitors would be stored at a single key:
22296  *
22297  * `[CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
22298  *
22299  * Updates would be stored as follows (with `/` delimiting primary_namespace/secondary_namespace/key):
22300  *
22301  * ```text
22302  * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/1
22303  * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/2
22304  * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/3
22305  * ```
22306  * ... and so on.
22307  *
22308  * # Reading channel state from storage
22309  *
22310  * Channel state can be reconstructed by calling
22311  * [`MonitorUpdatingPersister::read_all_channel_monitors_with_updates`]. Alternatively, users can
22312  * list channel monitors themselves and load channels individually using
22313  * [`MonitorUpdatingPersister::read_channel_monitor_with_updates`].
22314  *
22315  * ## EXTREMELY IMPORTANT
22316  *
22317  * It is extremely important that your [`KVStore::read`] implementation uses the
22318  * [`io::ErrorKind::NotFound`] variant correctly: that is, when a file is not found, and _only_ in
22319  * that circumstance (not when there is really a permissions error, for example). This is because
22320  * neither channel monitor reading function lists updates. Instead, either reads the monitor, and
22321  * using its stored `update_id`, synthesizes update storage keys, and tries them in sequence until
22322  * one is not found. All _other_ errors will be bubbled up in the function's [`Result`].
22323  *
22324  * # Pruning stale channel updates
22325  *
22326  * Stale updates are pruned when the consolidation threshold is reached according to `maximum_pending_updates`.
22327  * Monitor updates in the range between the latest `update_id` and `update_id - maximum_pending_updates`
22328  * are deleted.
22329  * The `lazy` flag is used on the [`KVStore::remove`] method, so there are no guarantees that the deletions
22330  * will complete. However, stale updates are not a problem for data integrity, since updates are
22331  * only read that are higher than the stored [`ChannelMonitor`]'s `update_id`.
22332  *
22333  * If you have many stale updates stored (such as after a crash with pending lazy deletes), and
22334  * would like to get rid of them, consider using the
22335  * [`MonitorUpdatingPersister::cleanup_stale_updates`] function.
22336  */
22337 typedef struct MUST_USE_STRUCT LDKMonitorUpdatingPersister {
22338    /**
22339     * A pointer to the opaque Rust object.
22340     * Nearly everywhere, inner must be non-null, however in places where
22341     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22342     */
22343    LDKnativeMonitorUpdatingPersister *inner;
22344    /**
22345     * Indicates that this is the only struct which contains the same pointer.
22346     * Rust functions which take ownership of an object provided via an argument require
22347     * this to be true and invalidate the object pointed to by inner.
22348     */
22349    bool is_owned;
22350 } LDKMonitorUpdatingPersister;
22351
22352 /**
22353  * `Persist` defines behavior for persisting channel monitors: this could mean
22354  * writing once to disk, and/or uploading to one or more backup services.
22355  *
22356  * Persistence can happen in one of two ways - synchronously completing before the trait method
22357  * calls return or asynchronously in the background.
22358  *
22359  * # For those implementing synchronous persistence
22360  *
22361  *  * If persistence completes fully (including any relevant `fsync()` calls), the implementation
22362  *    should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal channel operation
22363  *    should continue.
22364  *
22365  *  * If persistence fails for some reason, implementations should consider returning
22366  *    [`ChannelMonitorUpdateStatus::InProgress`] and retry all pending persistence operations in
22367  *    the background with [`ChainMonitor::list_pending_monitor_updates`] and
22368  *    [`ChainMonitor::get_monitor`].
22369  *
22370  *    Once a full [`ChannelMonitor`] has been persisted, all pending updates for that channel can
22371  *    be marked as complete via [`ChainMonitor::channel_monitor_updated`].
22372  *
22373  *    If at some point no further progress can be made towards persisting the pending updates, the
22374  *    node should simply shut down.
22375  *
22376  *  * If the persistence has failed and cannot be retried further (e.g. because of an outage),
22377  *    [`ChannelMonitorUpdateStatus::UnrecoverableError`] can be used, though this will result in
22378  *    an immediate panic and future operations in LDK generally failing.
22379  *
22380  * # For those implementing asynchronous persistence
22381  *
22382  *  All calls should generally spawn a background task and immediately return
22383  *  [`ChannelMonitorUpdateStatus::InProgress`]. Once the update completes,
22384  *  [`ChainMonitor::channel_monitor_updated`] should be called with the corresponding
22385  *  [`MonitorUpdateId`].
22386  *
22387  *  Note that unlike the direct [`chain::Watch`] interface,
22388  *  [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
22389  *
22390  *  If at some point no further progress can be made towards persisting a pending update, the node
22391  *  should simply shut down. Until then, the background task should either loop indefinitely, or
22392  *  persistence should be regularly retried with [`ChainMonitor::list_pending_monitor_updates`]
22393  *  and [`ChainMonitor::get_monitor`] (note that if a full monitor is persisted all pending
22394  *  monitor updates may be marked completed).
22395  *
22396  * # Using remote watchtowers
22397  *
22398  * Watchtowers may be updated as a part of an implementation of this trait, utilizing the async
22399  * update process described above while the watchtower is being updated. The following methods are
22400  * provided for bulding transactions for a watchtower:
22401  * [`ChannelMonitor::initial_counterparty_commitment_tx`],
22402  * [`ChannelMonitor::counterparty_commitment_txs_from_update`],
22403  * [`ChannelMonitor::sign_to_local_justice_tx`], [`TrustedCommitmentTransaction::revokeable_output_index`],
22404  * [`TrustedCommitmentTransaction::build_to_local_justice_tx`].
22405  *
22406  * [`TrustedCommitmentTransaction::revokeable_output_index`]: crate::ln::chan_utils::TrustedCommitmentTransaction::revokeable_output_index
22407  * [`TrustedCommitmentTransaction::build_to_local_justice_tx`]: crate::ln::chan_utils::TrustedCommitmentTransaction::build_to_local_justice_tx
22408  */
22409 typedef struct LDKPersist {
22410    /**
22411     * An opaque pointer which is passed to your function implementations as an argument.
22412     * This has no meaning in the LDK, and can be NULL or any other value.
22413     */
22414    void *this_arg;
22415    /**
22416     * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
22417     * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
22418     *
22419     * The data can be stored any way you want, but the identifier provided by LDK is the
22420     * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
22421     * and the stored channel data). Note that you **must** persist every new monitor to disk.
22422     *
22423     * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
22424     * if you return [`ChannelMonitorUpdateStatus::InProgress`].
22425     *
22426     * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
22427     * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
22428     *
22429     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
22430     * [`Writeable::write`]: crate::util::ser::Writeable::write
22431     */
22432    enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
22433    /**
22434     * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
22435     * update.
22436     *
22437     * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
22438     * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
22439     * details.
22440     *
22441     * During blockchain synchronization operations, and in some rare cases, this may be called with
22442     * no [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
22443     * Note that after the full [`ChannelMonitor`] is persisted any previous
22444     * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
22445     * applied to the persisted [`ChannelMonitor`] as they were already applied.
22446     *
22447     * If an implementer chooses to persist the updates only, they need to make
22448     * sure that all the updates are applied to the `ChannelMonitors` *before*
22449     * the set of channel monitors is given to the `ChannelManager`
22450     * deserialization routine. See [`ChannelMonitor::update_monitor`] for
22451     * applying a monitor update to a monitor. If full `ChannelMonitors` are
22452     * persisted, then there is no need to persist individual updates.
22453     *
22454     * Note that there could be a performance tradeoff between persisting complete
22455     * channel monitors on every update vs. persisting only updates and applying
22456     * them in batches. The size of each monitor grows `O(number of state updates)`
22457     * whereas updates are small and `O(1)`.
22458     *
22459     * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
22460     * if you return [`ChannelMonitorUpdateStatus::InProgress`].
22461     *
22462     * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
22463     * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
22464     * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
22465     *
22466     * [`Writeable::write`]: crate::util::ser::Writeable::write
22467     *
22468     * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
22469     */
22470    enum LDKChannelMonitorUpdateStatus (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint, struct LDKChannelMonitorUpdate update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
22471    /**
22472     * Prevents the channel monitor from being loaded on startup.
22473     *
22474     * Archiving the data in a backup location (rather than deleting it fully) is useful for
22475     * hedging against data loss in case of unexpected failure.
22476     */
22477    void (*archive_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint);
22478    /**
22479     * Frees any resources associated with this object given its this_arg pointer.
22480     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22481     */
22482    void (*free)(void *this_arg);
22483 } LDKPersist;
22484
22485
22486
22487 /**
22488  * A string that displays only printable characters, replacing control characters with
22489  * [`core::char::REPLACEMENT_CHARACTER`].
22490  */
22491 typedef struct MUST_USE_STRUCT LDKPrintableString {
22492    /**
22493     * A pointer to the opaque Rust object.
22494     * Nearly everywhere, inner must be non-null, however in places where
22495     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22496     */
22497    LDKnativePrintableString *inner;
22498    /**
22499     * Indicates that this is the only struct which contains the same pointer.
22500     * Rust functions which take ownership of an object provided via an argument require
22501     * this to be true and invalidate the object pointed to by inner.
22502     */
22503    bool is_owned;
22504 } LDKPrintableString;
22505
22506 /**
22507  * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
22508  * chain.
22509  *
22510  * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
22511  * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
22512  * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
22513  * when needed.
22514  *
22515  * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
22516  * entire header chain and only blocks with matching transaction data using BIP 157 filters or
22517  * other similar filtering.
22518  */
22519 typedef struct LDKListen {
22520    /**
22521     * An opaque pointer which is passed to your function implementations as an argument.
22522     * This has no meaning in the LDK, and can be NULL or any other value.
22523     */
22524    void *this_arg;
22525    /**
22526     * Notifies the listener that a block was added at the given height, with the transaction data
22527     * possibly filtered.
22528     */
22529    void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
22530    /**
22531     * Notifies the listener that a block was added at the given height.
22532     */
22533    void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
22534    /**
22535     * Notifies the listener that a block was removed at the given height.
22536     */
22537    void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
22538    /**
22539     * Frees any resources associated with this object given its this_arg pointer.
22540     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22541     */
22542    void (*free)(void *this_arg);
22543 } LDKListen;
22544
22545 /**
22546  * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
22547  * chain or unconfirmed during a chain reorganization.
22548  *
22549  * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
22550  * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
22551  * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
22552  * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
22553  * with reference to the confirmation status of the monitored objects.
22554  *
22555  * # Use
22556  * The intended use is as follows:
22557  * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
22558  *   outputs are, respectively, confirmed or spent on chain.
22559  * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
22560  *   [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
22561  * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
22562  *
22563  * # Order
22564  *
22565  * Clients must call these methods in chain order. Specifically:
22566  * - Transactions which are confirmed in a particular block must be given before transactions
22567  *   confirmed in a later block.
22568  * - Dependent transactions within the same block must be given in topological order, possibly in
22569  *   separate calls.
22570  * - All unconfirmed transactions must be given after the original confirmations and before *any*
22571  *   reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
22572  *   never be interleaved, but always conduced *en bloc*.
22573  * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
22574  *   in regard to the new block.
22575  *
22576  * See individual method documentation for further details.
22577  *
22578  * [`transactions_confirmed`]: Self::transactions_confirmed
22579  * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
22580  * [`best_block_updated`]: Self::best_block_updated
22581  * [`get_relevant_txids`]: Self::get_relevant_txids
22582  */
22583 typedef struct LDKConfirm {
22584    /**
22585     * An opaque pointer which is passed to your function implementations as an argument.
22586     * This has no meaning in the LDK, and can be NULL or any other value.
22587     */
22588    void *this_arg;
22589    /**
22590     * Notifies LDK of transactions confirmed in a block with a given header and height.
22591     *
22592     * Must be called for any transactions registered by [`Filter::register_tx`] or any
22593     * transactions spending an output registered by [`Filter::register_output`]. Such transactions
22594     * appearing in the same block do not need to be included in the same call; instead, multiple
22595     * calls with additional transactions may be made so long as they are made in [chain order].
22596     *
22597     * May be called before or after [`best_block_updated`] for the corresponding block. However,
22598     * in the event of a chain reorganization, it must not be called with a `header` that is no
22599     * longer in the chain as of the last call to [`best_block_updated`].
22600     *
22601     * [chain order]: Confirm#order
22602     * [`best_block_updated`]: Self::best_block_updated
22603     */
22604    void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
22605    /**
22606     * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
22607     *
22608     * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
22609     * reorganized out of the best chain or if it is no longer confirmed in the block with the
22610     * given block hash. Once called, the given transaction will not be returned
22611     * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
22612     *
22613     * [`get_relevant_txids`]: Self::get_relevant_txids
22614     * [`transactions_confirmed`]: Self::transactions_confirmed
22615     */
22616    void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
22617    /**
22618     * Notifies LDK of an update to the best header connected at the given height.
22619     *
22620     * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
22621     * blocks.
22622     */
22623    void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
22624    /**
22625     * Returns transactions that must be monitored for reorganization out of the chain along
22626     * with the height and the hash of the block as part of which it had been previously confirmed.
22627     *
22628     * Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
22629     * 0.0.112 and prior, in which case you need to manually track previous confirmations.
22630     *
22631     * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
22632     * confirmations to be safe from a chain reorganization. Will not include any transactions
22633     * passed to [`transaction_unconfirmed`], unless later reconfirmed.
22634     *
22635     * Must be called to determine the subset of transactions that must be monitored for
22636     * reorganization. Will be idempotent between calls but may change as a result of calls to the
22637     * other interface methods. Thus, this is useful to determine which transactions must be
22638     * given to [`transaction_unconfirmed`].
22639     *
22640     * If any of the returned transactions are confirmed in a block other than the one with the
22641     * given hash at the given height, they need to be unconfirmed and reconfirmed via
22642     * [`transaction_unconfirmed`] and [`transactions_confirmed`], respectively.
22643     *
22644     * [`transactions_confirmed`]: Self::transactions_confirmed
22645     * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
22646     */
22647    struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ (*get_relevant_txids)(const void *this_arg);
22648    /**
22649     * Frees any resources associated with this object given its this_arg pointer.
22650     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22651     */
22652    void (*free)(void *this_arg);
22653 } LDKConfirm;
22654
22655 /**
22656  * A `enum` signalling to the [`OutputSweeper`] that it should delay spending an output until a
22657  * future block height is reached.
22658  */
22659 typedef enum LDKSpendingDelay_Tag {
22660    /**
22661     * A relative delay indicating we shouldn't spend the output before `cur_height + num_blocks`
22662     * is reached.
22663     */
22664    LDKSpendingDelay_Relative,
22665    /**
22666     * An absolute delay indicating we shouldn't spend the output before `height` is reached.
22667     */
22668    LDKSpendingDelay_Absolute,
22669    /**
22670     * Must be last for serialization purposes
22671     */
22672    LDKSpendingDelay_Sentinel,
22673 } LDKSpendingDelay_Tag;
22674
22675 typedef struct LDKSpendingDelay_LDKRelative_Body {
22676    /**
22677     * The number of blocks until we'll generate and broadcast the spending transaction.
22678     */
22679    uint32_t num_blocks;
22680 } LDKSpendingDelay_LDKRelative_Body;
22681
22682 typedef struct LDKSpendingDelay_LDKAbsolute_Body {
22683    /**
22684     * The height at which we'll generate and broadcast the spending transaction.
22685     */
22686    uint32_t height;
22687 } LDKSpendingDelay_LDKAbsolute_Body;
22688
22689 typedef struct MUST_USE_STRUCT LDKSpendingDelay {
22690    LDKSpendingDelay_Tag tag;
22691    union {
22692       LDKSpendingDelay_LDKRelative_Body relative;
22693       LDKSpendingDelay_LDKAbsolute_Body absolute;
22694    };
22695 } LDKSpendingDelay;
22696
22697 /**
22698  * A callback which is called when a [`Future`] completes.
22699  *
22700  * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
22701  * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
22702  * instead.
22703  *
22704  * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
22705  * futures when they receive a wake, rather than immediately executing them.
22706  */
22707 typedef struct LDKFutureCallback {
22708    /**
22709     * An opaque pointer which is passed to your function implementations as an argument.
22710     * This has no meaning in the LDK, and can be NULL or any other value.
22711     */
22712    void *this_arg;
22713    /**
22714     * The method which is called.
22715     */
22716    void (*call)(const void *this_arg);
22717    /**
22718     * Frees any resources associated with this object given its this_arg pointer.
22719     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22720     */
22721    void (*free)(void *this_arg);
22722 } LDKFutureCallback;
22723
22724
22725
22726 /**
22727  * A struct which can be used to select across many [`Future`]s at once without relying on a full
22728  * async context.
22729  */
22730 typedef struct MUST_USE_STRUCT LDKSleeper {
22731    /**
22732     * A pointer to the opaque Rust object.
22733     * Nearly everywhere, inner must be non-null, however in places where
22734     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22735     */
22736    LDKnativeSleeper *inner;
22737    /**
22738     * Indicates that this is the only struct which contains the same pointer.
22739     * Rust functions which take ownership of an object provided via an argument require
22740     * this to be true and invalidate the object pointed to by inner.
22741     */
22742    bool is_owned;
22743 } LDKSleeper;
22744
22745
22746
22747 /**
22748  * Configuration we set when applicable.
22749  *
22750  * Default::default() provides sane defaults.
22751  */
22752 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
22753    /**
22754     * A pointer to the opaque Rust object.
22755     * Nearly everywhere, inner must be non-null, however in places where
22756     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22757     */
22758    LDKnativeChannelHandshakeConfig *inner;
22759    /**
22760     * Indicates that this is the only struct which contains the same pointer.
22761     * Rust functions which take ownership of an object provided via an argument require
22762     * this to be true and invalidate the object pointed to by inner.
22763     */
22764    bool is_owned;
22765 } LDKChannelHandshakeConfig;
22766
22767
22768
22769 /**
22770  * Optional channel limits which are applied during channel creation.
22771  *
22772  * These limits are only applied to our counterparty's limits, not our own.
22773  *
22774  * Use 0/`<type>::max_value()` as appropriate to skip checking.
22775  *
22776  * Provides sane defaults for most configurations.
22777  *
22778  * Most additional limits are disabled except those with which specify a default in individual
22779  * field documentation. Note that this may result in barely-usable channels, but since they
22780  * are applied mostly only to incoming channels that's not much of a problem.
22781  */
22782 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
22783    /**
22784     * A pointer to the opaque Rust object.
22785     * Nearly everywhere, inner must be non-null, however in places where
22786     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22787     */
22788    LDKnativeChannelHandshakeLimits *inner;
22789    /**
22790     * Indicates that this is the only struct which contains the same pointer.
22791     * Rust functions which take ownership of an object provided via an argument require
22792     * this to be true and invalidate the object pointed to by inner.
22793     */
22794    bool is_owned;
22795 } LDKChannelHandshakeLimits;
22796
22797
22798
22799 /**
22800  * A parallel struct to [`ChannelConfig`] to define partial updates.
22801  */
22802 typedef struct MUST_USE_STRUCT LDKChannelConfigUpdate {
22803    /**
22804     * A pointer to the opaque Rust object.
22805     * Nearly everywhere, inner must be non-null, however in places where
22806     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22807     */
22808    LDKnativeChannelConfigUpdate *inner;
22809    /**
22810     * Indicates that this is the only struct which contains the same pointer.
22811     * Rust functions which take ownership of an object provided via an argument require
22812     * this to be true and invalidate the object pointed to by inner.
22813     */
22814    bool is_owned;
22815 } LDKChannelConfigUpdate;
22816
22817
22818
22819 /**
22820  * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
22821  *
22822  * Default::default() provides sane defaults for most configurations
22823  * (but currently with 0 relay fees!)
22824  */
22825 typedef struct MUST_USE_STRUCT LDKUserConfig {
22826    /**
22827     * A pointer to the opaque Rust object.
22828     * Nearly everywhere, inner must be non-null, however in places where
22829     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22830     */
22831    LDKnativeUserConfig *inner;
22832    /**
22833     * Indicates that this is the only struct which contains the same pointer.
22834     * Rust functions which take ownership of an object provided via an argument require
22835     * this to be true and invalidate the object pointed to by inner.
22836     */
22837    bool is_owned;
22838 } LDKUserConfig;
22839
22840
22841
22842 /**
22843  * An implementation of [`chain::Watch`] for monitoring channels.
22844  *
22845  * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
22846  * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
22847  * or used independently to monitor channels remotely. See the [module-level documentation] for
22848  * details.
22849  *
22850  * Note that `ChainMonitor` should regularly trigger rebroadcasts/fee bumps of pending claims from
22851  * a force-closed channel. This is crucial in preventing certain classes of pinning attacks,
22852  * detecting substantial mempool feerate changes between blocks, and ensuring reliability if
22853  * broadcasting fails. We recommend invoking this every 30 seconds, or lower if running in an
22854  * environment with spotty connections, like on mobile.
22855  *
22856  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
22857  * [module-level documentation]: crate::chain::chainmonitor
22858  * [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
22859  */
22860 typedef struct MUST_USE_STRUCT LDKChainMonitor {
22861    /**
22862     * A pointer to the opaque Rust object.
22863     * Nearly everywhere, inner must be non-null, however in places where
22864     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22865     */
22866    LDKnativeChainMonitor *inner;
22867    /**
22868     * Indicates that this is the only struct which contains the same pointer.
22869     * Rust functions which take ownership of an object provided via an argument require
22870     * this to be true and invalidate the object pointed to by inner.
22871     */
22872    bool is_owned;
22873 } LDKChainMonitor;
22874
22875 /**
22876  * A trait implemented for objects handling events from [`EventsProvider`].
22877  *
22878  * An async variation also exists for implementations of [`EventsProvider`] that support async
22879  * event handling. The async event handler should satisfy the generic bounds: `F:
22880  * core::future::Future, H: Fn(Event) -> F`.
22881  */
22882 typedef struct LDKEventHandler {
22883    /**
22884     * An opaque pointer which is passed to your function implementations as an argument.
22885     * This has no meaning in the LDK, and can be NULL or any other value.
22886     */
22887    void *this_arg;
22888    /**
22889     * Handles the given [`Event`].
22890     *
22891     * See [`EventsProvider`] for details that must be considered when implementing this method.
22892     */
22893    void (*handle_event)(const void *this_arg, struct LDKEvent event);
22894    /**
22895     * Frees any resources associated with this object given its this_arg pointer.
22896     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22897     */
22898    void (*free)(void *this_arg);
22899 } LDKEventHandler;
22900
22901 /**
22902  * A trait indicating an object may generate events.
22903  *
22904  * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
22905  *
22906  * Implementations of this trait may also feature an async version of event handling, as shown with
22907  * [`ChannelManager::process_pending_events_async`] and
22908  * [`ChainMonitor::process_pending_events_async`].
22909  *
22910  * # Requirements
22911  *
22912  * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
22913  * event since the last invocation.
22914  *
22915  * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
22916  * and replay any unhandled events on startup. An [`Event`] is considered handled when
22917  * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
22918  * relevant changes to disk *before* returning.
22919  *
22920  * Further, because an application may crash between an [`Event`] being handled and the
22921  * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
22922  * effect, [`Event`]s may be replayed.
22923  *
22924  * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
22925  * consult the provider's documentation on the implication of processing events and how a handler
22926  * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
22927  * [`ChainMonitor::process_pending_events`]).
22928  *
22929  * (C-not implementable) As there is likely no reason for a user to implement this trait on their
22930  * own type(s).
22931  *
22932  * [`process_pending_events`]: Self::process_pending_events
22933  * [`handle_event`]: EventHandler::handle_event
22934  * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
22935  * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
22936  * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
22937  * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
22938  */
22939 typedef struct LDKEventsProvider {
22940    /**
22941     * An opaque pointer which is passed to your function implementations as an argument.
22942     * This has no meaning in the LDK, and can be NULL or any other value.
22943     */
22944    void *this_arg;
22945    /**
22946     * Processes any events generated since the last call using the given event handler.
22947     *
22948     * See the trait-level documentation for requirements.
22949     */
22950    void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
22951    /**
22952     * Frees any resources associated with this object given its this_arg pointer.
22953     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22954     */
22955    void (*free)(void *this_arg);
22956 } LDKEventsProvider;
22957
22958 /**
22959  * This enum is used to specify which error data to send to peers when failing back an HTLC
22960  * using [`ChannelManager::fail_htlc_backwards_with_reason`].
22961  *
22962  * For more info on failure codes, see <https://github.com/lightning/bolts/blob/master/04-onion-routing.md#failure-messages>.
22963  */
22964 typedef enum LDKFailureCode_Tag {
22965    /**
22966     * We had a temporary error processing the payment. Useful if no other error codes fit
22967     * and you want to indicate that the payer may want to retry.
22968     */
22969    LDKFailureCode_TemporaryNodeFailure,
22970    /**
22971     * We have a required feature which was not in this onion. For example, you may require
22972     * some additional metadata that was not provided with this payment.
22973     */
22974    LDKFailureCode_RequiredNodeFeatureMissing,
22975    /**
22976     * You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of
22977     * the HTLC is too close to the current block height for safe handling.
22978     * Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is
22979     * equivalent to calling [`ChannelManager::fail_htlc_backwards`].
22980     */
22981    LDKFailureCode_IncorrectOrUnknownPaymentDetails,
22982    /**
22983     * We failed to process the payload after the onion was decrypted. You may wish to
22984     * use this when receiving custom HTLC TLVs with even type numbers that you don't recognize.
22985     *
22986     * If available, the tuple data may include the type number and byte offset in the
22987     * decrypted byte stream where the failure occurred.
22988     */
22989    LDKFailureCode_InvalidOnionPayload,
22990    /**
22991     * Must be last for serialization purposes
22992     */
22993    LDKFailureCode_Sentinel,
22994 } LDKFailureCode_Tag;
22995
22996 typedef struct MUST_USE_STRUCT LDKFailureCode {
22997    LDKFailureCode_Tag tag;
22998    union {
22999       struct {
23000          struct LDKCOption_C2Tuple_u64u16ZZ invalid_onion_payload;
23001       };
23002    };
23003 } LDKFailureCode;
23004
23005
23006
23007 /**
23008  * Chain-related parameters used to construct a new `ChannelManager`.
23009  *
23010  * Typically, the block-specific parameters are derived from the best block hash for the network,
23011  * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
23012  * are not needed when deserializing a previously constructed `ChannelManager`.
23013  */
23014 typedef struct MUST_USE_STRUCT LDKChainParameters {
23015    /**
23016     * A pointer to the opaque Rust object.
23017     * Nearly everywhere, inner must be non-null, however in places where
23018     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23019     */
23020    LDKnativeChainParameters *inner;
23021    /**
23022     * Indicates that this is the only struct which contains the same pointer.
23023     * Rust functions which take ownership of an object provided via an argument require
23024     * this to be true and invalidate the object pointed to by inner.
23025     */
23026    bool is_owned;
23027 } LDKChainParameters;
23028
23029 /**
23030  * A trait indicating an object may generate message send events
23031  */
23032 typedef struct LDKMessageSendEventsProvider {
23033    /**
23034     * An opaque pointer which is passed to your function implementations as an argument.
23035     * This has no meaning in the LDK, and can be NULL or any other value.
23036     */
23037    void *this_arg;
23038    /**
23039     * Gets the list of pending events which were generated by previous actions, clearing the list
23040     * in the process.
23041     */
23042    struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
23043    /**
23044     * Frees any resources associated with this object given its this_arg pointer.
23045     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23046     */
23047    void (*free)(void *this_arg);
23048 } LDKMessageSendEventsProvider;
23049
23050 /**
23051  * A trait to describe an object which can receive channel messages.
23052  *
23053  * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
23054  * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
23055  */
23056 typedef struct LDKChannelMessageHandler {
23057    /**
23058     * An opaque pointer which is passed to your function implementations as an argument.
23059     * This has no meaning in the LDK, and can be NULL or any other value.
23060     */
23061    void *this_arg;
23062    /**
23063     * Handle an incoming `open_channel` message from the given peer.
23064     */
23065    void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg);
23066    /**
23067     * Handle an incoming `open_channel2` message from the given peer.
23068     */
23069    void (*handle_open_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannelV2 *NONNULL_PTR msg);
23070    /**
23071     * Handle an incoming `accept_channel` message from the given peer.
23072     */
23073    void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg);
23074    /**
23075     * Handle an incoming `accept_channel2` message from the given peer.
23076     */
23077    void (*handle_accept_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannelV2 *NONNULL_PTR msg);
23078    /**
23079     * Handle an incoming `funding_created` message from the given peer.
23080     */
23081    void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
23082    /**
23083     * Handle an incoming `funding_signed` message from the given peer.
23084     */
23085    void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
23086    /**
23087     * Handle an incoming `channel_ready` message from the given peer.
23088     */
23089    void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
23090    /**
23091     * Handle an incoming `shutdown` message from the given peer.
23092     */
23093    void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
23094    /**
23095     * Handle an incoming `closing_signed` message from the given peer.
23096     */
23097    void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
23098    /**
23099     * Handle an incoming `stfu` message from the given peer.
23100     */
23101    void (*handle_stfu)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKStfu *NONNULL_PTR msg);
23102    /**
23103     * Handle an incoming `tx_add_input message` from the given peer.
23104     */
23105    void (*handle_tx_add_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddInput *NONNULL_PTR msg);
23106    /**
23107     * Handle an incoming `tx_add_output` message from the given peer.
23108     */
23109    void (*handle_tx_add_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddOutput *NONNULL_PTR msg);
23110    /**
23111     * Handle an incoming `tx_remove_input` message from the given peer.
23112     */
23113    void (*handle_tx_remove_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveInput *NONNULL_PTR msg);
23114    /**
23115     * Handle an incoming `tx_remove_output` message from the given peer.
23116     */
23117    void (*handle_tx_remove_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveOutput *NONNULL_PTR msg);
23118    /**
23119     * Handle an incoming `tx_complete message` from the given peer.
23120     */
23121    void (*handle_tx_complete)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxComplete *NONNULL_PTR msg);
23122    /**
23123     * Handle an incoming `tx_signatures` message from the given peer.
23124     */
23125    void (*handle_tx_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxSignatures *NONNULL_PTR msg);
23126    /**
23127     * Handle an incoming `tx_init_rbf` message from the given peer.
23128     */
23129    void (*handle_tx_init_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxInitRbf *NONNULL_PTR msg);
23130    /**
23131     * Handle an incoming `tx_ack_rbf` message from the given peer.
23132     */
23133    void (*handle_tx_ack_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAckRbf *NONNULL_PTR msg);
23134    /**
23135     * Handle an incoming `tx_abort message` from the given peer.
23136     */
23137    void (*handle_tx_abort)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAbort *NONNULL_PTR msg);
23138    /**
23139     * Handle an incoming `update_add_htlc` message from the given peer.
23140     */
23141    void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
23142    /**
23143     * Handle an incoming `update_fulfill_htlc` message from the given peer.
23144     */
23145    void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
23146    /**
23147     * Handle an incoming `update_fail_htlc` message from the given peer.
23148     */
23149    void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
23150    /**
23151     * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
23152     */
23153    void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
23154    /**
23155     * Handle an incoming `commitment_signed` message from the given peer.
23156     */
23157    void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
23158    /**
23159     * Handle an incoming `revoke_and_ack` message from the given peer.
23160     */
23161    void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
23162    /**
23163     * Handle an incoming `update_fee` message from the given peer.
23164     */
23165    void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
23166    /**
23167     * Handle an incoming `announcement_signatures` message from the given peer.
23168     */
23169    void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
23170    /**
23171     * Indicates a connection to the peer failed/an existing connection was lost.
23172     */
23173    void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
23174    /**
23175     * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
23176     *
23177     * May return an `Err(())` if the features the peer supports are not sufficient to communicate
23178     * with us. Implementors should be somewhat conservative about doing so, however, as other
23179     * message handlers may still wish to communicate with this peer.
23180     */
23181    struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
23182    /**
23183     * Handle an incoming `channel_reestablish` message from the given peer.
23184     */
23185    void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
23186    /**
23187     * Handle an incoming `channel_update` message from the given peer.
23188     */
23189    void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
23190    /**
23191     * Handle an incoming `error` message from the given peer.
23192     */
23193    void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
23194    /**
23195     * Gets the node feature flags which this handler itself supports. All available handlers are
23196     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
23197     * which are broadcasted in our [`NodeAnnouncement`] message.
23198     */
23199    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
23200    /**
23201     * Gets the init feature flags which should be sent to the given peer. All available handlers
23202     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
23203     * which are sent in our [`Init`] message.
23204     *
23205     * Note that this method is called before [`Self::peer_connected`].
23206     */
23207    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
23208    /**
23209     * Gets the chain hashes for this `ChannelMessageHandler` indicating which chains it supports.
23210     *
23211     * If it's `None`, then no particular network chain hash compatibility will be enforced when
23212     * connecting to peers.
23213     */
23214    struct LDKCOption_CVec_ThirtyTwoBytesZZ (*get_chain_hashes)(const void *this_arg);
23215    /**
23216     * Implementation of MessageSendEventsProvider for this object.
23217     */
23218    struct LDKMessageSendEventsProvider MessageSendEventsProvider;
23219    /**
23220     * Frees any resources associated with this object given its this_arg pointer.
23221     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23222     */
23223    void (*free)(void *this_arg);
23224 } LDKChannelMessageHandler;
23225
23226 /**
23227  * A handler for an [`OnionMessage`] containing a BOLT 12 Offers message as its payload.
23228  *
23229  * [`OnionMessage`]: crate::ln::msgs::OnionMessage
23230  */
23231 typedef struct LDKOffersMessageHandler {
23232    /**
23233     * An opaque pointer which is passed to your function implementations as an argument.
23234     * This has no meaning in the LDK, and can be NULL or any other value.
23235     */
23236    void *this_arg;
23237    /**
23238     * Handles the given message by either responding with an [`Bolt12Invoice`], sending a payment,
23239     * or replying with an error.
23240     *
23241     * The returned [`OffersMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
23242     *
23243     * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
23244     */
23245    struct LDKCOption_OffersMessageZ (*handle_message)(const void *this_arg, struct LDKOffersMessage message);
23246    /**
23247     * Releases any [`OffersMessage`]s that need to be sent.
23248     *
23249     * Typically, this is used for messages initiating a payment flow rather than in response to
23250     * another message. The latter should use the return value of [`Self::handle_message`].
23251     */
23252    struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ (*release_pending_messages)(const void *this_arg);
23253    /**
23254     * Frees any resources associated with this object given its this_arg pointer.
23255     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23256     */
23257    void (*free)(void *this_arg);
23258 } LDKOffersMessageHandler;
23259
23260 /**
23261  * An interface for looking up the node id of a channel counterparty for the purpose of forwarding
23262  * an [`OnionMessage`].
23263  *
23264  * [`OnionMessage`]: crate::ln::msgs::OnionMessage
23265  */
23266 typedef struct LDKNodeIdLookUp {
23267    /**
23268     * An opaque pointer which is passed to your function implementations as an argument.
23269     * This has no meaning in the LDK, and can be NULL or any other value.
23270     */
23271    void *this_arg;
23272    /**
23273     * Returns the node id of the forwarding node's channel counterparty with `short_channel_id`.
23274     *
23275     * Here, the forwarding node is referring to the node of the [`OnionMessenger`] parameterized
23276     * by the [`NodeIdLookUp`] and the counterparty to one of that node's peers.
23277     *
23278     * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
23279     *
23280     * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23281     */
23282    struct LDKPublicKey (*next_node_id)(const void *this_arg, uint64_t short_channel_id);
23283    /**
23284     * Frees any resources associated with this object given its this_arg pointer.
23285     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23286     */
23287    void (*free)(void *this_arg);
23288 } LDKNodeIdLookUp;
23289
23290
23291
23292 /**
23293  * Arguments for the creation of a ChannelManager that are not deserialized.
23294  *
23295  * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
23296  * is:
23297  * 1) Deserialize all stored [`ChannelMonitor`]s.
23298  * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
23299  *    `<(BlockHash, ChannelManager)>::read(reader, args)`
23300  *    This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
23301  *    [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
23302  * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
23303  *    same way you would handle a [`chain::Filter`] call using
23304  *    [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
23305  * 4) Reconnect blocks on your [`ChannelMonitor`]s.
23306  * 5) Disconnect/connect blocks on the [`ChannelManager`].
23307  * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
23308  *    Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
23309  *    will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
23310  *    the next step.
23311  * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
23312  *    [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
23313  *
23314  * Note that the ordering of #4-7 is not of importance, however all four must occur before you
23315  * call any other methods on the newly-deserialized [`ChannelManager`].
23316  *
23317  * Note that because some channels may be closed during deserialization, it is critical that you
23318  * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
23319  * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
23320  * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
23321  * not force-close the same channels but consider them live), you may end up revoking a state for
23322  * which you've already broadcasted the transaction.
23323  *
23324  * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
23325  */
23326 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
23327    /**
23328     * A pointer to the opaque Rust object.
23329     * Nearly everywhere, inner must be non-null, however in places where
23330     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23331     */
23332    LDKnativeChannelManagerReadArgs *inner;
23333    /**
23334     * Indicates that this is the only struct which contains the same pointer.
23335     * Rust functions which take ownership of an object provided via an argument require
23336     * this to be true and invalidate the object pointed to by inner.
23337     */
23338    bool is_owned;
23339 } LDKChannelManagerReadArgs;
23340
23341
23342
23343 /**
23344  * A set of keys that were HKDF-expanded from an initial call to
23345  * [`NodeSigner::get_inbound_payment_key_material`].
23346  *
23347  * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
23348  */
23349 typedef struct MUST_USE_STRUCT LDKExpandedKey {
23350    /**
23351     * A pointer to the opaque Rust object.
23352     * Nearly everywhere, inner must be non-null, however in places where
23353     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23354     */
23355    LDKnativeExpandedKey *inner;
23356    /**
23357     * Indicates that this is the only struct which contains the same pointer.
23358     * Rust functions which take ownership of an object provided via an argument require
23359     * this to be true and invalidate the object pointed to by inner.
23360     */
23361    bool is_owned;
23362 } LDKExpandedKey;
23363
23364
23365
23366 /**
23367  * Contains fields that are both common to [`open_channel`] and `open_channel2` messages.
23368  *
23369  * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
23370  */
23371 typedef struct MUST_USE_STRUCT LDKCommonOpenChannelFields {
23372    /**
23373     * A pointer to the opaque Rust object.
23374     * Nearly everywhere, inner must be non-null, however in places where
23375     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23376     */
23377    LDKnativeCommonOpenChannelFields *inner;
23378    /**
23379     * Indicates that this is the only struct which contains the same pointer.
23380     * Rust functions which take ownership of an object provided via an argument require
23381     * this to be true and invalidate the object pointed to by inner.
23382     */
23383    bool is_owned;
23384 } LDKCommonOpenChannelFields;
23385
23386
23387
23388 /**
23389  * Contains fields that are both common to [`accept_channel`] and `accept_channel2` messages.
23390  *
23391  * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
23392  */
23393 typedef struct MUST_USE_STRUCT LDKCommonAcceptChannelFields {
23394    /**
23395     * A pointer to the opaque Rust object.
23396     * Nearly everywhere, inner must be non-null, however in places where
23397     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23398     */
23399    LDKnativeCommonAcceptChannelFields *inner;
23400    /**
23401     * Indicates that this is the only struct which contains the same pointer.
23402     * Rust functions which take ownership of an object provided via an argument require
23403     * this to be true and invalidate the object pointed to by inner.
23404     */
23405    bool is_owned;
23406 } LDKCommonAcceptChannelFields;
23407
23408
23409
23410 /**
23411  * Packet of hop data for next peer
23412  */
23413 typedef struct MUST_USE_STRUCT LDKPacket {
23414    /**
23415     * A pointer to the opaque Rust object.
23416     * Nearly everywhere, inner must be non-null, however in places where
23417     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23418     */
23419    LDKnativePacket *inner;
23420    /**
23421     * Indicates that this is the only struct which contains the same pointer.
23422     * Rust functions which take ownership of an object provided via an argument require
23423     * this to be true and invalidate the object pointed to by inner.
23424     */
23425    bool is_owned;
23426 } LDKPacket;
23427
23428 /**
23429  * A trait to describe an object which can receive routing messages.
23430  *
23431  * # Implementor DoS Warnings
23432  *
23433  * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
23434  * handling inbound queries. Implementors using an on-disk network graph should be aware of
23435  * repeated disk I/O for queries accessing different parts of the network graph.
23436  */
23437 typedef struct LDKRoutingMessageHandler {
23438    /**
23439     * An opaque pointer which is passed to your function implementations as an argument.
23440     * This has no meaning in the LDK, and can be NULL or any other value.
23441     */
23442    void *this_arg;
23443    /**
23444     * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
23445     * `false` or returning an `Err` otherwise.
23446     */
23447    struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
23448    /**
23449     * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
23450     * or returning an `Err` otherwise.
23451     */
23452    struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
23453    /**
23454     * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
23455     * `false` or returning an `Err` otherwise.
23456     */
23457    struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
23458    /**
23459     * Gets channel announcements and updates required to dump our routing table to a remote node,
23460     * starting at the `short_channel_id` indicated by `starting_point` and including announcements
23461     * for a single channel.
23462     */
23463    struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
23464    /**
23465     * Gets a node announcement required to dump our routing table to a remote node, starting at
23466     * the node *after* the provided pubkey and including up to one announcement immediately
23467     * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
23468     * If `None` is provided for `starting_point`, we start at the first node.
23469     *
23470     * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
23471     * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23472     */
23473    struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKNodeId starting_point);
23474    /**
23475     * Called when a connection is established with a peer. This can be used to
23476     * perform routing table synchronization using a strategy defined by the
23477     * implementor.
23478     *
23479     * May return an `Err(())` if the features the peer supports are not sufficient to communicate
23480     * with us. Implementors should be somewhat conservative about doing so, however, as other
23481     * message handlers may still wish to communicate with this peer.
23482     */
23483    struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
23484    /**
23485     * Handles the reply of a query we initiated to learn about channels
23486     * for a given range of blocks. We can expect to receive one or more
23487     * replies to a single query.
23488     */
23489    struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
23490    /**
23491     * Handles the reply of a query we initiated asking for routing gossip
23492     * messages for a list of channels. We should receive this message when
23493     * a node has completed its best effort to send us the pertaining routing
23494     * gossip messages.
23495     */
23496    struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
23497    /**
23498     * Handles when a peer asks us to send a list of `short_channel_id`s
23499     * for the requested range of blocks.
23500     */
23501    struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
23502    /**
23503     * Handles when a peer asks us to send routing gossip messages for a
23504     * list of `short_channel_id`s.
23505     */
23506    struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
23507    /**
23508     * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
23509     * pending some async action. While there is no guarantee of the rate of future messages, the
23510     * caller should seek to reduce the rate of new gossip messages handled, especially
23511     * [`ChannelAnnouncement`]s.
23512     */
23513    bool (*processing_queue_high)(const void *this_arg);
23514    /**
23515     * Gets the node feature flags which this handler itself supports. All available handlers are
23516     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
23517     * which are broadcasted in our [`NodeAnnouncement`] message.
23518     */
23519    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
23520    /**
23521     * Gets the init feature flags which should be sent to the given peer. All available handlers
23522     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
23523     * which are sent in our [`Init`] message.
23524     *
23525     * Note that this method is called before [`Self::peer_connected`].
23526     */
23527    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
23528    /**
23529     * Implementation of MessageSendEventsProvider for this object.
23530     */
23531    struct LDKMessageSendEventsProvider MessageSendEventsProvider;
23532    /**
23533     * Frees any resources associated with this object given its this_arg pointer.
23534     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23535     */
23536    void (*free)(void *this_arg);
23537 } LDKRoutingMessageHandler;
23538
23539 /**
23540  * A handler for received [`OnionMessage`]s and for providing generated ones to send.
23541  */
23542 typedef struct LDKOnionMessageHandler {
23543    /**
23544     * An opaque pointer which is passed to your function implementations as an argument.
23545     * This has no meaning in the LDK, and can be NULL or any other value.
23546     */
23547    void *this_arg;
23548    /**
23549     * Because much of the lightning network does not yet support forwarding onion messages, we
23550     * may need to directly connect to a node which will forward a message for us. In such a case,
23551     * this method will return the set of nodes which need connection by node_id and the
23552     * corresponding socket addresses where they may accept incoming connections.
23553     *
23554     * Thus, this method should be polled regularly to detect messages await such a direct
23555     * connection.
23556     */
23557    struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ (*get_and_clear_connections_needed)(const void *this_arg);
23558    /**
23559     * Handle an incoming `onion_message` message from the given peer.
23560     */
23561    void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
23562    /**
23563     * Returns the next pending onion message for the peer with the given node id.
23564     *
23565     * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23566     */
23567    struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
23568    /**
23569     * Called when a connection is established with a peer. Can be used to track which peers
23570     * advertise onion message support and are online.
23571     *
23572     * May return an `Err(())` if the features the peer supports are not sufficient to communicate
23573     * with us. Implementors should be somewhat conservative about doing so, however, as other
23574     * message handlers may still wish to communicate with this peer.
23575     */
23576    struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
23577    /**
23578     * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
23579     * drop and refuse to forward onion messages to this peer.
23580     */
23581    void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
23582    /**
23583     * Performs actions that should happen roughly every ten seconds after startup. Allows handlers
23584     * to drop any buffered onion messages intended for prospective peers.
23585     */
23586    void (*timer_tick_occurred)(const void *this_arg);
23587    /**
23588     * Gets the node feature flags which this handler itself supports. All available handlers are
23589     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
23590     * which are broadcasted in our [`NodeAnnouncement`] message.
23591     */
23592    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
23593    /**
23594     * Gets the init feature flags which should be sent to the given peer. All available handlers
23595     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
23596     * which are sent in our [`Init`] message.
23597     *
23598     * Note that this method is called before [`Self::peer_connected`].
23599     */
23600    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
23601    /**
23602     * Frees any resources associated with this object given its this_arg pointer.
23603     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23604     */
23605    void (*free)(void *this_arg);
23606 } LDKOnionMessageHandler;
23607
23608
23609
23610 /**
23611  * BOLT 4 onion packet including hop data for the next peer.
23612  */
23613 typedef struct MUST_USE_STRUCT LDKTrampolineOnionPacket {
23614    /**
23615     * A pointer to the opaque Rust object.
23616     * Nearly everywhere, inner must be non-null, however in places where
23617     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23618     */
23619    LDKnativeTrampolineOnionPacket *inner;
23620    /**
23621     * Indicates that this is the only struct which contains the same pointer.
23622     * Rust functions which take ownership of an object provided via an argument require
23623     * this to be true and invalidate the object pointed to by inner.
23624     */
23625    bool is_owned;
23626 } LDKTrampolineOnionPacket;
23627
23628 /**
23629  * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
23630  * decoders.
23631  */
23632 typedef struct LDKCustomMessageReader {
23633    /**
23634     * An opaque pointer which is passed to your function implementations as an argument.
23635     * This has no meaning in the LDK, and can be NULL or any other value.
23636     */
23637    void *this_arg;
23638    /**
23639     * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
23640     * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
23641     * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
23642     * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
23643     */
23644    struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
23645    /**
23646     * Frees any resources associated with this object given its this_arg pointer.
23647     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23648     */
23649    void (*free)(void *this_arg);
23650 } LDKCustomMessageReader;
23651
23652 /**
23653  * A handler provided to [`PeerManager`] for reading and handling custom messages.
23654  *
23655  * [BOLT 1] specifies a custom message type range for use with experimental or application-specific
23656  * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the
23657  * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler.
23658  *
23659  * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
23660  * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message
23661  */
23662 typedef struct LDKCustomMessageHandler {
23663    /**
23664     * An opaque pointer which is passed to your function implementations as an argument.
23665     * This has no meaning in the LDK, and can be NULL or any other value.
23666     */
23667    void *this_arg;
23668    /**
23669     * Handles the given message sent from `sender_node_id`, possibly producing messages for
23670     * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`]
23671     * to send.
23672     */
23673    struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
23674    /**
23675     * Returns the list of pending messages that were generated by the handler, clearing the list
23676     * in the process. Each message is paired with the node id of the intended recipient. If no
23677     * connection to the node exists, then the message is simply not sent.
23678     */
23679    struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
23680    /**
23681     * Gets the node feature flags which this handler itself supports. All available handlers are
23682     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
23683     * which are broadcasted in our [`NodeAnnouncement`] message.
23684     *
23685     * [`NodeAnnouncement`]: crate::ln::msgs::NodeAnnouncement
23686     */
23687    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
23688    /**
23689     * Gets the init feature flags which should be sent to the given peer. All available handlers
23690     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
23691     * which are sent in our [`Init`] message.
23692     *
23693     * [`Init`]: crate::ln::msgs::Init
23694     */
23695    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
23696    /**
23697     * Implementation of CustomMessageReader for this object.
23698     */
23699    struct LDKCustomMessageReader CustomMessageReader;
23700    /**
23701     * Frees any resources associated with this object given its this_arg pointer.
23702     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23703     */
23704    void (*free)(void *this_arg);
23705 } LDKCustomMessageHandler;
23706
23707
23708
23709 /**
23710  * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
23711  * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
23712  */
23713 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
23714    /**
23715     * A pointer to the opaque Rust object.
23716     * Nearly everywhere, inner must be non-null, however in places where
23717     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23718     */
23719    LDKnativeIgnoringMessageHandler *inner;
23720    /**
23721     * Indicates that this is the only struct which contains the same pointer.
23722     * Rust functions which take ownership of an object provided via an argument require
23723     * this to be true and invalidate the object pointed to by inner.
23724     */
23725    bool is_owned;
23726 } LDKIgnoringMessageHandler;
23727
23728 /**
23729  * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
23730  * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
23731  * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
23732  * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
23733  * message types.
23734  *
23735  * See [`OnionMessenger`] for example usage.
23736  *
23737  * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
23738  * [`CustomMessage`]: Self::CustomMessage
23739  */
23740 typedef struct LDKCustomOnionMessageHandler {
23741    /**
23742     * An opaque pointer which is passed to your function implementations as an argument.
23743     * This has no meaning in the LDK, and can be NULL or any other value.
23744     */
23745    void *this_arg;
23746    /**
23747     * Called with the custom message that was received, returning a response to send, if any.
23748     *
23749     * The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
23750     */
23751    struct LDKCOption_OnionMessageContentsZ (*handle_custom_message)(const void *this_arg, struct LDKOnionMessageContents msg);
23752    /**
23753     * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
23754     * message type is unknown.
23755     */
23756    struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
23757    /**
23758     * Releases any [`Self::CustomMessage`]s that need to be sent.
23759     *
23760     * Typically, this is used for messages initiating a message flow rather than in response to
23761     * another message. The latter should use the return value of [`Self::handle_custom_message`].
23762     */
23763    struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ (*release_pending_custom_messages)(const void *this_arg);
23764    /**
23765     * Frees any resources associated with this object given its this_arg pointer.
23766     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23767     */
23768    void (*free)(void *this_arg);
23769 } LDKCustomOnionMessageHandler;
23770
23771
23772
23773 /**
23774  * A dummy struct which implements `ChannelMessageHandler` without having any channels.
23775  * You can provide one of these as the route_handler in a MessageHandler.
23776  */
23777 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
23778    /**
23779     * A pointer to the opaque Rust object.
23780     * Nearly everywhere, inner must be non-null, however in places where
23781     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23782     */
23783    LDKnativeErroringMessageHandler *inner;
23784    /**
23785     * Indicates that this is the only struct which contains the same pointer.
23786     * Rust functions which take ownership of an object provided via an argument require
23787     * this to be true and invalidate the object pointed to by inner.
23788     */
23789    bool is_owned;
23790 } LDKErroringMessageHandler;
23791
23792
23793
23794 /**
23795  * Provides references to trait impls which handle different types of messages.
23796  */
23797 typedef struct MUST_USE_STRUCT LDKMessageHandler {
23798    /**
23799     * A pointer to the opaque Rust object.
23800     * Nearly everywhere, inner must be non-null, however in places where
23801     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23802     */
23803    LDKnativeMessageHandler *inner;
23804    /**
23805     * Indicates that this is the only struct which contains the same pointer.
23806     * Rust functions which take ownership of an object provided via an argument require
23807     * this to be true and invalidate the object pointed to by inner.
23808     */
23809    bool is_owned;
23810 } LDKMessageHandler;
23811
23812 /**
23813  * Provides an object which can be used to send data to and which uniquely identifies a connection
23814  * to a remote host. You will need to be able to generate multiple of these which meet Eq and
23815  * implement Hash to meet the PeerManager API.
23816  *
23817  * For efficiency, [`Clone`] should be relatively cheap for this type.
23818  *
23819  * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
23820  * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
23821  * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
23822  * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
23823  * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
23824  * to simply use another value which is guaranteed to be globally unique instead.
23825  */
23826 typedef struct LDKSocketDescriptor {
23827    /**
23828     * An opaque pointer which is passed to your function implementations as an argument.
23829     * This has no meaning in the LDK, and can be NULL or any other value.
23830     */
23831    void *this_arg;
23832    /**
23833     * Attempts to send some data from the given slice to the peer.
23834     *
23835     * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
23836     * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
23837     * called and further write attempts may occur until that time.
23838     *
23839     * If the returned size is smaller than `data.len()`, a
23840     * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
23841     * written. Additionally, until a `send_data` event completes fully, no further
23842     * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
23843     * prevent denial-of-service issues, you should not read or buffer any data from the socket
23844     * until then.
23845     *
23846     * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
23847     * (indicating that read events should be paused to prevent DoS in the send buffer),
23848     * `resume_read` may be set indicating that read events on this descriptor should resume. A
23849     * `resume_read` of false carries no meaning, and should not cause any action.
23850     */
23851    uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
23852    /**
23853     * Disconnect the socket pointed to by this SocketDescriptor.
23854     *
23855     * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
23856     * call (doing so is a noop).
23857     */
23858    void (*disconnect_socket)(void *this_arg);
23859    /**
23860     * Checks if two objects are equal given this object's this_arg pointer and another object.
23861     */
23862    bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
23863    /**
23864     * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
23865     * This is used, for example, for inclusion of this object in a hash map.
23866     */
23867    uint64_t (*hash)(const void *this_arg);
23868    /**
23869     * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
23870     * The new SocketDescriptor is provided, and should be mutated as needed to perform a
23871     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
23872     */
23873    void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
23874    /**
23875     * Frees any resources associated with this object given its this_arg pointer.
23876     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23877     */
23878    void (*free)(void *this_arg);
23879 } LDKSocketDescriptor;
23880
23881
23882
23883 /**
23884  * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
23885  * socket events into messages which it passes on to its [`MessageHandler`].
23886  *
23887  * Locks are taken internally, so you must never assume that reentrancy from a
23888  * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
23889  *
23890  * Calls to [`read_event`] will decode relevant messages and pass them to the
23891  * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
23892  * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
23893  * [`PeerManager`] functions related to the same connection must occur only in serial, making new
23894  * calls only after previous ones have returned.
23895  *
23896  * Rather than using a plain [`PeerManager`], it is preferable to use either a [`SimpleArcPeerManager`]
23897  * a [`SimpleRefPeerManager`], for conciseness. See their documentation for more details, but
23898  * essentially you should default to using a [`SimpleRefPeerManager`], and use a
23899  * [`SimpleArcPeerManager`] when you require a `PeerManager` with a static lifetime, such as when
23900  * you're using lightning-net-tokio.
23901  *
23902  * [`read_event`]: PeerManager::read_event
23903  */
23904 typedef struct MUST_USE_STRUCT LDKPeerManager {
23905    /**
23906     * A pointer to the opaque Rust object.
23907     * Nearly everywhere, inner must be non-null, however in places where
23908     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23909     */
23910    LDKnativePeerManager *inner;
23911    /**
23912     * Indicates that this is the only struct which contains the same pointer.
23913     * Rust functions which take ownership of an object provided via an argument require
23914     * this to be true and invalidate the object pointed to by inner.
23915     */
23916    bool is_owned;
23917 } LDKPeerManager;
23918
23919
23920
23921 /**
23922  * Static channel fields used to build transactions given per-commitment fields, organized by
23923  * broadcaster/countersignatory.
23924  *
23925  * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
23926  * as_holder_broadcastable and as_counterparty_broadcastable functions.
23927  */
23928 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
23929    /**
23930     * A pointer to the opaque Rust object.
23931     * Nearly everywhere, inner must be non-null, however in places where
23932     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23933     */
23934    LDKnativeDirectedChannelTransactionParameters *inner;
23935    /**
23936     * Indicates that this is the only struct which contains the same pointer.
23937     * Rust functions which take ownership of an object provided via an argument require
23938     * this to be true and invalidate the object pointed to by inner.
23939     */
23940    bool is_owned;
23941 } LDKDirectedChannelTransactionParameters;
23942
23943
23944
23945 /**
23946  * Features used within an `offer`.
23947  */
23948 typedef struct MUST_USE_STRUCT LDKOfferFeatures {
23949    /**
23950     * A pointer to the opaque Rust object.
23951     * Nearly everywhere, inner must be non-null, however in places where
23952     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23953     */
23954    LDKnativeOfferFeatures *inner;
23955    /**
23956     * Indicates that this is the only struct which contains the same pointer.
23957     * Rust functions which take ownership of an object provided via an argument require
23958     * this to be true and invalidate the object pointed to by inner.
23959     */
23960    bool is_owned;
23961 } LDKOfferFeatures;
23962
23963
23964
23965 /**
23966  * Features used within an `invoice_request`.
23967  */
23968 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
23969    /**
23970     * A pointer to the opaque Rust object.
23971     * Nearly everywhere, inner must be non-null, however in places where
23972     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23973     */
23974    LDKnativeInvoiceRequestFeatures *inner;
23975    /**
23976     * Indicates that this is the only struct which contains the same pointer.
23977     * Rust functions which take ownership of an object provided via an argument require
23978     * this to be true and invalidate the object pointed to by inner.
23979     */
23980    bool is_owned;
23981 } LDKInvoiceRequestFeatures;
23982
23983
23984
23985 /**
23986  * Builds an [`Offer`] for the \"offer to be paid\" flow.
23987  *
23988  * See [module-level documentation] for usage.
23989  *
23990  * [module-level documentation]: self
23991  */
23992 typedef struct MUST_USE_STRUCT LDKOfferWithExplicitMetadataBuilder {
23993    /**
23994     * A pointer to the opaque Rust object.
23995     * Nearly everywhere, inner must be non-null, however in places where
23996     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23997     */
23998    LDKnativeOfferWithExplicitMetadataBuilder *inner;
23999    /**
24000     * Indicates that this is the only struct which contains the same pointer.
24001     * Rust functions which take ownership of an object provided via an argument require
24002     * this to be true and invalidate the object pointed to by inner.
24003     */
24004    bool is_owned;
24005 } LDKOfferWithExplicitMetadataBuilder;
24006
24007 /**
24008  * Represents a tweaked X-only public key as required for BIP 340 (Taproot).
24009  */
24010 typedef struct LDKTweakedPublicKey {
24011    /**
24012     * The bytes of the public key X coordinate
24013     */
24014    uint8_t x_coordinate[32];
24015 } LDKTweakedPublicKey;
24016
24017 /**
24018  * A function for signing an [`UnsignedBolt12Invoice`].
24019  */
24020 typedef struct LDKSignBolt12InvoiceFn {
24021    /**
24022     * An opaque pointer which is passed to your function implementations as an argument.
24023     * This has no meaning in the LDK, and can be NULL or any other value.
24024     */
24025    void *this_arg;
24026    /**
24027     * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream.
24028     */
24029    struct LDKCResult_SchnorrSignatureNoneZ (*sign_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR message);
24030    /**
24031     * Frees any resources associated with this object given its this_arg pointer.
24032     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
24033     */
24034    void (*free)(void *this_arg);
24035 } LDKSignBolt12InvoiceFn;
24036
24037
24038
24039 /**
24040  * A hash for use in a specific context by tweaking with a context-dependent tag as per [BIP 340]
24041  * and computed over the merkle root of a TLV stream to sign as defined in [BOLT 12].
24042  *
24043  * [BIP 340]: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
24044  * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md#signature-calculation
24045  */
24046 typedef struct MUST_USE_STRUCT LDKTaggedHash {
24047    /**
24048     * A pointer to the opaque Rust object.
24049     * Nearly everywhere, inner must be non-null, however in places where
24050     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24051     */
24052    LDKnativeTaggedHash *inner;
24053    /**
24054     * Indicates that this is the only struct which contains the same pointer.
24055     * Rust functions which take ownership of an object provided via an argument require
24056     * this to be true and invalidate the object pointed to by inner.
24057     */
24058    bool is_owned;
24059 } LDKTaggedHash;
24060
24061
24062
24063 /**
24064  * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
24065  *
24066  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
24067  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
24068  */
24069 typedef struct MUST_USE_STRUCT LDKErroneousField {
24070    /**
24071     * A pointer to the opaque Rust object.
24072     * Nearly everywhere, inner must be non-null, however in places where
24073     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24074     */
24075    LDKnativeErroneousField *inner;
24076    /**
24077     * Indicates that this is the only struct which contains the same pointer.
24078     * Rust functions which take ownership of an object provided via an argument require
24079     * this to be true and invalidate the object pointed to by inner.
24080     */
24081    bool is_owned;
24082 } LDKErroneousField;
24083
24084 /**
24085  * A function for signing an [`UnsignedInvoiceRequest`].
24086  */
24087 typedef struct LDKSignInvoiceRequestFn {
24088    /**
24089     * An opaque pointer which is passed to your function implementations as an argument.
24090     * This has no meaning in the LDK, and can be NULL or any other value.
24091     */
24092    void *this_arg;
24093    /**
24094     * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream.
24095     */
24096    struct LDKCResult_SchnorrSignatureNoneZ (*sign_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR message);
24097    /**
24098     * Frees any resources associated with this object given its this_arg pointer.
24099     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
24100     */
24101    void (*free)(void *this_arg);
24102 } LDKSignInvoiceRequestFn;
24103
24104 /**
24105  * Error when signing messages.
24106  */
24107 typedef enum LDKSignError_Tag {
24108    /**
24109     * User-defined error when signing the message.
24110     */
24111    LDKSignError_Signing,
24112    /**
24113     * Error when verifying the produced signature using the given pubkey.
24114     */
24115    LDKSignError_Verification,
24116    /**
24117     * Must be last for serialization purposes
24118     */
24119    LDKSignError_Sentinel,
24120 } LDKSignError_Tag;
24121
24122 typedef struct MUST_USE_STRUCT LDKSignError {
24123    LDKSignError_Tag tag;
24124    union {
24125       struct {
24126          enum LDKSecp256k1Error verification;
24127       };
24128    };
24129 } LDKSignError;
24130
24131
24132
24133 /**
24134  * Receives and validates network updates from peers,
24135  * stores authentic and relevant data as a network graph.
24136  * This network graph is then used for routing payments.
24137  * Provides interface to help with initial routing sync by
24138  * serving historical announcements.
24139  */
24140 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
24141    /**
24142     * A pointer to the opaque Rust object.
24143     * Nearly everywhere, inner must be non-null, however in places where
24144     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24145     */
24146    LDKnativeP2PGossipSync *inner;
24147    /**
24148     * Indicates that this is the only struct which contains the same pointer.
24149     * Rust functions which take ownership of an object provided via an argument require
24150     * this to be true and invalidate the object pointed to by inner.
24151     */
24152    bool is_owned;
24153 } LDKP2PGossipSync;
24154
24155
24156
24157 /**
24158  * A read-only view of [`NetworkGraph`].
24159  */
24160 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
24161    /**
24162     * A pointer to the opaque Rust object.
24163     * Nearly everywhere, inner must be non-null, however in places where
24164     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24165     */
24166    LDKnativeReadOnlyNetworkGraph *inner;
24167    /**
24168     * Indicates that this is the only struct which contains the same pointer.
24169     * Rust functions which take ownership of an object provided via an argument require
24170     * this to be true and invalidate the object pointed to by inner.
24171     */
24172    bool is_owned;
24173 } LDKReadOnlyNetworkGraph;
24174
24175
24176
24177 /**
24178  * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
24179  * source node to a target node.
24180  */
24181 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
24182    /**
24183     * A pointer to the opaque Rust object.
24184     * Nearly everywhere, inner must be non-null, however in places where
24185     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24186     */
24187    LDKnativeDirectedChannelInfo *inner;
24188    /**
24189     * Indicates that this is the only struct which contains the same pointer.
24190     * Rust functions which take ownership of an object provided via an argument require
24191     * this to be true and invalidate the object pointed to by inner.
24192     */
24193    bool is_owned;
24194 } LDKDirectedChannelInfo;
24195
24196 /**
24197  * The effective capacity of a channel for routing purposes.
24198  *
24199  * While this may be smaller than the actual channel capacity, amounts greater than
24200  * [`Self::as_msat`] should not be routed through the channel.
24201  */
24202 typedef enum LDKEffectiveCapacity_Tag {
24203    /**
24204     * The available liquidity in the channel known from being a channel counterparty, and thus a
24205     * direct hop.
24206     */
24207    LDKEffectiveCapacity_ExactLiquidity,
24208    /**
24209     * The maximum HTLC amount in one direction as advertised on the gossip network.
24210     */
24211    LDKEffectiveCapacity_AdvertisedMaxHTLC,
24212    /**
24213     * The total capacity of the channel as determined by the funding transaction.
24214     */
24215    LDKEffectiveCapacity_Total,
24216    /**
24217     * A capacity sufficient to route any payment, typically used for private channels provided by
24218     * an invoice.
24219     */
24220    LDKEffectiveCapacity_Infinite,
24221    /**
24222     * The maximum HTLC amount as provided by an invoice route hint.
24223     */
24224    LDKEffectiveCapacity_HintMaxHTLC,
24225    /**
24226     * A capacity that is unknown possibly because either the chain state is unavailable to know
24227     * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
24228     */
24229    LDKEffectiveCapacity_Unknown,
24230    /**
24231     * Must be last for serialization purposes
24232     */
24233    LDKEffectiveCapacity_Sentinel,
24234 } LDKEffectiveCapacity_Tag;
24235
24236 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
24237    /**
24238     * Either the inbound or outbound liquidity depending on the direction, denominated in
24239     * millisatoshi.
24240     */
24241    uint64_t liquidity_msat;
24242 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
24243
24244 typedef struct LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body {
24245    /**
24246     * The maximum HTLC amount denominated in millisatoshi.
24247     */
24248    uint64_t amount_msat;
24249 } LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body;
24250
24251 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
24252    /**
24253     * The funding amount denominated in millisatoshi.
24254     */
24255    uint64_t capacity_msat;
24256    /**
24257     * The maximum HTLC amount denominated in millisatoshi.
24258     */
24259    uint64_t htlc_maximum_msat;
24260 } LDKEffectiveCapacity_LDKTotal_Body;
24261
24262 typedef struct LDKEffectiveCapacity_LDKHintMaxHTLC_Body {
24263    /**
24264     * The maximum HTLC amount denominated in millisatoshi.
24265     */
24266    uint64_t amount_msat;
24267 } LDKEffectiveCapacity_LDKHintMaxHTLC_Body;
24268
24269 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
24270    LDKEffectiveCapacity_Tag tag;
24271    union {
24272       LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
24273       LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body advertised_max_htlc;
24274       LDKEffectiveCapacity_LDKTotal_Body total;
24275       LDKEffectiveCapacity_LDKHintMaxHTLC_Body hint_max_htlc;
24276    };
24277 } LDKEffectiveCapacity;
24278
24279
24280
24281 /**
24282  * A [`Router`] implemented using [`find_route`].
24283  */
24284 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
24285    /**
24286     * A pointer to the opaque Rust object.
24287     * Nearly everywhere, inner must be non-null, however in places where
24288     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24289     */
24290    LDKnativeDefaultRouter *inner;
24291    /**
24292     * Indicates that this is the only struct which contains the same pointer.
24293     * Rust functions which take ownership of an object provided via an argument require
24294     * this to be true and invalidate the object pointed to by inner.
24295     */
24296    bool is_owned;
24297 } LDKDefaultRouter;
24298
24299
24300
24301 /**
24302  * [`ScoreLookUp`] implementation that factors in in-flight HTLC liquidity.
24303  *
24304  * Useful for custom [`Router`] implementations to wrap their [`ScoreLookUp`] on-the-fly when calling
24305  * [`find_route`].
24306  *
24307  * [`ScoreLookUp`]: crate::routing::scoring::ScoreLookUp
24308  */
24309 typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
24310    /**
24311     * A pointer to the opaque Rust object.
24312     * Nearly everywhere, inner must be non-null, however in places where
24313     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24314     */
24315    LDKnativeScorerAccountingForInFlightHtlcs *inner;
24316    /**
24317     * Indicates that this is the only struct which contains the same pointer.
24318     * Rust functions which take ownership of an object provided via an argument require
24319     * this to be true and invalidate the object pointed to by inner.
24320     */
24321    bool is_owned;
24322 } LDKScorerAccountingForInFlightHtlcs;
24323
24324 /**
24325  * The recipient of a payment, differing based on whether they've hidden their identity with route
24326  * blinding.
24327  */
24328 typedef enum LDKPayee_Tag {
24329    /**
24330     * The recipient provided blinded paths and payinfo to reach them. The blinded paths themselves
24331     * will be included in the final [`Route`].
24332     */
24333    LDKPayee_Blinded,
24334    /**
24335     * The recipient included these route hints in their BOLT11 invoice.
24336     */
24337    LDKPayee_Clear,
24338    /**
24339     * Must be last for serialization purposes
24340     */
24341    LDKPayee_Sentinel,
24342 } LDKPayee_Tag;
24343
24344 typedef struct LDKPayee_LDKBlinded_Body {
24345    /**
24346     * Aggregated routing info and blinded paths, for routing to the payee without knowing their
24347     * node id.
24348     */
24349    struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints;
24350    /**
24351     * Features supported by the payee.
24352     *
24353     * May be set from the payee's invoice. May be `None` if the invoice does not contain any
24354     * features.
24355     *
24356     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
24357     */
24358    struct LDKBolt12InvoiceFeatures features;
24359 } LDKPayee_LDKBlinded_Body;
24360
24361 typedef struct LDKPayee_LDKClear_Body {
24362    /**
24363     * The node id of the payee.
24364     */
24365    struct LDKPublicKey node_id;
24366    /**
24367     * Hints for routing to the payee, containing channels connecting the payee to public nodes.
24368     */
24369    struct LDKCVec_RouteHintZ route_hints;
24370    /**
24371     * Features supported by the payee.
24372     *
24373     * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
24374     * does not contain any features.
24375     *
24376     * [`for_keysend`]: PaymentParameters::for_keysend
24377     *
24378     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
24379     */
24380    struct LDKBolt11InvoiceFeatures features;
24381    /**
24382     * The minimum CLTV delta at the end of the route. This value must not be zero.
24383     */
24384    uint32_t final_cltv_expiry_delta;
24385 } LDKPayee_LDKClear_Body;
24386
24387 typedef struct MUST_USE_STRUCT LDKPayee {
24388    LDKPayee_Tag tag;
24389    union {
24390       LDKPayee_LDKBlinded_Body blinded;
24391       LDKPayee_LDKClear_Body clear;
24392    };
24393 } LDKPayee;
24394
24395 /**
24396  * A trait which can both lookup and update routing channel penalty scores.
24397  *
24398  * This is used in places where both bounds are required and implemented for all types which
24399  * implement [`ScoreLookUp`] and [`ScoreUpdate`].
24400  *
24401  * Bindings users may need to manually implement this for their custom scoring implementations.
24402  */
24403 typedef struct LDKScore {
24404    /**
24405     * An opaque pointer which is passed to your function implementations as an argument.
24406     * This has no meaning in the LDK, and can be NULL or any other value.
24407     */
24408    void *this_arg;
24409    /**
24410     * Implementation of ScoreLookUp for this object.
24411     */
24412    struct LDKScoreLookUp ScoreLookUp;
24413    /**
24414     * Implementation of ScoreUpdate for this object.
24415     */
24416    struct LDKScoreUpdate ScoreUpdate;
24417    /**
24418     * Serialize the object into a byte array
24419     */
24420    struct LDKCVec_u8Z (*write)(const void *this_arg);
24421    /**
24422     * Frees any resources associated with this object given its this_arg pointer.
24423     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
24424     */
24425    void (*free)(void *this_arg);
24426 } LDKScore;
24427
24428
24429
24430 /**
24431  * A concrete implementation of [`LockableScore`] which supports multi-threading.
24432  */
24433 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
24434    /**
24435     * A pointer to the opaque Rust object.
24436     * Nearly everywhere, inner must be non-null, however in places where
24437     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24438     */
24439    LDKnativeMultiThreadedLockableScore *inner;
24440    /**
24441     * Indicates that this is the only struct which contains the same pointer.
24442     * Rust functions which take ownership of an object provided via an argument require
24443     * this to be true and invalidate the object pointed to by inner.
24444     */
24445    bool is_owned;
24446 } LDKMultiThreadedLockableScore;
24447
24448
24449
24450 /**
24451  * A locked `MultiThreadedLockableScore`.
24452  */
24453 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockRead {
24454    /**
24455     * A pointer to the opaque Rust object.
24456     * Nearly everywhere, inner must be non-null, however in places where
24457     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24458     */
24459    LDKnativeMultiThreadedScoreLockRead *inner;
24460    /**
24461     * Indicates that this is the only struct which contains the same pointer.
24462     * Rust functions which take ownership of an object provided via an argument require
24463     * this to be true and invalidate the object pointed to by inner.
24464     */
24465    bool is_owned;
24466 } LDKMultiThreadedScoreLockRead;
24467
24468
24469
24470 /**
24471  * A locked `MultiThreadedLockableScore`.
24472  */
24473 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockWrite {
24474    /**
24475     * A pointer to the opaque Rust object.
24476     * Nearly everywhere, inner must be non-null, however in places where
24477     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24478     */
24479    LDKnativeMultiThreadedScoreLockWrite *inner;
24480    /**
24481     * Indicates that this is the only struct which contains the same pointer.
24482     * Rust functions which take ownership of an object provided via an argument require
24483     * this to be true and invalidate the object pointed to by inner.
24484     */
24485    bool is_owned;
24486 } LDKMultiThreadedScoreLockWrite;
24487
24488
24489
24490 /**
24491  * Parameters for configuring [`ProbabilisticScorer`].
24492  *
24493  * Used to configure decay parameters that are static throughout the lifetime of the scorer.
24494  * these decay parameters affect the score of the channel penalty and are not changed on a
24495  * per-route penalty cost call.
24496  */
24497 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringDecayParameters {
24498    /**
24499     * A pointer to the opaque Rust object.
24500     * Nearly everywhere, inner must be non-null, however in places where
24501     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24502     */
24503    LDKnativeProbabilisticScoringDecayParameters *inner;
24504    /**
24505     * Indicates that this is the only struct which contains the same pointer.
24506     * Rust functions which take ownership of an object provided via an argument require
24507     * this to be true and invalidate the object pointed to by inner.
24508     */
24509    bool is_owned;
24510 } LDKProbabilisticScoringDecayParameters;
24511
24512
24513
24514 /**
24515  * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
24516  * 32-byte seed for use as a BIP 32 extended key and derives keys from that.
24517  *
24518  * Your `node_id` is seed/0'.
24519  * Unilateral closes may use seed/1'.
24520  * Cooperative closes may use seed/2'.
24521  * The two close keys may be needed to claim on-chain funds!
24522  *
24523  * This struct cannot be used for nodes that wish to support receiving phantom payments;
24524  * [`PhantomKeysManager`] must be used instead.
24525  *
24526  * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
24527  * previously issued invoices and attempts to pay previous invoices will fail.
24528  */
24529 typedef struct MUST_USE_STRUCT LDKKeysManager {
24530    /**
24531     * A pointer to the opaque Rust object.
24532     * Nearly everywhere, inner must be non-null, however in places where
24533     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24534     */
24535    LDKnativeKeysManager *inner;
24536    /**
24537     * Indicates that this is the only struct which contains the same pointer.
24538     * Rust functions which take ownership of an object provided via an argument require
24539     * this to be true and invalidate the object pointed to by inner.
24540     */
24541    bool is_owned;
24542 } LDKKeysManager;
24543
24544
24545
24546 /**
24547  * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
24548  * payments.
24549  *
24550  * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
24551  * paid to one of multiple nodes. This works because we encode the invoice route hints such that
24552  * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
24553  * itself without ever needing to forward to this fake node.
24554  *
24555  * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
24556  * provide some fault tolerance, because payers will automatically retry paying other provided
24557  * nodes in the case that one node goes down.
24558  *
24559  * Note that multi-path payments are not supported in phantom invoices for security reasons.
24560  * Switching between this struct and [`KeysManager`] will invalidate any previously issued
24561  * invoices and attempts to pay previous invoices will fail.
24562  */
24563 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
24564    /**
24565     * A pointer to the opaque Rust object.
24566     * Nearly everywhere, inner must be non-null, however in places where
24567     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24568     */
24569    LDKnativePhantomKeysManager *inner;
24570    /**
24571     * Indicates that this is the only struct which contains the same pointer.
24572     * Rust functions which take ownership of an object provided via an argument require
24573     * this to be true and invalidate the object pointed to by inner.
24574     */
24575    bool is_owned;
24576 } LDKPhantomKeysManager;
24577
24578
24579
24580 /**
24581  * An implementation of [`EntropySource`] using ChaCha20.
24582  */
24583 typedef struct MUST_USE_STRUCT LDKRandomBytes {
24584    /**
24585     * A pointer to the opaque Rust object.
24586     * Nearly everywhere, inner must be non-null, however in places where
24587     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24588     */
24589    LDKnativeRandomBytes *inner;
24590    /**
24591     * Indicates that this is the only struct which contains the same pointer.
24592     * Rust functions which take ownership of an object provided via an argument require
24593     * this to be true and invalidate the object pointed to by inner.
24594     */
24595    bool is_owned;
24596 } LDKRandomBytes;
24597
24598
24599
24600 /**
24601  * A sender, receiver and forwarder of [`OnionMessage`]s.
24602  *
24603  * # Handling Messages
24604  *
24605  * `OnionMessenger` implements [`OnionMessageHandler`], making it responsible for either forwarding
24606  * messages to peers or delegating to the appropriate handler for the message type. Currently, the
24607  * available handlers are:
24608  * * [`OffersMessageHandler`], for responding to [`InvoiceRequest`]s and paying [`Bolt12Invoice`]s
24609  * * [`CustomOnionMessageHandler`], for handling user-defined message types
24610  *
24611  * # Sending Messages
24612  *
24613  * [`OnionMessage`]s are sent initially using [`OnionMessenger::send_onion_message`]. When handling
24614  * a message, the matched handler may return a response message which `OnionMessenger` will send
24615  * on its behalf.
24616  *
24617  * # Example
24618  *
24619  * ```
24620  * # extern crate bitcoin;
24621  * # use bitcoin::hashes::_export::_core::time::Duration;
24622  * # use bitcoin::hashes::hex::FromHex;
24623  * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey, self};
24624  * # use lightning::blinded_path::{BlindedPath, EmptyNodeIdLookUp};
24625  * # use lightning::sign::{EntropySource, KeysManager};
24626  * # use lightning::ln::peer_handler::IgnoringMessageHandler;
24627  * # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath, OnionMessenger};
24628  * # use lightning::onion_message::packet::OnionMessageContents;
24629  * # use lightning::util::logger::{Logger, Record};
24630  * # use lightning::util::ser::{Writeable, Writer};
24631  * # use lightning::io;
24632  * # use std::sync::Arc;
24633  * # struct FakeLogger;
24634  * # impl Logger for FakeLogger {
24635  * #     fn log(&self, record: Record) { println!(\"{:?}\" , record); }
24636  * # }
24637  * # struct FakeMessageRouter {}
24638  * # impl MessageRouter for FakeMessageRouter {
24639  * #     fn find_path(&self, sender: PublicKey, peers: Vec<PublicKey>, destination: Destination) -> Result<OnionMessagePath, ()> {
24640  * #         let secp_ctx = Secp256k1::new();
24641  * #         let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
24642  * #         let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
24643  * #         let hop_node_id2 = hop_node_id1;
24644  * #         Ok(OnionMessagePath {
24645  * #             intermediate_nodes: vec![hop_node_id1, hop_node_id2],
24646  * #             destination,
24647  * #             first_node_addresses: None,
24648  * #         })
24649  * #     }
24650  * #     fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
24651  * #         &self, _recipient: PublicKey, _peers: Vec<PublicKey>, _secp_ctx: &Secp256k1<T>
24652  * #     ) -> Result<Vec<BlindedPath>, ()> {
24653  * #         unreachable!()
24654  * #     }
24655  * # }
24656  * # let seed = [42u8; 32];
24657  * # let time = Duration::from_secs(123456);
24658  * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
24659  * # let logger = Arc::new(FakeLogger {});
24660  * # let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
24661  * # let secp_ctx = Secp256k1::new();
24662  * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
24663  * # let (hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1);
24664  * # let destination_node_id = hop_node_id1;
24665  * # let node_id_lookup = EmptyNodeIdLookUp {};
24666  * # let message_router = Arc::new(FakeMessageRouter {});
24667  * # let custom_message_handler = IgnoringMessageHandler {};
24668  * # let offers_message_handler = IgnoringMessageHandler {};
24669  * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
24670  * // ChannelManager.
24671  * let onion_messenger = OnionMessenger::new(
24672  *     &keys_manager, &keys_manager, logger, &node_id_lookup, message_router,
24673  *     &offers_message_handler, &custom_message_handler
24674  * );
24675  *
24676  * # #[derive(Debug, Clone)]
24677  * # struct YourCustomMessage {}
24678  * impl Writeable for YourCustomMessage {
24679  * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
24680  * \t\t# Ok(())
24681  * \t\t// Write your custom onion message to `w`
24682  * \t}
24683  * }
24684  * impl OnionMessageContents for YourCustomMessage {
24685  * \tfn tlv_type(&self) -> u64 {
24686  * \t\t# let your_custom_message_type = 42;
24687  * \t\tyour_custom_message_type
24688  * \t}
24689  * }
24690  * // Send a custom onion message to a node id.
24691  * let destination = Destination::Node(destination_node_id);
24692  * let reply_path = None;
24693  * # let message = YourCustomMessage {};
24694  * onion_messenger.send_onion_message(message, destination, reply_path);
24695  *
24696  * // Create a blinded path to yourself, for someone to send an onion message to.
24697  * # let your_node_id = hop_node_id1;
24698  * let hops = [hop_node_id3, hop_node_id4, your_node_id];
24699  * let blinded_path = BlindedPath::new_for_message(&hops, &keys_manager, &secp_ctx).unwrap();
24700  *
24701  * // Send a custom onion message to a blinded path.
24702  * let destination = Destination::BlindedPath(blinded_path);
24703  * let reply_path = None;
24704  * # let message = YourCustomMessage {};
24705  * onion_messenger.send_onion_message(message, destination, reply_path);
24706  * ```
24707  *
24708  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
24709  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
24710  */
24711 typedef struct MUST_USE_STRUCT LDKOnionMessenger {
24712    /**
24713     * A pointer to the opaque Rust object.
24714     * Nearly everywhere, inner must be non-null, however in places where
24715     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24716     */
24717    LDKnativeOnionMessenger *inner;
24718    /**
24719     * Indicates that this is the only struct which contains the same pointer.
24720     * Rust functions which take ownership of an object provided via an argument require
24721     * this to be true and invalidate the object pointed to by inner.
24722     */
24723    bool is_owned;
24724 } LDKOnionMessenger;
24725
24726
24727
24728 /**
24729  * A [`MessageRouter`] that can only route to a directly connected [`Destination`].
24730  */
24731 typedef struct MUST_USE_STRUCT LDKDefaultMessageRouter {
24732    /**
24733     * A pointer to the opaque Rust object.
24734     * Nearly everywhere, inner must be non-null, however in places where
24735     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24736     */
24737    LDKnativeDefaultMessageRouter *inner;
24738    /**
24739     * Indicates that this is the only struct which contains the same pointer.
24740     * Rust functions which take ownership of an object provided via an argument require
24741     * this to be true and invalidate the object pointed to by inner.
24742     */
24743    bool is_owned;
24744 } LDKDefaultMessageRouter;
24745
24746 /**
24747  * The unblinded node in a [`BlindedPath`].
24748  */
24749 typedef enum LDKIntroductionNode_Tag {
24750    /**
24751     * The node id of the introduction node.
24752     */
24753    LDKIntroductionNode_NodeId,
24754    /**
24755     * The short channel id of the channel leading to the introduction node. The [`Direction`]
24756     * identifies which side of the channel is the introduction node.
24757     */
24758    LDKIntroductionNode_DirectedShortChannelId,
24759    /**
24760     * Must be last for serialization purposes
24761     */
24762    LDKIntroductionNode_Sentinel,
24763 } LDKIntroductionNode_Tag;
24764
24765 typedef struct LDKIntroductionNode_LDKDirectedShortChannelId_Body {
24766    enum LDKDirection _0;
24767    uint64_t _1;
24768 } LDKIntroductionNode_LDKDirectedShortChannelId_Body;
24769
24770 typedef struct MUST_USE_STRUCT LDKIntroductionNode {
24771    LDKIntroductionNode_Tag tag;
24772    union {
24773       struct {
24774          struct LDKPublicKey node_id;
24775       };
24776       LDKIntroductionNode_LDKDirectedShortChannelId_Body directed_short_channel_id;
24777    };
24778 } LDKIntroductionNode;
24779
24780
24781
24782 /**
24783  * A [`NodeIdLookUp`] that always returns `None`.
24784  */
24785 typedef struct MUST_USE_STRUCT LDKEmptyNodeIdLookUp {
24786    /**
24787     * A pointer to the opaque Rust object.
24788     * Nearly everywhere, inner must be non-null, however in places where
24789     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24790     */
24791    LDKnativeEmptyNodeIdLookUp *inner;
24792    /**
24793     * Indicates that this is the only struct which contains the same pointer.
24794     * Rust functions which take ownership of an object provided via an argument require
24795     * this to be true and invalidate the object pointed to by inner.
24796     */
24797    bool is_owned;
24798 } LDKEmptyNodeIdLookUp;
24799
24800
24801
24802 /**
24803  * Data to construct a [`BlindedHop`] for forwarding a payment.
24804  */
24805 typedef struct MUST_USE_STRUCT LDKForwardTlvs {
24806    /**
24807     * A pointer to the opaque Rust object.
24808     * Nearly everywhere, inner must be non-null, however in places where
24809     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24810     */
24811    LDKnativeForwardTlvs *inner;
24812    /**
24813     * Indicates that this is the only struct which contains the same pointer.
24814     * Rust functions which take ownership of an object provided via an argument require
24815     * this to be true and invalidate the object pointed to by inner.
24816     */
24817    bool is_owned;
24818 } LDKForwardTlvs;
24819
24820 /**
24821  * An abstraction over a bitcoin wallet that can perform coin selection over a set of UTXOs and can
24822  * sign for them. The coin selection method aims to mimic Bitcoin Core's `fundrawtransaction` RPC,
24823  * which most wallets should be able to satisfy. Otherwise, consider implementing [`WalletSource`],
24824  * which can provide a default implementation of this trait when used with [`Wallet`].
24825  */
24826 typedef struct LDKCoinSelectionSource {
24827    /**
24828     * An opaque pointer which is passed to your function implementations as an argument.
24829     * This has no meaning in the LDK, and can be NULL or any other value.
24830     */
24831    void *this_arg;
24832    /**
24833     * Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are
24834     * available to spend. Implementations are free to pick their coin selection algorithm of
24835     * choice, as long as the following requirements are met:
24836     *
24837     * 1. `must_spend` contains a set of [`Input`]s that must be included in the transaction
24838     *    throughout coin selection, but must not be returned as part of the result.
24839     * 2. `must_pay_to` contains a set of [`TxOut`]s that must be included in the transaction
24840     *    throughout coin selection. In some cases, like when funding an anchor transaction, this
24841     *    set is empty. Implementations should ensure they handle this correctly on their end,
24842     *    e.g., Bitcoin Core's `fundrawtransaction` RPC requires at least one output to be
24843     *    provided, in which case a zero-value empty OP_RETURN output can be used instead.
24844     * 3. Enough inputs must be selected/contributed for the resulting transaction (including the
24845     *    inputs and outputs noted above) to meet `target_feerate_sat_per_1000_weight`.
24846     *
24847     * Implementations must take note that [`Input::satisfaction_weight`] only tracks the weight of
24848     * the input's `script_sig` and `witness`. Some wallets, like Bitcoin Core's, may require
24849     * providing the full input weight. Failing to do so may lead to underestimating fee bumps and
24850     * delaying block inclusion.
24851     *
24852     * The `claim_id` must map to the set of external UTXOs assigned to the claim, such that they
24853     * can be re-used within new fee-bumped iterations of the original claiming transaction,
24854     * ensuring that claims don't double spend each other. If a specific `claim_id` has never had a
24855     * transaction associated with it, and all of the available UTXOs have already been assigned to
24856     * other claims, implementations must be willing to double spend their UTXOs. The choice of
24857     * which UTXOs to double spend is left to the implementation, but it must strive to keep the
24858     * set of other claims being double spent to a minimum.
24859     */
24860    struct LDKCResult_CoinSelectionNoneZ (*select_confirmed_utxos)(const void *this_arg, struct LDKThirtyTwoBytes claim_id, struct LDKCVec_InputZ must_spend, struct LDKCVec_TxOutZ must_pay_to, uint32_t target_feerate_sat_per_1000_weight);
24861    /**
24862     * Signs and provides the full witness for all inputs within the transaction known to the
24863     * trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]).
24864     *
24865     * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
24866     * unsigned transaction and then sign it with your wallet.
24867     */
24868    struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
24869    /**
24870     * Frees any resources associated with this object given its this_arg pointer.
24871     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
24872     */
24873    void (*free)(void *this_arg);
24874 } LDKCoinSelectionSource;
24875
24876 /**
24877  * An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to
24878  * provide a default implementation to [`CoinSelectionSource`].
24879  */
24880 typedef struct LDKWalletSource {
24881    /**
24882     * An opaque pointer which is passed to your function implementations as an argument.
24883     * This has no meaning in the LDK, and can be NULL or any other value.
24884     */
24885    void *this_arg;
24886    /**
24887     * Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
24888     */
24889    struct LDKCResult_CVec_UtxoZNoneZ (*list_confirmed_utxos)(const void *this_arg);
24890    /**
24891     * Returns a script to use for change above dust resulting from a successful coin selection
24892     * attempt.
24893     */
24894    struct LDKCResult_CVec_u8ZNoneZ (*get_change_script)(const void *this_arg);
24895    /**
24896     * Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within
24897     * the transaction known to the wallet (i.e., any provided via
24898     * [`WalletSource::list_confirmed_utxos`]).
24899     *
24900     * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
24901     * unsigned transaction and then sign it with your wallet.
24902     */
24903    struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
24904    /**
24905     * Frees any resources associated with this object given its this_arg pointer.
24906     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
24907     */
24908    void (*free)(void *this_arg);
24909 } LDKWalletSource;
24910
24911
24912
24913 /**
24914  * A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would
24915  * avoid conflicting double spends. If not enough UTXOs are available to do so, conflicting double
24916  * spends may happen.
24917  */
24918 typedef struct MUST_USE_STRUCT LDKWallet {
24919    /**
24920     * A pointer to the opaque Rust object.
24921     * Nearly everywhere, inner must be non-null, however in places where
24922     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24923     */
24924    LDKnativeWallet *inner;
24925    /**
24926     * Indicates that this is the only struct which contains the same pointer.
24927     * Rust functions which take ownership of an object provided via an argument require
24928     * this to be true and invalidate the object pointed to by inner.
24929     */
24930    bool is_owned;
24931 } LDKWallet;
24932
24933
24934
24935 /**
24936  * A handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a
24937  * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or
24938  * Replace-By-Fee (RBF).
24939  *
24940  * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
24941  */
24942 typedef struct MUST_USE_STRUCT LDKBumpTransactionEventHandler {
24943    /**
24944     * A pointer to the opaque Rust object.
24945     * Nearly everywhere, inner must be non-null, however in places where
24946     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24947     */
24948    LDKnativeBumpTransactionEventHandler *inner;
24949    /**
24950     * Indicates that this is the only struct which contains the same pointer.
24951     * Rust functions which take ownership of an object provided via an argument require
24952     * this to be true and invalidate the object pointed to by inner.
24953     */
24954    bool is_owned;
24955 } LDKBumpTransactionEventHandler;
24956
24957
24958
24959 /**
24960  * A [`KVStore`] implementation that writes to and reads from the file system.
24961  */
24962 typedef struct MUST_USE_STRUCT LDKFilesystemStore {
24963    /**
24964     * A pointer to the opaque Rust object.
24965     * Nearly everywhere, inner must be non-null, however in places where
24966     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24967     */
24968    LDKnativeFilesystemStore *inner;
24969    /**
24970     * Indicates that this is the only struct which contains the same pointer.
24971     * Rust functions which take ownership of an object provided via an argument require
24972     * this to be true and invalidate the object pointed to by inner.
24973     */
24974    bool is_owned;
24975 } LDKFilesystemStore;
24976
24977
24978
24979 /**
24980  * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
24981  * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
24982  * responsibilities are:
24983  * * Processing [`Event`]s with a user-provided [`EventHandler`].
24984  * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
24985  *   writing it to disk/backups by invoking the callback given to it at startup.
24986  *   [`ChannelManager`] persistence should be done in the background.
24987  * * Calling [`ChannelManager::timer_tick_occurred`], [`ChainMonitor::rebroadcast_pending_claims`]
24988  *   and [`PeerManager::timer_tick_occurred`] at the appropriate intervals.
24989  * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
24990  *   [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
24991  *
24992  * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
24993  * upon as doing so may result in high latency.
24994  *
24995  * # Note
24996  *
24997  * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
24998  * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
24999  * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
25000  * unilateral chain closure fees are at risk.
25001  *
25002  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
25003  * [`ChannelManager::timer_tick_occurred`]: lightning::ln::channelmanager::ChannelManager::timer_tick_occurred
25004  * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
25005  * [`Event`]: lightning::events::Event
25006  * [`PeerManager::timer_tick_occurred`]: lightning::ln::peer_handler::PeerManager::timer_tick_occurred
25007  * [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events
25008  *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
25009  */
25010 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
25011    /**
25012     * A pointer to the opaque Rust object.
25013     * Nearly everywhere, inner must be non-null, however in places where
25014     * the Rust equivalent takes an Option, it may be set to null to indicate None.
25015     */
25016    LDKnativeBackgroundProcessor *inner;
25017    /**
25018     * Indicates that this is the only struct which contains the same pointer.
25019     * Rust functions which take ownership of an object provided via an argument require
25020     * this to be true and invalidate the object pointed to by inner.
25021     */
25022    bool is_owned;
25023 } LDKBackgroundProcessor;
25024
25025
25026
25027 /**
25028  * The main Rapid Gossip Sync object.
25029  *
25030  * See [crate-level documentation] for usage.
25031  *
25032  * [crate-level documentation]: crate
25033  */
25034 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
25035    /**
25036     * A pointer to the opaque Rust object.
25037     * Nearly everywhere, inner must be non-null, however in places where
25038     * the Rust equivalent takes an Option, it may be set to null to indicate None.
25039     */
25040    LDKnativeRapidGossipSync *inner;
25041    /**
25042     * Indicates that this is the only struct which contains the same pointer.
25043     * Rust functions which take ownership of an object provided via an argument require
25044     * this to be true and invalidate the object pointed to by inner.
25045     */
25046    bool is_owned;
25047 } LDKRapidGossipSync;
25048
25049 /**
25050  * Either [`P2PGossipSync`] or [`RapidGossipSync`].
25051  */
25052 typedef enum LDKGossipSync_Tag {
25053    /**
25054     * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
25055     */
25056    LDKGossipSync_P2P,
25057    /**
25058     * Rapid gossip sync from a trusted server.
25059     */
25060    LDKGossipSync_Rapid,
25061    /**
25062     * No gossip sync.
25063     */
25064    LDKGossipSync_None,
25065    /**
25066     * Must be last for serialization purposes
25067     */
25068    LDKGossipSync_Sentinel,
25069 } LDKGossipSync_Tag;
25070
25071 typedef struct MUST_USE_STRUCT LDKGossipSync {
25072    LDKGossipSync_Tag tag;
25073    union {
25074       struct {
25075          /**
25076           * Note that this field is expected to be a reference.
25077           */
25078          struct LDKP2PGossipSync p2p;
25079       };
25080       struct {
25081          /**
25082           * Note that this field is expected to be a reference.
25083           */
25084          struct LDKRapidGossipSync rapid;
25085       };
25086    };
25087 } LDKGossipSync;
25088
25089
25090
25091 /**
25092  * Data of the [`RawBolt11Invoice`] that is encoded in the data part
25093  */
25094 typedef struct MUST_USE_STRUCT LDKRawDataPart {
25095    /**
25096     * A pointer to the opaque Rust object.
25097     * Nearly everywhere, inner must be non-null, however in places where
25098     * the Rust equivalent takes an Option, it may be set to null to indicate None.
25099     */
25100    LDKnativeRawDataPart *inner;
25101    /**
25102     * Indicates that this is the only struct which contains the same pointer.
25103     * Rust functions which take ownership of an object provided via an argument require
25104     * this to be true and invalidate the object pointed to by inner.
25105     */
25106    bool is_owned;
25107 } LDKRawDataPart;
25108
25109
25110
25111 /**
25112  * SHA-256 hash
25113  */
25114 typedef struct MUST_USE_STRUCT LDKSha256 {
25115    /**
25116     * A pointer to the opaque Rust object.
25117     * Nearly everywhere, inner must be non-null, however in places where
25118     * the Rust equivalent takes an Option, it may be set to null to indicate None.
25119     */
25120    LDKnativeSha256 *inner;
25121    /**
25122     * Indicates that this is the only struct which contains the same pointer.
25123     * Rust functions which take ownership of an object provided via an argument require
25124     * this to be true and invalidate the object pointed to by inner.
25125     */
25126    bool is_owned;
25127 } LDKSha256;
25128
25129
25130
25131 /**
25132  * Positive duration that defines when (relatively to the timestamp) in the future the invoice
25133  * expires
25134  */
25135 typedef struct MUST_USE_STRUCT LDKExpiryTime {
25136    /**
25137     * A pointer to the opaque Rust object.
25138     * Nearly everywhere, inner must be non-null, however in places where
25139     * the Rust equivalent takes an Option, it may be set to null to indicate None.
25140     */
25141    LDKnativeExpiryTime *inner;
25142    /**
25143     * Indicates that this is the only struct which contains the same pointer.
25144     * Rust functions which take ownership of an object provided via an argument require
25145     * this to be true and invalidate the object pointed to by inner.
25146     */
25147    bool is_owned;
25148 } LDKExpiryTime;
25149
25150
25151
25152 /**
25153  * `min_final_cltv_expiry_delta` to use for the last HTLC in the route
25154  */
25155 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiryDelta {
25156    /**
25157     * A pointer to the opaque Rust object.
25158     * Nearly everywhere, inner must be non-null, however in places where
25159     * the Rust equivalent takes an Option, it may be set to null to indicate None.
25160     */
25161    LDKnativeMinFinalCltvExpiryDelta *inner;
25162    /**
25163     * Indicates that this is the only struct which contains the same pointer.
25164     * Rust functions which take ownership of an object provided via an argument require
25165     * this to be true and invalidate the object pointed to by inner.
25166     */
25167    bool is_owned;
25168 } LDKMinFinalCltvExpiryDelta;
25169
25170 /**
25171  * A 20-byte byte array.
25172  */
25173 typedef struct LDKTwentyBytes {
25174    /**
25175     * The twenty bytes
25176     */
25177    uint8_t data[20];
25178 } LDKTwentyBytes;
25179
25180 /**
25181  * Fallback address in case no LN payment is possible
25182  */
25183 typedef enum LDKFallback_Tag {
25184    LDKFallback_SegWitProgram,
25185    LDKFallback_PubKeyHash,
25186    LDKFallback_ScriptHash,
25187    /**
25188     * Must be last for serialization purposes
25189     */
25190    LDKFallback_Sentinel,
25191 } LDKFallback_Tag;
25192
25193 typedef struct LDKFallback_LDKSegWitProgram_Body {
25194    struct LDKWitnessVersion version;
25195    struct LDKCVec_u8Z program;
25196 } LDKFallback_LDKSegWitProgram_Body;
25197
25198 typedef struct MUST_USE_STRUCT LDKFallback {
25199    LDKFallback_Tag tag;
25200    union {
25201       LDKFallback_LDKSegWitProgram_Body seg_wit_program;
25202       struct {
25203          struct LDKTwentyBytes pub_key_hash;
25204       };
25205       struct {
25206          struct LDKTwentyBytes script_hash;
25207       };
25208    };
25209 } LDKFallback;
25210
25211 extern const uintptr_t MAX_BUF_SIZE;
25212
25213 extern const uintptr_t KVSTORE_NAMESPACE_KEY_MAX_LEN;
25214
25215 extern const uint64_t MAX_SCID_BLOCK;
25216
25217 extern const uint64_t MAX_SCID_TX_INDEX;
25218
25219 extern const uint64_t MAX_SCID_VOUT_INDEX;
25220
25221 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
25222
25223 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
25224
25225 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
25226
25227 extern const uint32_t ANTI_REORG_DELAY;
25228
25229 extern const uint16_t BREAKDOWN_TIMEOUT;
25230
25231 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
25232
25233 extern const uint16_t MIN_FINAL_CLTV_EXPIRY_DELTA;
25234
25235 extern const uint16_t MAX_HTLCS;
25236
25237 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
25238
25239 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
25240
25241 extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
25242
25243 extern const uint64_t ANCHOR_INPUT_WITNESS_WEIGHT;
25244
25245 extern const uint64_t HTLC_TIMEOUT_INPUT_ANCHOR_WITNESS_WEIGHT;
25246
25247 extern const uint64_t HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT;
25248
25249 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
25250
25251 extern const uintptr_t PAYER_NOTE_LIMIT;
25252
25253 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
25254
25255 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
25256
25257 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
25258
25259 extern const uint64_t MAX_TIMESTAMP;
25260
25261 extern const uint64_t DEFAULT_EXPIRY_TIME;
25262
25263 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
25264
25265 extern const uint8_t TAG_PAYMENT_HASH;
25266
25267 extern const uint8_t TAG_DESCRIPTION;
25268
25269 extern const uint8_t TAG_PAYEE_PUB_KEY;
25270
25271 extern const uint8_t TAG_DESCRIPTION_HASH;
25272
25273 extern const uint8_t TAG_EXPIRY_TIME;
25274
25275 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY_DELTA;
25276
25277 extern const uint8_t TAG_FALLBACK;
25278
25279 extern const uint8_t TAG_PRIVATE_ROUTE;
25280
25281 extern const uint8_t TAG_PAYMENT_SECRET;
25282
25283 extern const uint8_t TAG_PAYMENT_METADATA;
25284
25285 extern const uint8_t TAG_FEATURES;
25286
25287 struct LDKStr _ldk_get_compiled_version(void);
25288
25289 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
25290
25291 /**
25292  * Gets the 128-bit integer, as 16 little-endian bytes
25293  */
25294 struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
25295
25296 /**
25297  * Constructs a new U128 from 16 little-endian bytes
25298  */
25299 struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
25300
25301 /**
25302  * Constructs a new WitnessProgram given a version and program bytes.
25303  *
25304  * The program MUST be at least 2 bytes and no longer than 40 bytes long.
25305  * Further, if the version is 0, the program MUST be either exactly 20 or exactly 32 bytes long.
25306  */
25307 struct LDKWitnessProgram WitnessProgram_new(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
25308
25309 /**
25310  * Gets the `WitnessVersion` of the given `WitnessProgram`
25311  */
25312 struct LDKWitnessVersion WitnessProgram_get_version(const struct LDKWitnessProgram *NONNULL_PTR prog);
25313
25314 /**
25315  * Gets the witness program bytes of the given `WitnessProgram`
25316  */
25317 struct LDKu8slice WitnessProgram_get_program(const struct LDKWitnessProgram *NONNULL_PTR prog);
25318
25319 /**
25320  * Creates a new WitnessProgram which has the same data as `orig`
25321  */
25322 struct LDKWitnessProgram WitnessProgram_clone(const struct LDKWitnessProgram *NONNULL_PTR orig);
25323
25324 /**
25325  * Releases any memory held by the given `WitnessProgram` (which is currently none)
25326  */
25327 void WitnessProgram_free(struct LDKWitnessProgram o);
25328
25329 /**
25330  * Convenience function for constructing a new BigEndianScalar
25331  */
25332 struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
25333
25334 /**
25335  * Creates a new BigEndianScalar which has the same data as `orig`
25336  */
25337 struct LDKBigEndianScalar BigEndianScalar_clone(const struct LDKBigEndianScalar *NONNULL_PTR orig);
25338
25339 /**
25340  * Creates a new Bech32Error which has the same data as `orig`
25341  */
25342 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
25343
25344 /**
25345  * Releases any memory held by the given `Bech32Error` (which is currently none)
25346  */
25347 void Bech32Error_free(struct LDKBech32Error o);
25348
25349 /**
25350  * Frees the data buffer, if data_is_owned is set and datalen > 0.
25351  */
25352 void Transaction_free(struct LDKTransaction _res);
25353
25354 /**
25355  * Creates a new Witness which has the same data as `orig` but with a new buffer.
25356  */
25357 struct LDKWitness Witness_clone(const struct LDKWitness *NONNULL_PTR orig);
25358
25359 /**
25360  * Frees the data pointed to by data
25361  */
25362 void Witness_free(struct LDKWitness _res);
25363
25364 /**
25365  * Convenience function for constructing a new TxIn
25366  */
25367 struct LDKTxIn TxIn_new(struct LDKWitness witness, struct LDKCVec_u8Z script_sig, uint32_t sequence, struct LDKThirtyTwoBytes previous_txid, uint32_t previous_vout);
25368
25369 /**
25370  * Gets the `witness` in the given `TxIn`.
25371  */
25372 struct LDKWitness TxIn_get_witness(const struct LDKTxIn *NONNULL_PTR txin);
25373
25374 /**
25375  * Gets the `script_sig` in the given `TxIn`.
25376  */
25377 struct LDKu8slice TxIn_get_script_sig(const struct LDKTxIn *NONNULL_PTR txin);
25378
25379 /**
25380  * Gets the `sequence` in the given `TxIn`.
25381  */
25382 uint32_t TxIn_get_sequence(const struct LDKTxIn *NONNULL_PTR txin);
25383
25384 /**
25385  * Gets the previous outpoint txid in the given `TxIn`.
25386  */
25387 struct LDKThirtyTwoBytes TxIn_get_previous_txid(const struct LDKTxIn *NONNULL_PTR txin);
25388
25389 /**
25390  * Gets the previout outpoint index in the given `TxIn`.
25391  */
25392 uint32_t TxIn_get_previous_vout(const struct LDKTxIn *NONNULL_PTR txin);
25393
25394 /**
25395  * Frees the witness and script_sig in a TxIn
25396  */
25397 void TxIn_free(struct LDKTxIn _res);
25398
25399 /**
25400  * Convenience function for constructing a new TxOut
25401  */
25402 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
25403
25404 /**
25405  * Gets the `script_pubkey` in the given `TxOut`.
25406  */
25407 struct LDKu8slice TxOut_get_script_pubkey(const struct LDKTxOut *NONNULL_PTR txout);
25408
25409 /**
25410  * Gets the value in the given `TxOut`.
25411  */
25412 uint64_t TxOut_get_value(const struct LDKTxOut *NONNULL_PTR txout);
25413
25414 /**
25415  * Frees the data pointed to by script_pubkey.
25416  */
25417 void TxOut_free(struct LDKTxOut _res);
25418
25419 /**
25420  * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
25421  */
25422 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
25423
25424 /**
25425  * Frees the data buffer, if chars_is_owned is set and len > 0.
25426  */
25427 void Str_free(struct LDKStr _res);
25428
25429 #if defined(LDK_DEBUG_BUILD)
25430 /**
25431  * This function exists for memory safety testing purposes. It should never be used in production
25432  * code
25433  */
25434 const void *__unmangle_inner_ptr(const void *ptr);
25435 #endif
25436
25437 /**
25438  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25439  */
25440 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
25441
25442 /**
25443  * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ in the success state.
25444  */
25445 struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(struct LDKRefundMaybeWithDerivedMetadataBuilder o);
25446
25447 /**
25448  * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ in the error state.
25449  */
25450 struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
25451
25452 /**
25453  * Checks if the given object is currently in the success state
25454  */
25455 bool CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
25456
25457 /**
25458  * Frees any resources used by the CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.
25459  */
25460 void CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ _res);
25461
25462 /**
25463  * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ which has the same data as `orig`
25464  * but with all dynamically-allocated buffers duplicated in new buffers.
25465  */
25466 struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(const struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR orig);
25467
25468 /**
25469  * Creates a new CResult_RefundBolt12SemanticErrorZ in the success state.
25470  */
25471 struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_ok(struct LDKRefund o);
25472
25473 /**
25474  * Creates a new CResult_RefundBolt12SemanticErrorZ in the error state.
25475  */
25476 struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
25477
25478 /**
25479  * Checks if the given object is currently in the success state
25480  */
25481 bool CResult_RefundBolt12SemanticErrorZ_is_ok(const struct LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR o);
25482
25483 /**
25484  * Frees any resources used by the CResult_RefundBolt12SemanticErrorZ.
25485  */
25486 void CResult_RefundBolt12SemanticErrorZ_free(struct LDKCResult_RefundBolt12SemanticErrorZ _res);
25487
25488 /**
25489  * Creates a new CResult_RefundBolt12SemanticErrorZ which has the same data as `orig`
25490  * but with all dynamically-allocated buffers duplicated in new buffers.
25491  */
25492 struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_clone(const struct LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR orig);
25493
25494 /**
25495  * Constructs a new COption_u64Z containing a u64
25496  */
25497 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
25498
25499 /**
25500  * Constructs a new COption_u64Z containing nothing
25501  */
25502 struct LDKCOption_u64Z COption_u64Z_none(void);
25503
25504 /**
25505  * Frees any resources associated with the u64, if we are in the Some state
25506  */
25507 void COption_u64Z_free(struct LDKCOption_u64Z _res);
25508
25509 /**
25510  * Creates a new COption_u64Z which has the same data as `orig`
25511  * but with all dynamically-allocated buffers duplicated in new buffers.
25512  */
25513 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
25514
25515 /**
25516  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25517  */
25518 void CVec_BlindedPathZ_free(struct LDKCVec_BlindedPathZ _res);
25519
25520 /**
25521  * Creates a new CResult_RefundBolt12ParseErrorZ in the success state.
25522  */
25523 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_ok(struct LDKRefund o);
25524
25525 /**
25526  * Creates a new CResult_RefundBolt12ParseErrorZ in the error state.
25527  */
25528 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
25529
25530 /**
25531  * Checks if the given object is currently in the success state
25532  */
25533 bool CResult_RefundBolt12ParseErrorZ_is_ok(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR o);
25534
25535 /**
25536  * Frees any resources used by the CResult_RefundBolt12ParseErrorZ.
25537  */
25538 void CResult_RefundBolt12ParseErrorZ_free(struct LDKCResult_RefundBolt12ParseErrorZ _res);
25539
25540 /**
25541  * Creates a new CResult_RefundBolt12ParseErrorZ which has the same data as `orig`
25542  * but with all dynamically-allocated buffers duplicated in new buffers.
25543  */
25544 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_clone(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR orig);
25545
25546 /**
25547  * Creates a new CResult_RetryDecodeErrorZ in the success state.
25548  */
25549 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_ok(struct LDKRetry o);
25550
25551 /**
25552  * Creates a new CResult_RetryDecodeErrorZ in the error state.
25553  */
25554 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_err(struct LDKDecodeError e);
25555
25556 /**
25557  * Checks if the given object is currently in the success state
25558  */
25559 bool CResult_RetryDecodeErrorZ_is_ok(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR o);
25560
25561 /**
25562  * Frees any resources used by the CResult_RetryDecodeErrorZ.
25563  */
25564 void CResult_RetryDecodeErrorZ_free(struct LDKCResult_RetryDecodeErrorZ _res);
25565
25566 /**
25567  * Creates a new CResult_RetryDecodeErrorZ which has the same data as `orig`
25568  * but with all dynamically-allocated buffers duplicated in new buffers.
25569  */
25570 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_clone(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR orig);
25571
25572 /**
25573  * Creates a new CResult_NoneAPIErrorZ in the success state.
25574  */
25575 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
25576
25577 /**
25578  * Creates a new CResult_NoneAPIErrorZ in the error state.
25579  */
25580 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
25581
25582 /**
25583  * Checks if the given object is currently in the success state
25584  */
25585 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
25586
25587 /**
25588  * Frees any resources used by the CResult_NoneAPIErrorZ.
25589  */
25590 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
25591
25592 /**
25593  * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
25594  * but with all dynamically-allocated buffers duplicated in new buffers.
25595  */
25596 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
25597
25598 /**
25599  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25600  */
25601 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
25602
25603 /**
25604  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25605  */
25606 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
25607
25608 /**
25609  * Constructs a new COption_ThirtyTwoBytesZ containing a crate::c_types::ThirtyTwoBytes
25610  */
25611 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_some(struct LDKThirtyTwoBytes o);
25612
25613 /**
25614  * Constructs a new COption_ThirtyTwoBytesZ containing nothing
25615  */
25616 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_none(void);
25617
25618 /**
25619  * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
25620  */
25621 void COption_ThirtyTwoBytesZ_free(struct LDKCOption_ThirtyTwoBytesZ _res);
25622
25623 /**
25624  * Creates a new COption_ThirtyTwoBytesZ which has the same data as `orig`
25625  * but with all dynamically-allocated buffers duplicated in new buffers.
25626  */
25627 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_clone(const struct LDKCOption_ThirtyTwoBytesZ *NONNULL_PTR orig);
25628
25629 /**
25630  * Constructs a new COption_CVec_u8ZZ containing a crate::c_types::derived::CVec_u8Z
25631  */
25632 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_some(struct LDKCVec_u8Z o);
25633
25634 /**
25635  * Constructs a new COption_CVec_u8ZZ containing nothing
25636  */
25637 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_none(void);
25638
25639 /**
25640  * Frees any resources associated with the crate::c_types::derived::CVec_u8Z, if we are in the Some state
25641  */
25642 void COption_CVec_u8ZZ_free(struct LDKCOption_CVec_u8ZZ _res);
25643
25644 /**
25645  * Creates a new COption_CVec_u8ZZ which has the same data as `orig`
25646  * but with all dynamically-allocated buffers duplicated in new buffers.
25647  */
25648 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_clone(const struct LDKCOption_CVec_u8ZZ *NONNULL_PTR orig);
25649
25650 /**
25651  * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the success state.
25652  */
25653 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_ok(struct LDKRecipientOnionFields o);
25654
25655 /**
25656  * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the error state.
25657  */
25658 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_err(struct LDKDecodeError e);
25659
25660 /**
25661  * Checks if the given object is currently in the success state
25662  */
25663 bool CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR o);
25664
25665 /**
25666  * Frees any resources used by the CResult_RecipientOnionFieldsDecodeErrorZ.
25667  */
25668 void CResult_RecipientOnionFieldsDecodeErrorZ_free(struct LDKCResult_RecipientOnionFieldsDecodeErrorZ _res);
25669
25670 /**
25671  * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ which has the same data as `orig`
25672  * but with all dynamically-allocated buffers duplicated in new buffers.
25673  */
25674 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_clone(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR orig);
25675
25676 /**
25677  * Creates a new tuple which has the same data as `orig`
25678  * but with all dynamically-allocated buffers duplicated in new buffers.
25679  */
25680 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_clone(const struct LDKC2Tuple_u64CVec_u8ZZ *NONNULL_PTR orig);
25681
25682 /**
25683  * Creates a new C2Tuple_u64CVec_u8ZZ from the contained elements.
25684  */
25685 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_new(uint64_t a, struct LDKCVec_u8Z b);
25686
25687 /**
25688  * Frees any resources used by the C2Tuple_u64CVec_u8ZZ.
25689  */
25690 void C2Tuple_u64CVec_u8ZZ_free(struct LDKC2Tuple_u64CVec_u8ZZ _res);
25691
25692 /**
25693  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25694  */
25695 void CVec_C2Tuple_u64CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u64CVec_u8ZZZ _res);
25696
25697 /**
25698  * Creates a new CResult_RecipientOnionFieldsNoneZ in the success state.
25699  */
25700 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_ok(struct LDKRecipientOnionFields o);
25701
25702 /**
25703  * Creates a new CResult_RecipientOnionFieldsNoneZ in the error state.
25704  */
25705 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_err(void);
25706
25707 /**
25708  * Checks if the given object is currently in the success state
25709  */
25710 bool CResult_RecipientOnionFieldsNoneZ_is_ok(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR o);
25711
25712 /**
25713  * Frees any resources used by the CResult_RecipientOnionFieldsNoneZ.
25714  */
25715 void CResult_RecipientOnionFieldsNoneZ_free(struct LDKCResult_RecipientOnionFieldsNoneZ _res);
25716
25717 /**
25718  * Creates a new CResult_RecipientOnionFieldsNoneZ which has the same data as `orig`
25719  * but with all dynamically-allocated buffers duplicated in new buffers.
25720  */
25721 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_clone(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR orig);
25722
25723 /**
25724  * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ in the success state.
25725  */
25726 struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok(struct LDKUnsignedBolt12Invoice o);
25727
25728 /**
25729  * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ in the error state.
25730  */
25731 struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
25732
25733 /**
25734  * Checks if the given object is currently in the success state
25735  */
25736 bool CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(const struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR o);
25737
25738 /**
25739  * Frees any resources used by the CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ.
25740  */
25741 void CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_free(struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ _res);
25742
25743 /**
25744  * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ which has the same data as `orig`
25745  * but with all dynamically-allocated buffers duplicated in new buffers.
25746  */
25747 struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone(const struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR orig);
25748
25749 /**
25750  * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ in the success state.
25751  */
25752 struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_ok(struct LDKBolt12Invoice o);
25753
25754 /**
25755  * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ in the error state.
25756  */
25757 struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
25758
25759 /**
25760  * Checks if the given object is currently in the success state
25761  */
25762 bool CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR o);
25763
25764 /**
25765  * Frees any resources used by the CResult_Bolt12InvoiceBolt12SemanticErrorZ.
25766  */
25767 void CResult_Bolt12InvoiceBolt12SemanticErrorZ_free(struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ _res);
25768
25769 /**
25770  * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ which has the same data as `orig`
25771  * but with all dynamically-allocated buffers duplicated in new buffers.
25772  */
25773 struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone(const struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR orig);
25774
25775 /**
25776  * Creates a new CResult_SchnorrSignatureNoneZ in the success state.
25777  */
25778 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_ok(struct LDKSchnorrSignature o);
25779
25780 /**
25781  * Creates a new CResult_SchnorrSignatureNoneZ in the error state.
25782  */
25783 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_err(void);
25784
25785 /**
25786  * Checks if the given object is currently in the success state
25787  */
25788 bool CResult_SchnorrSignatureNoneZ_is_ok(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR o);
25789
25790 /**
25791  * Frees any resources used by the CResult_SchnorrSignatureNoneZ.
25792  */
25793 void CResult_SchnorrSignatureNoneZ_free(struct LDKCResult_SchnorrSignatureNoneZ _res);
25794
25795 /**
25796  * Creates a new CResult_SchnorrSignatureNoneZ which has the same data as `orig`
25797  * but with all dynamically-allocated buffers duplicated in new buffers.
25798  */
25799 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_clone(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR orig);
25800
25801 /**
25802  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25803  */
25804 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
25805
25806 /**
25807  * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing a crate::c_types::derived::CVec_ThirtyTwoBytesZ
25808  */
25809 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_some(struct LDKCVec_ThirtyTwoBytesZ o);
25810
25811 /**
25812  * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing nothing
25813  */
25814 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_none(void);
25815
25816 /**
25817  * Frees any resources associated with the crate::c_types::derived::CVec_ThirtyTwoBytesZ, if we are in the Some state
25818  */
25819 void COption_CVec_ThirtyTwoBytesZZ_free(struct LDKCOption_CVec_ThirtyTwoBytesZZ _res);
25820
25821 /**
25822  * Creates a new COption_CVec_ThirtyTwoBytesZZ which has the same data as `orig`
25823  * but with all dynamically-allocated buffers duplicated in new buffers.
25824  */
25825 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_clone(const struct LDKCOption_CVec_ThirtyTwoBytesZZ *NONNULL_PTR orig);
25826
25827 /**
25828  * Constructs a new COption_AmountZ containing a crate::lightning::offers::offer::Amount
25829  */
25830 struct LDKCOption_AmountZ COption_AmountZ_some(struct LDKAmount o);
25831
25832 /**
25833  * Constructs a new COption_AmountZ containing nothing
25834  */
25835 struct LDKCOption_AmountZ COption_AmountZ_none(void);
25836
25837 /**
25838  * Frees any resources associated with the crate::lightning::offers::offer::Amount, if we are in the Some state
25839  */
25840 void COption_AmountZ_free(struct LDKCOption_AmountZ _res);
25841
25842 /**
25843  * Creates a new COption_AmountZ which has the same data as `orig`
25844  * but with all dynamically-allocated buffers duplicated in new buffers.
25845  */
25846 struct LDKCOption_AmountZ COption_AmountZ_clone(const struct LDKCOption_AmountZ *NONNULL_PTR orig);
25847
25848 /**
25849  * Constructs a new COption_QuantityZ containing a crate::lightning::offers::offer::Quantity
25850  */
25851 struct LDKCOption_QuantityZ COption_QuantityZ_some(struct LDKQuantity o);
25852
25853 /**
25854  * Constructs a new COption_QuantityZ containing nothing
25855  */
25856 struct LDKCOption_QuantityZ COption_QuantityZ_none(void);
25857
25858 /**
25859  * Frees any resources associated with the crate::lightning::offers::offer::Quantity, if we are in the Some state
25860  */
25861 void COption_QuantityZ_free(struct LDKCOption_QuantityZ _res);
25862
25863 /**
25864  * Creates a new COption_QuantityZ which has the same data as `orig`
25865  * but with all dynamically-allocated buffers duplicated in new buffers.
25866  */
25867 struct LDKCOption_QuantityZ COption_QuantityZ_clone(const struct LDKCOption_QuantityZ *NONNULL_PTR orig);
25868
25869 /**
25870  * Creates a new CResult_ThirtyTwoBytesNoneZ in the success state.
25871  */
25872 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_ok(struct LDKThirtyTwoBytes o);
25873
25874 /**
25875  * Creates a new CResult_ThirtyTwoBytesNoneZ in the error state.
25876  */
25877 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_err(void);
25878
25879 /**
25880  * Checks if the given object is currently in the success state
25881  */
25882 bool CResult_ThirtyTwoBytesNoneZ_is_ok(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR o);
25883
25884 /**
25885  * Frees any resources used by the CResult_ThirtyTwoBytesNoneZ.
25886  */
25887 void CResult_ThirtyTwoBytesNoneZ_free(struct LDKCResult_ThirtyTwoBytesNoneZ _res);
25888
25889 /**
25890  * Creates a new CResult_ThirtyTwoBytesNoneZ which has the same data as `orig`
25891  * but with all dynamically-allocated buffers duplicated in new buffers.
25892  */
25893 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_clone(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR orig);
25894
25895 /**
25896  * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state.
25897  */
25898 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o);
25899
25900 /**
25901  * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the error state.
25902  */
25903 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e);
25904
25905 /**
25906  * Checks if the given object is currently in the success state
25907  */
25908 bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o);
25909
25910 /**
25911  * Frees any resources used by the CResult_BlindedPayInfoDecodeErrorZ.
25912  */
25913 void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res);
25914
25915 /**
25916  * Creates a new CResult_BlindedPayInfoDecodeErrorZ which has the same data as `orig`
25917  * but with all dynamically-allocated buffers duplicated in new buffers.
25918  */
25919 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig);
25920
25921 /**
25922  * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
25923  */
25924 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
25925
25926 /**
25927  * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
25928  */
25929 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25930
25931 /**
25932  * Checks if the given object is currently in the success state
25933  */
25934 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
25935
25936 /**
25937  * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
25938  */
25939 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
25940
25941 /**
25942  * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
25943  * but with all dynamically-allocated buffers duplicated in new buffers.
25944  */
25945 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
25946
25947 /**
25948  * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
25949  */
25950 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
25951
25952 /**
25953  * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
25954  */
25955 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25956
25957 /**
25958  * Checks if the given object is currently in the success state
25959  */
25960 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
25961
25962 /**
25963  * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
25964  */
25965 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
25966
25967 /**
25968  * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
25969  * but with all dynamically-allocated buffers duplicated in new buffers.
25970  */
25971 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
25972
25973 /**
25974  * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
25975  */
25976 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
25977
25978 /**
25979  * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
25980  */
25981 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25982
25983 /**
25984  * Checks if the given object is currently in the success state
25985  */
25986 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
25987
25988 /**
25989  * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
25990  */
25991 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
25992
25993 /**
25994  * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
25995  * but with all dynamically-allocated buffers duplicated in new buffers.
25996  */
25997 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
25998
25999 /**
26000  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26001  */
26002 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
26003
26004 /**
26005  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26006  */
26007 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
26008
26009 /**
26010  * Constructs a new COption_u32Z containing a u32
26011  */
26012 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
26013
26014 /**
26015  * Constructs a new COption_u32Z containing nothing
26016  */
26017 struct LDKCOption_u32Z COption_u32Z_none(void);
26018
26019 /**
26020  * Frees any resources associated with the u32, if we are in the Some state
26021  */
26022 void COption_u32Z_free(struct LDKCOption_u32Z _res);
26023
26024 /**
26025  * Creates a new COption_u32Z which has the same data as `orig`
26026  * but with all dynamically-allocated buffers duplicated in new buffers.
26027  */
26028 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
26029
26030 /**
26031  * Creates a new tuple which has the same data as `orig`
26032  * but with all dynamically-allocated buffers duplicated in new buffers.
26033  */
26034 struct LDKC2Tuple_CVec_u8Zu64Z C2Tuple_CVec_u8Zu64Z_clone(const struct LDKC2Tuple_CVec_u8Zu64Z *NONNULL_PTR orig);
26035
26036 /**
26037  * Creates a new C2Tuple_CVec_u8Zu64Z from the contained elements.
26038  */
26039 struct LDKC2Tuple_CVec_u8Zu64Z C2Tuple_CVec_u8Zu64Z_new(struct LDKCVec_u8Z a, uint64_t b);
26040
26041 /**
26042  * Frees any resources used by the C2Tuple_CVec_u8Zu64Z.
26043  */
26044 void C2Tuple_CVec_u8Zu64Z_free(struct LDKC2Tuple_CVec_u8Zu64Z _res);
26045
26046 /**
26047  * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ in the success state.
26048  */
26049 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_ok(struct LDKC2Tuple_CVec_u8Zu64Z o);
26050
26051 /**
26052  * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ in the error state.
26053  */
26054 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_err(void);
26055
26056 /**
26057  * Checks if the given object is currently in the success state
26058  */
26059 bool CResult_C2Tuple_CVec_u8Zu64ZNoneZ_is_ok(const struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR o);
26060
26061 /**
26062  * Frees any resources used by the CResult_C2Tuple_CVec_u8Zu64ZNoneZ.
26063  */
26064 void CResult_C2Tuple_CVec_u8Zu64ZNoneZ_free(struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ _res);
26065
26066 /**
26067  * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ which has the same data as `orig`
26068  * but with all dynamically-allocated buffers duplicated in new buffers.
26069  */
26070 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_clone(const struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR orig);
26071
26072 /**
26073  * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the success state.
26074  */
26075 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_ok(struct LDKChannelDerivationParameters o);
26076
26077 /**
26078  * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the error state.
26079  */
26080 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_err(struct LDKDecodeError e);
26081
26082 /**
26083  * Checks if the given object is currently in the success state
26084  */
26085 bool CResult_ChannelDerivationParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR o);
26086
26087 /**
26088  * Frees any resources used by the CResult_ChannelDerivationParametersDecodeErrorZ.
26089  */
26090 void CResult_ChannelDerivationParametersDecodeErrorZ_free(struct LDKCResult_ChannelDerivationParametersDecodeErrorZ _res);
26091
26092 /**
26093  * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ which has the same data as `orig`
26094  * but with all dynamically-allocated buffers duplicated in new buffers.
26095  */
26096 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR orig);
26097
26098 /**
26099  * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the success state.
26100  */
26101 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_ok(struct LDKHTLCDescriptor o);
26102
26103 /**
26104  * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the error state.
26105  */
26106 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
26107
26108 /**
26109  * Checks if the given object is currently in the success state
26110  */
26111 bool CResult_HTLCDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR o);
26112
26113 /**
26114  * Frees any resources used by the CResult_HTLCDescriptorDecodeErrorZ.
26115  */
26116 void CResult_HTLCDescriptorDecodeErrorZ_free(struct LDKCResult_HTLCDescriptorDecodeErrorZ _res);
26117
26118 /**
26119  * Creates a new CResult_HTLCDescriptorDecodeErrorZ which has the same data as `orig`
26120  * but with all dynamically-allocated buffers duplicated in new buffers.
26121  */
26122 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_clone(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR orig);
26123
26124 /**
26125  * Creates a new CResult_NoneNoneZ in the success state.
26126  */
26127 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
26128
26129 /**
26130  * Creates a new CResult_NoneNoneZ in the error state.
26131  */
26132 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
26133
26134 /**
26135  * Checks if the given object is currently in the success state
26136  */
26137 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
26138
26139 /**
26140  * Frees any resources used by the CResult_NoneNoneZ.
26141  */
26142 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
26143
26144 /**
26145  * Creates a new CResult_NoneNoneZ which has the same data as `orig`
26146  * but with all dynamically-allocated buffers duplicated in new buffers.
26147  */
26148 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
26149
26150 /**
26151  * Creates a new CResult_PublicKeyNoneZ in the success state.
26152  */
26153 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
26154
26155 /**
26156  * Creates a new CResult_PublicKeyNoneZ in the error state.
26157  */
26158 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
26159
26160 /**
26161  * Checks if the given object is currently in the success state
26162  */
26163 bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
26164
26165 /**
26166  * Frees any resources used by the CResult_PublicKeyNoneZ.
26167  */
26168 void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
26169
26170 /**
26171  * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
26172  * but with all dynamically-allocated buffers duplicated in new buffers.
26173  */
26174 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
26175
26176 /**
26177  * Constructs a new COption_BigEndianScalarZ containing a crate::c_types::BigEndianScalar
26178  */
26179 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_some(struct LDKBigEndianScalar o);
26180
26181 /**
26182  * Constructs a new COption_BigEndianScalarZ containing nothing
26183  */
26184 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_none(void);
26185
26186 /**
26187  * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
26188  */
26189 void COption_BigEndianScalarZ_free(struct LDKCOption_BigEndianScalarZ _res);
26190
26191 /**
26192  * Creates a new COption_BigEndianScalarZ which has the same data as `orig`
26193  * but with all dynamically-allocated buffers duplicated in new buffers.
26194  */
26195 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_clone(const struct LDKCOption_BigEndianScalarZ *NONNULL_PTR orig);
26196
26197 /**
26198  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26199  */
26200 void CVec_U5Z_free(struct LDKCVec_U5Z _res);
26201
26202 /**
26203  * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
26204  */
26205 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
26206
26207 /**
26208  * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
26209  */
26210 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
26211
26212 /**
26213  * Checks if the given object is currently in the success state
26214  */
26215 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
26216
26217 /**
26218  * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
26219  */
26220 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
26221
26222 /**
26223  * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
26224  * but with all dynamically-allocated buffers duplicated in new buffers.
26225  */
26226 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
26227
26228 /**
26229  * Creates a new CResult_ECDSASignatureNoneZ in the success state.
26230  */
26231 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_ok(struct LDKECDSASignature o);
26232
26233 /**
26234  * Creates a new CResult_ECDSASignatureNoneZ in the error state.
26235  */
26236 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_err(void);
26237
26238 /**
26239  * Checks if the given object is currently in the success state
26240  */
26241 bool CResult_ECDSASignatureNoneZ_is_ok(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR o);
26242
26243 /**
26244  * Frees any resources used by the CResult_ECDSASignatureNoneZ.
26245  */
26246 void CResult_ECDSASignatureNoneZ_free(struct LDKCResult_ECDSASignatureNoneZ _res);
26247
26248 /**
26249  * Creates a new CResult_ECDSASignatureNoneZ which has the same data as `orig`
26250  * but with all dynamically-allocated buffers duplicated in new buffers.
26251  */
26252 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_clone(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR orig);
26253
26254 /**
26255  * Creates a new CResult_TransactionNoneZ in the success state.
26256  */
26257 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
26258
26259 /**
26260  * Creates a new CResult_TransactionNoneZ in the error state.
26261  */
26262 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
26263
26264 /**
26265  * Checks if the given object is currently in the success state
26266  */
26267 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
26268
26269 /**
26270  * Frees any resources used by the CResult_TransactionNoneZ.
26271  */
26272 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
26273
26274 /**
26275  * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
26276  * but with all dynamically-allocated buffers duplicated in new buffers.
26277  */
26278 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
26279
26280 /**
26281  * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
26282  */
26283 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o);
26284
26285 /**
26286  * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state.
26287  */
26288 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e);
26289
26290 /**
26291  * Checks if the given object is currently in the success state
26292  */
26293 bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o);
26294
26295 /**
26296  * Frees any resources used by the CResult_WriteableEcdsaChannelSignerDecodeErrorZ.
26297  */
26298 void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res);
26299
26300 /**
26301  * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ which has the same data as `orig`
26302  * but with all dynamically-allocated buffers duplicated in new buffers.
26303  */
26304 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig);
26305
26306 /**
26307  * Creates a new CResult_CVec_u8ZNoneZ in the success state.
26308  */
26309 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_ok(struct LDKCVec_u8Z o);
26310
26311 /**
26312  * Creates a new CResult_CVec_u8ZNoneZ in the error state.
26313  */
26314 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_err(void);
26315
26316 /**
26317  * Checks if the given object is currently in the success state
26318  */
26319 bool CResult_CVec_u8ZNoneZ_is_ok(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR o);
26320
26321 /**
26322  * Frees any resources used by the CResult_CVec_u8ZNoneZ.
26323  */
26324 void CResult_CVec_u8ZNoneZ_free(struct LDKCResult_CVec_u8ZNoneZ _res);
26325
26326 /**
26327  * Creates a new CResult_CVec_u8ZNoneZ which has the same data as `orig`
26328  * but with all dynamically-allocated buffers duplicated in new buffers.
26329  */
26330 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_clone(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR orig);
26331
26332 /**
26333  * Creates a new CResult_ShutdownScriptNoneZ in the success state.
26334  */
26335 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_ok(struct LDKShutdownScript o);
26336
26337 /**
26338  * Creates a new CResult_ShutdownScriptNoneZ in the error state.
26339  */
26340 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_err(void);
26341
26342 /**
26343  * Checks if the given object is currently in the success state
26344  */
26345 bool CResult_ShutdownScriptNoneZ_is_ok(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR o);
26346
26347 /**
26348  * Frees any resources used by the CResult_ShutdownScriptNoneZ.
26349  */
26350 void CResult_ShutdownScriptNoneZ_free(struct LDKCResult_ShutdownScriptNoneZ _res);
26351
26352 /**
26353  * Creates a new CResult_ShutdownScriptNoneZ which has the same data as `orig`
26354  * but with all dynamically-allocated buffers duplicated in new buffers.
26355  */
26356 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_clone(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR orig);
26357
26358 /**
26359  * Constructs a new COption_u16Z containing a u16
26360  */
26361 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
26362
26363 /**
26364  * Constructs a new COption_u16Z containing nothing
26365  */
26366 struct LDKCOption_u16Z COption_u16Z_none(void);
26367
26368 /**
26369  * Frees any resources associated with the u16, if we are in the Some state
26370  */
26371 void COption_u16Z_free(struct LDKCOption_u16Z _res);
26372
26373 /**
26374  * Creates a new COption_u16Z which has the same data as `orig`
26375  * but with all dynamically-allocated buffers duplicated in new buffers.
26376  */
26377 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
26378
26379 /**
26380  * Constructs a new COption_boolZ containing a bool
26381  */
26382 struct LDKCOption_boolZ COption_boolZ_some(bool o);
26383
26384 /**
26385  * Constructs a new COption_boolZ containing nothing
26386  */
26387 struct LDKCOption_boolZ COption_boolZ_none(void);
26388
26389 /**
26390  * Frees any resources associated with the bool, if we are in the Some state
26391  */
26392 void COption_boolZ_free(struct LDKCOption_boolZ _res);
26393
26394 /**
26395  * Creates a new COption_boolZ which has the same data as `orig`
26396  * but with all dynamically-allocated buffers duplicated in new buffers.
26397  */
26398 struct LDKCOption_boolZ COption_boolZ_clone(const struct LDKCOption_boolZ *NONNULL_PTR orig);
26399
26400 /**
26401  * Creates a new CResult_WitnessNoneZ in the success state.
26402  */
26403 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_ok(struct LDKWitness o);
26404
26405 /**
26406  * Creates a new CResult_WitnessNoneZ in the error state.
26407  */
26408 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_err(void);
26409
26410 /**
26411  * Checks if the given object is currently in the success state
26412  */
26413 bool CResult_WitnessNoneZ_is_ok(const struct LDKCResult_WitnessNoneZ *NONNULL_PTR o);
26414
26415 /**
26416  * Frees any resources used by the CResult_WitnessNoneZ.
26417  */
26418 void CResult_WitnessNoneZ_free(struct LDKCResult_WitnessNoneZ _res);
26419
26420 /**
26421  * Creates a new CResult_WitnessNoneZ which has the same data as `orig`
26422  * but with all dynamically-allocated buffers duplicated in new buffers.
26423  */
26424 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_clone(const struct LDKCResult_WitnessNoneZ *NONNULL_PTR orig);
26425
26426 /**
26427  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26428  */
26429 void CVec_ECDSASignatureZ_free(struct LDKCVec_ECDSASignatureZ _res);
26430
26431 /**
26432  * Creates a new tuple which has the same data as `orig`
26433  * but with all dynamically-allocated buffers duplicated in new buffers.
26434  */
26435 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(const struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR orig);
26436
26437 /**
26438  * Creates a new C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ from the contained elements.
26439  */
26440 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_new(struct LDKECDSASignature a, struct LDKCVec_ECDSASignatureZ b);
26441
26442 /**
26443  * Frees any resources used by the C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ.
26444  */
26445 void C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_free(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ _res);
26446
26447 /**
26448  * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the success state.
26449  */
26450 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ o);
26451
26452 /**
26453  * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the error state.
26454  */
26455 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_err(void);
26456
26457 /**
26458  * Checks if the given object is currently in the success state
26459  */
26460 bool CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR o);
26461
26462 /**
26463  * Frees any resources used by the CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.
26464  */
26465 void CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_free(struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ _res);
26466
26467 /**
26468  * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ which has the same data as `orig`
26469  * but with all dynamically-allocated buffers duplicated in new buffers.
26470  */
26471 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR orig);
26472
26473 /**
26474  * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
26475  */
26476 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
26477
26478 /**
26479  * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
26480  */
26481 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
26482
26483 /**
26484  * Checks if the given object is currently in the success state
26485  */
26486 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
26487
26488 /**
26489  * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
26490  */
26491 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
26492
26493 /**
26494  * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
26495  * but with all dynamically-allocated buffers duplicated in new buffers.
26496  */
26497 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
26498
26499 /**
26500  * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
26501  */
26502 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
26503
26504 /**
26505  * Constructs a new COption_WriteableScoreZ containing nothing
26506  */
26507 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
26508
26509 /**
26510  * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
26511  */
26512 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
26513
26514 /**
26515  * Creates a new CResult_NoneIOErrorZ in the success state.
26516  */
26517 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_ok(void);
26518
26519 /**
26520  * Creates a new CResult_NoneIOErrorZ in the error state.
26521  */
26522 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_err(enum LDKIOError e);
26523
26524 /**
26525  * Checks if the given object is currently in the success state
26526  */
26527 bool CResult_NoneIOErrorZ_is_ok(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR o);
26528
26529 /**
26530  * Frees any resources used by the CResult_NoneIOErrorZ.
26531  */
26532 void CResult_NoneIOErrorZ_free(struct LDKCResult_NoneIOErrorZ _res);
26533
26534 /**
26535  * Creates a new CResult_NoneIOErrorZ which has the same data as `orig`
26536  * but with all dynamically-allocated buffers duplicated in new buffers.
26537  */
26538 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_clone(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR orig);
26539
26540 /**
26541  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26542  */
26543 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
26544
26545 /**
26546  * Creates a new CResult_RouteLightningErrorZ in the success state.
26547  */
26548 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
26549
26550 /**
26551  * Creates a new CResult_RouteLightningErrorZ in the error state.
26552  */
26553 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
26554
26555 /**
26556  * Checks if the given object is currently in the success state
26557  */
26558 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
26559
26560 /**
26561  * Frees any resources used by the CResult_RouteLightningErrorZ.
26562  */
26563 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
26564
26565 /**
26566  * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
26567  * but with all dynamically-allocated buffers duplicated in new buffers.
26568  */
26569 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
26570
26571 /**
26572  * Creates a new tuple which has the same data as `orig`
26573  * but with all dynamically-allocated buffers duplicated in new buffers.
26574  */
26575 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_clone(const struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR orig);
26576
26577 /**
26578  * Creates a new C2Tuple_BlindedPayInfoBlindedPathZ from the contained elements.
26579  */
26580 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_new(struct LDKBlindedPayInfo a, struct LDKBlindedPath b);
26581
26582 /**
26583  * Frees any resources used by the C2Tuple_BlindedPayInfoBlindedPathZ.
26584  */
26585 void C2Tuple_BlindedPayInfoBlindedPathZ_free(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ _res);
26586
26587 /**
26588  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26589  */
26590 void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res);
26591
26592 /**
26593  * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the success state.
26594  */
26595 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ o);
26596
26597 /**
26598  * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the error state.
26599  */
26600 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(void);
26601
26602 /**
26603  * Checks if the given object is currently in the success state
26604  */
26605 bool CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR o);
26606
26607 /**
26608  * Frees any resources used by the CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.
26609  */
26610 void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ _res);
26611
26612 /**
26613  * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ which has the same data as `orig`
26614  * but with all dynamically-allocated buffers duplicated in new buffers.
26615  */
26616 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR orig);
26617
26618 /**
26619  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26620  */
26621 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
26622
26623 /**
26624  * Creates a new CResult_OnionMessagePathNoneZ in the success state.
26625  */
26626 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_ok(struct LDKOnionMessagePath o);
26627
26628 /**
26629  * Creates a new CResult_OnionMessagePathNoneZ in the error state.
26630  */
26631 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_err(void);
26632
26633 /**
26634  * Checks if the given object is currently in the success state
26635  */
26636 bool CResult_OnionMessagePathNoneZ_is_ok(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR o);
26637
26638 /**
26639  * Frees any resources used by the CResult_OnionMessagePathNoneZ.
26640  */
26641 void CResult_OnionMessagePathNoneZ_free(struct LDKCResult_OnionMessagePathNoneZ _res);
26642
26643 /**
26644  * Creates a new CResult_OnionMessagePathNoneZ which has the same data as `orig`
26645  * but with all dynamically-allocated buffers duplicated in new buffers.
26646  */
26647 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_clone(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR orig);
26648
26649 /**
26650  * Creates a new CResult_CVec_BlindedPathZNoneZ in the success state.
26651  */
26652 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_ok(struct LDKCVec_BlindedPathZ o);
26653
26654 /**
26655  * Creates a new CResult_CVec_BlindedPathZNoneZ in the error state.
26656  */
26657 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_err(void);
26658
26659 /**
26660  * Checks if the given object is currently in the success state
26661  */
26662 bool CResult_CVec_BlindedPathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR o);
26663
26664 /**
26665  * Frees any resources used by the CResult_CVec_BlindedPathZNoneZ.
26666  */
26667 void CResult_CVec_BlindedPathZNoneZ_free(struct LDKCResult_CVec_BlindedPathZNoneZ _res);
26668
26669 /**
26670  * Creates a new CResult_CVec_BlindedPathZNoneZ which has the same data as `orig`
26671  * but with all dynamically-allocated buffers duplicated in new buffers.
26672  */
26673 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_clone(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR orig);
26674
26675 /**
26676  * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
26677  */
26678 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
26679
26680 /**
26681  * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
26682  */
26683 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
26684
26685 /**
26686  * Checks if the given object is currently in the success state
26687  */
26688 bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
26689
26690 /**
26691  * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
26692  */
26693 void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
26694
26695 /**
26696  * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig`
26697  * but with all dynamically-allocated buffers duplicated in new buffers.
26698  */
26699 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig);
26700
26701 /**
26702  * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
26703  */
26704 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
26705
26706 /**
26707  * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
26708  */
26709 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
26710
26711 /**
26712  * Checks if the given object is currently in the success state
26713  */
26714 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
26715
26716 /**
26717  * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
26718  */
26719 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
26720
26721 /**
26722  * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
26723  * but with all dynamically-allocated buffers duplicated in new buffers.
26724  */
26725 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
26726
26727 /**
26728  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26729  */
26730 void CVec_BlindedHopZ_free(struct LDKCVec_BlindedHopZ _res);
26731
26732 /**
26733  * Creates a new CResult_BlindedTailDecodeErrorZ in the success state.
26734  */
26735 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_ok(struct LDKBlindedTail o);
26736
26737 /**
26738  * Creates a new CResult_BlindedTailDecodeErrorZ in the error state.
26739  */
26740 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_err(struct LDKDecodeError e);
26741
26742 /**
26743  * Checks if the given object is currently in the success state
26744  */
26745 bool CResult_BlindedTailDecodeErrorZ_is_ok(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR o);
26746
26747 /**
26748  * Frees any resources used by the CResult_BlindedTailDecodeErrorZ.
26749  */
26750 void CResult_BlindedTailDecodeErrorZ_free(struct LDKCResult_BlindedTailDecodeErrorZ _res);
26751
26752 /**
26753  * Creates a new CResult_BlindedTailDecodeErrorZ which has the same data as `orig`
26754  * but with all dynamically-allocated buffers duplicated in new buffers.
26755  */
26756 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_clone(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR orig);
26757
26758 /**
26759  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26760  */
26761 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
26762
26763 /**
26764  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26765  */
26766 void CVec_PathZ_free(struct LDKCVec_PathZ _res);
26767
26768 /**
26769  * Creates a new CResult_RouteDecodeErrorZ in the success state.
26770  */
26771 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
26772
26773 /**
26774  * Creates a new CResult_RouteDecodeErrorZ in the error state.
26775  */
26776 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
26777
26778 /**
26779  * Checks if the given object is currently in the success state
26780  */
26781 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
26782
26783 /**
26784  * Frees any resources used by the CResult_RouteDecodeErrorZ.
26785  */
26786 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
26787
26788 /**
26789  * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
26790  * but with all dynamically-allocated buffers duplicated in new buffers.
26791  */
26792 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
26793
26794 /**
26795  * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
26796  */
26797 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
26798
26799 /**
26800  * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
26801  */
26802 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
26803
26804 /**
26805  * Checks if the given object is currently in the success state
26806  */
26807 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
26808
26809 /**
26810  * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
26811  */
26812 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
26813
26814 /**
26815  * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
26816  * but with all dynamically-allocated buffers duplicated in new buffers.
26817  */
26818 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
26819
26820 /**
26821  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26822  */
26823 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
26824
26825 /**
26826  * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
26827  */
26828 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
26829
26830 /**
26831  * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
26832  */
26833 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
26834
26835 /**
26836  * Checks if the given object is currently in the success state
26837  */
26838 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
26839
26840 /**
26841  * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
26842  */
26843 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
26844
26845 /**
26846  * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
26847  * but with all dynamically-allocated buffers duplicated in new buffers.
26848  */
26849 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
26850
26851 /**
26852  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26853  */
26854 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
26855
26856 /**
26857  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26858  */
26859 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
26860
26861 /**
26862  * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
26863  */
26864 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
26865
26866 /**
26867  * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
26868  */
26869 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
26870
26871 /**
26872  * Checks if the given object is currently in the success state
26873  */
26874 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
26875
26876 /**
26877  * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
26878  */
26879 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
26880
26881 /**
26882  * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
26883  * but with all dynamically-allocated buffers duplicated in new buffers.
26884  */
26885 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
26886
26887 /**
26888  * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
26889  */
26890 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
26891
26892 /**
26893  * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
26894  */
26895 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
26896
26897 /**
26898  * Checks if the given object is currently in the success state
26899  */
26900 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
26901
26902 /**
26903  * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
26904  */
26905 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
26906
26907 /**
26908  * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
26909  * but with all dynamically-allocated buffers duplicated in new buffers.
26910  */
26911 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
26912
26913 /**
26914  * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
26915  */
26916 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
26917
26918 /**
26919  * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
26920  */
26921 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
26922
26923 /**
26924  * Checks if the given object is currently in the success state
26925  */
26926 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
26927
26928 /**
26929  * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
26930  */
26931 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
26932
26933 /**
26934  * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
26935  * but with all dynamically-allocated buffers duplicated in new buffers.
26936  */
26937 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
26938
26939 /**
26940  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26941  */
26942 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
26943
26944 /**
26945  * Creates a new tuple which has the same data as `orig`
26946  * but with all dynamically-allocated buffers duplicated in new buffers.
26947  */
26948 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
26949
26950 /**
26951  * Creates a new C2Tuple_u64u64Z from the contained elements.
26952  */
26953 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
26954
26955 /**
26956  * Frees any resources used by the C2Tuple_u64u64Z.
26957  */
26958 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
26959
26960 /**
26961  * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
26962  */
26963 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
26964
26965 /**
26966  * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
26967  */
26968 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
26969
26970 /**
26971  * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
26972  */
26973 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
26974
26975 /**
26976  * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
26977  * but with all dynamically-allocated buffers duplicated in new buffers.
26978  */
26979 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
26980
26981 /**
26982  * Creates a new C2Tuple_Z from the contained elements.
26983  */
26984 struct LDKC2Tuple_Z C2Tuple_Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
26985
26986 /**
26987  * Frees any resources used by the C2Tuple_Z.
26988  */
26989 void C2Tuple_Z_free(struct LDKC2Tuple_Z _res);
26990
26991 /**
26992  * Creates a new C2Tuple__u1632_u1632Z from the contained elements.
26993  */
26994 struct LDKC2Tuple__u1632_u1632Z C2Tuple__u1632_u1632Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
26995
26996 /**
26997  * Frees any resources used by the C2Tuple__u1632_u1632Z.
26998  */
26999 void C2Tuple__u1632_u1632Z_free(struct LDKC2Tuple__u1632_u1632Z _res);
27000
27001 /**
27002  * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing a crate::c_types::derived::C2Tuple__u1632_u1632Z
27003  */
27004 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_some(struct LDKC2Tuple__u1632_u1632Z o);
27005
27006 /**
27007  * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing nothing
27008  */
27009 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_none(void);
27010
27011 /**
27012  * Frees any resources associated with the crate::c_types::derived::C2Tuple__u1632_u1632Z, if we are in the Some state
27013  */
27014 void COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_free(struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ _res);
27015
27016 /**
27017  * Constructs a new COption_f64Z containing a f64
27018  */
27019 struct LDKCOption_f64Z COption_f64Z_some(double o);
27020
27021 /**
27022  * Constructs a new COption_f64Z containing nothing
27023  */
27024 struct LDKCOption_f64Z COption_f64Z_none(void);
27025
27026 /**
27027  * Frees any resources associated with the f64, if we are in the Some state
27028  */
27029 void COption_f64Z_free(struct LDKCOption_f64Z _res);
27030
27031 /**
27032  * Creates a new COption_f64Z which has the same data as `orig`
27033  * but with all dynamically-allocated buffers duplicated in new buffers.
27034  */
27035 struct LDKCOption_f64Z COption_f64Z_clone(const struct LDKCOption_f64Z *NONNULL_PTR orig);
27036
27037 /**
27038  * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
27039  */
27040 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
27041
27042 /**
27043  * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
27044  */
27045 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
27046
27047 /**
27048  * Checks if the given object is currently in the success state
27049  */
27050 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
27051
27052 /**
27053  * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
27054  */
27055 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
27056
27057 /**
27058  * Creates a new CResult_BestBlockDecodeErrorZ in the success state.
27059  */
27060 struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_ok(struct LDKBestBlock o);
27061
27062 /**
27063  * Creates a new CResult_BestBlockDecodeErrorZ in the error state.
27064  */
27065 struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_err(struct LDKDecodeError e);
27066
27067 /**
27068  * Checks if the given object is currently in the success state
27069  */
27070 bool CResult_BestBlockDecodeErrorZ_is_ok(const struct LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR o);
27071
27072 /**
27073  * Frees any resources used by the CResult_BestBlockDecodeErrorZ.
27074  */
27075 void CResult_BestBlockDecodeErrorZ_free(struct LDKCResult_BestBlockDecodeErrorZ _res);
27076
27077 /**
27078  * Creates a new CResult_BestBlockDecodeErrorZ which has the same data as `orig`
27079  * but with all dynamically-allocated buffers duplicated in new buffers.
27080  */
27081 struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_clone(const struct LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR orig);
27082
27083 /**
27084  * Creates a new tuple which has the same data as `orig`
27085  * but with all dynamically-allocated buffers duplicated in new buffers.
27086  */
27087 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
27088
27089 /**
27090  * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
27091  */
27092 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
27093
27094 /**
27095  * Frees any resources used by the C2Tuple_usizeTransactionZ.
27096  */
27097 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
27098
27099 /**
27100  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27101  */
27102 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
27103
27104 /**
27105  * Creates a new tuple which has the same data as `orig`
27106  * but with all dynamically-allocated buffers duplicated in new buffers.
27107  */
27108 struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *NONNULL_PTR orig);
27109
27110 /**
27111  * Creates a new C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ from the contained elements.
27112  */
27113 struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_new(struct LDKThirtyTwoBytes a, uint32_t b, struct LDKCOption_ThirtyTwoBytesZ c);
27114
27115 /**
27116  * Frees any resources used by the C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ.
27117  */
27118 void C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_free(struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ _res);
27119
27120 /**
27121  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27122  */
27123 void CVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ_free(struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ _res);
27124
27125 /**
27126  * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the success state.
27127  */
27128 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_ok(enum LDKChannelMonitorUpdateStatus o);
27129
27130 /**
27131  * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the error state.
27132  */
27133 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_err(void);
27134
27135 /**
27136  * Checks if the given object is currently in the success state
27137  */
27138 bool CResult_ChannelMonitorUpdateStatusNoneZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR o);
27139
27140 /**
27141  * Frees any resources used by the CResult_ChannelMonitorUpdateStatusNoneZ.
27142  */
27143 void CResult_ChannelMonitorUpdateStatusNoneZ_free(struct LDKCResult_ChannelMonitorUpdateStatusNoneZ _res);
27144
27145 /**
27146  * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ which has the same data as `orig`
27147  * but with all dynamically-allocated buffers duplicated in new buffers.
27148  */
27149 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_clone(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR orig);
27150
27151 /**
27152  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27153  */
27154 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
27155
27156 /**
27157  * Creates a new tuple which has the same data as `orig`
27158  * but with all dynamically-allocated buffers duplicated in new buffers.
27159  */
27160 struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
27161
27162 /**
27163  * Creates a new C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ from the contained elements.
27164  */
27165 struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKChannelId b, struct LDKCVec_MonitorEventZ c, struct LDKPublicKey d);
27166
27167 /**
27168  * Frees any resources used by the C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ.
27169  */
27170 void C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free(struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ _res);
27171
27172 /**
27173  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27174  */
27175 void CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ _res);
27176
27177 /**
27178  * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
27179  */
27180 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
27181
27182 /**
27183  * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
27184  */
27185 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
27186
27187 /**
27188  * Checks if the given object is currently in the success state
27189  */
27190 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
27191
27192 /**
27193  * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
27194  */
27195 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
27196
27197 /**
27198  * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
27199  * but with all dynamically-allocated buffers duplicated in new buffers.
27200  */
27201 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
27202
27203 /**
27204  * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
27205  */
27206 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
27207
27208 /**
27209  * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
27210  */
27211 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
27212
27213 /**
27214  * Checks if the given object is currently in the success state
27215  */
27216 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
27217
27218 /**
27219  * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
27220  */
27221 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
27222
27223 /**
27224  * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
27225  * but with all dynamically-allocated buffers duplicated in new buffers.
27226  */
27227 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
27228
27229 /**
27230  * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
27231  */
27232 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
27233
27234 /**
27235  * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
27236  */
27237 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
27238
27239 /**
27240  * Checks if the given object is currently in the success state
27241  */
27242 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
27243
27244 /**
27245  * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
27246  */
27247 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
27248
27249 /**
27250  * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
27251  * but with all dynamically-allocated buffers duplicated in new buffers.
27252  */
27253 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
27254
27255 /**
27256  * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the success state.
27257  */
27258 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt11InvoiceFeatures o);
27259
27260 /**
27261  * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the error state.
27262  */
27263 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
27264
27265 /**
27266  * Checks if the given object is currently in the success state
27267  */
27268 bool CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
27269
27270 /**
27271  * Frees any resources used by the CResult_Bolt11InvoiceFeaturesDecodeErrorZ.
27272  */
27273 void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ _res);
27274
27275 /**
27276  * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
27277  * but with all dynamically-allocated buffers duplicated in new buffers.
27278  */
27279 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
27280
27281 /**
27282  * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the success state.
27283  */
27284 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt12InvoiceFeatures o);
27285
27286 /**
27287  * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the error state.
27288  */
27289 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
27290
27291 /**
27292  * Checks if the given object is currently in the success state
27293  */
27294 bool CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
27295
27296 /**
27297  * Frees any resources used by the CResult_Bolt12InvoiceFeaturesDecodeErrorZ.
27298  */
27299 void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ _res);
27300
27301 /**
27302  * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
27303  * but with all dynamically-allocated buffers duplicated in new buffers.
27304  */
27305 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
27306
27307 /**
27308  * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the success state.
27309  */
27310 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o);
27311
27312 /**
27313  * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the error state.
27314  */
27315 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
27316
27317 /**
27318  * Checks if the given object is currently in the success state
27319  */
27320 bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o);
27321
27322 /**
27323  * Frees any resources used by the CResult_BlindedHopFeaturesDecodeErrorZ.
27324  */
27325 void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res);
27326
27327 /**
27328  * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ which has the same data as `orig`
27329  * but with all dynamically-allocated buffers duplicated in new buffers.
27330  */
27331 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig);
27332
27333 /**
27334  * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
27335  */
27336 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
27337
27338 /**
27339  * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
27340  */
27341 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
27342
27343 /**
27344  * Checks if the given object is currently in the success state
27345  */
27346 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
27347
27348 /**
27349  * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
27350  */
27351 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
27352
27353 /**
27354  * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
27355  * but with all dynamically-allocated buffers duplicated in new buffers.
27356  */
27357 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
27358
27359 /**
27360  * Creates a new CResult_OfferIdDecodeErrorZ in the success state.
27361  */
27362 struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_ok(struct LDKOfferId o);
27363
27364 /**
27365  * Creates a new CResult_OfferIdDecodeErrorZ in the error state.
27366  */
27367 struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_err(struct LDKDecodeError e);
27368
27369 /**
27370  * Checks if the given object is currently in the success state
27371  */
27372 bool CResult_OfferIdDecodeErrorZ_is_ok(const struct LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR o);
27373
27374 /**
27375  * Frees any resources used by the CResult_OfferIdDecodeErrorZ.
27376  */
27377 void CResult_OfferIdDecodeErrorZ_free(struct LDKCResult_OfferIdDecodeErrorZ _res);
27378
27379 /**
27380  * Creates a new CResult_OfferIdDecodeErrorZ which has the same data as `orig`
27381  * but with all dynamically-allocated buffers duplicated in new buffers.
27382  */
27383 struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_clone(const struct LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR orig);
27384
27385 /**
27386  * Creates a new CResult_NoneBolt12SemanticErrorZ in the success state.
27387  */
27388 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_ok(void);
27389
27390 /**
27391  * Creates a new CResult_NoneBolt12SemanticErrorZ in the error state.
27392  */
27393 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
27394
27395 /**
27396  * Checks if the given object is currently in the success state
27397  */
27398 bool CResult_NoneBolt12SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR o);
27399
27400 /**
27401  * Frees any resources used by the CResult_NoneBolt12SemanticErrorZ.
27402  */
27403 void CResult_NoneBolt12SemanticErrorZ_free(struct LDKCResult_NoneBolt12SemanticErrorZ _res);
27404
27405 /**
27406  * Creates a new CResult_NoneBolt12SemanticErrorZ which has the same data as `orig`
27407  * but with all dynamically-allocated buffers duplicated in new buffers.
27408  */
27409 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_clone(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR orig);
27410
27411 /**
27412  * Creates a new CResult_OfferBolt12SemanticErrorZ in the success state.
27413  */
27414 struct LDKCResult_OfferBolt12SemanticErrorZ CResult_OfferBolt12SemanticErrorZ_ok(struct LDKOffer o);
27415
27416 /**
27417  * Creates a new CResult_OfferBolt12SemanticErrorZ in the error state.
27418  */
27419 struct LDKCResult_OfferBolt12SemanticErrorZ CResult_OfferBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
27420
27421 /**
27422  * Checks if the given object is currently in the success state
27423  */
27424 bool CResult_OfferBolt12SemanticErrorZ_is_ok(const struct LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR o);
27425
27426 /**
27427  * Frees any resources used by the CResult_OfferBolt12SemanticErrorZ.
27428  */
27429 void CResult_OfferBolt12SemanticErrorZ_free(struct LDKCResult_OfferBolt12SemanticErrorZ _res);
27430
27431 /**
27432  * Creates a new CResult_OfferBolt12SemanticErrorZ which has the same data as `orig`
27433  * but with all dynamically-allocated buffers duplicated in new buffers.
27434  */
27435 struct LDKCResult_OfferBolt12SemanticErrorZ CResult_OfferBolt12SemanticErrorZ_clone(const struct LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR orig);
27436
27437 /**
27438  * Creates a new CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ in the success state.
27439  */
27440 struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceRequestWithDerivedPayerIdBuilder o);
27441
27442 /**
27443  * Creates a new CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ in the error state.
27444  */
27445 struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
27446
27447 /**
27448  * Checks if the given object is currently in the success state
27449  */
27450 bool CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
27451
27452 /**
27453  * Frees any resources used by the CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.
27454  */
27455 void CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ _res);
27456
27457 /**
27458  * Creates a new CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ in the success state.
27459  */
27460 struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceRequestWithExplicitPayerIdBuilder o);
27461
27462 /**
27463  * Creates a new CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ in the error state.
27464  */
27465 struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
27466
27467 /**
27468  * Checks if the given object is currently in the success state
27469  */
27470 bool CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
27471
27472 /**
27473  * Frees any resources used by the CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.
27474  */
27475 void CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ _res);
27476
27477 /**
27478  * Creates a new CResult_OfferBolt12ParseErrorZ in the success state.
27479  */
27480 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_ok(struct LDKOffer o);
27481
27482 /**
27483  * Creates a new CResult_OfferBolt12ParseErrorZ in the error state.
27484  */
27485 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
27486
27487 /**
27488  * Checks if the given object is currently in the success state
27489  */
27490 bool CResult_OfferBolt12ParseErrorZ_is_ok(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR o);
27491
27492 /**
27493  * Frees any resources used by the CResult_OfferBolt12ParseErrorZ.
27494  */
27495 void CResult_OfferBolt12ParseErrorZ_free(struct LDKCResult_OfferBolt12ParseErrorZ _res);
27496
27497 /**
27498  * Creates a new CResult_OfferBolt12ParseErrorZ which has the same data as `orig`
27499  * but with all dynamically-allocated buffers duplicated in new buffers.
27500  */
27501 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_clone(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR orig);
27502
27503 /**
27504  * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
27505  */
27506 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
27507
27508 /**
27509  * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
27510  */
27511 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
27512
27513 /**
27514  * Checks if the given object is currently in the success state
27515  */
27516 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
27517
27518 /**
27519  * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
27520  */
27521 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
27522
27523 /**
27524  * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
27525  * but with all dynamically-allocated buffers duplicated in new buffers.
27526  */
27527 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
27528
27529 /**
27530  * Creates a new CResult_PublicKeySecp256k1ErrorZ in the success state.
27531  */
27532 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_ok(struct LDKPublicKey o);
27533
27534 /**
27535  * Creates a new CResult_PublicKeySecp256k1ErrorZ in the error state.
27536  */
27537 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
27538
27539 /**
27540  * Checks if the given object is currently in the success state
27541  */
27542 bool CResult_PublicKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR o);
27543
27544 /**
27545  * Frees any resources used by the CResult_PublicKeySecp256k1ErrorZ.
27546  */
27547 void CResult_PublicKeySecp256k1ErrorZ_free(struct LDKCResult_PublicKeySecp256k1ErrorZ _res);
27548
27549 /**
27550  * Creates a new CResult_PublicKeySecp256k1ErrorZ which has the same data as `orig`
27551  * but with all dynamically-allocated buffers duplicated in new buffers.
27552  */
27553 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_clone(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR orig);
27554
27555 /**
27556  * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
27557  */
27558 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
27559
27560 /**
27561  * Constructs a new COption_NetworkUpdateZ containing nothing
27562  */
27563 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
27564
27565 /**
27566  * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
27567  */
27568 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
27569
27570 /**
27571  * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
27572  * but with all dynamically-allocated buffers duplicated in new buffers.
27573  */
27574 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
27575
27576 /**
27577  * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
27578  */
27579 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
27580
27581 /**
27582  * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
27583  */
27584 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
27585
27586 /**
27587  * Checks if the given object is currently in the success state
27588  */
27589 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
27590
27591 /**
27592  * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
27593  */
27594 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
27595
27596 /**
27597  * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
27598  * but with all dynamically-allocated buffers duplicated in new buffers.
27599  */
27600 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
27601
27602 /**
27603  * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
27604  */
27605 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_some(struct LDKUtxoLookup o);
27606
27607 /**
27608  * Constructs a new COption_UtxoLookupZ containing nothing
27609  */
27610 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_none(void);
27611
27612 /**
27613  * Frees any resources associated with the crate::lightning::routing::utxo::UtxoLookup, if we are in the Some state
27614  */
27615 void COption_UtxoLookupZ_free(struct LDKCOption_UtxoLookupZ _res);
27616
27617 /**
27618  * Creates a new CResult_NoneLightningErrorZ in the success state.
27619  */
27620 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
27621
27622 /**
27623  * Creates a new CResult_NoneLightningErrorZ in the error state.
27624  */
27625 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
27626
27627 /**
27628  * Checks if the given object is currently in the success state
27629  */
27630 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
27631
27632 /**
27633  * Frees any resources used by the CResult_NoneLightningErrorZ.
27634  */
27635 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
27636
27637 /**
27638  * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
27639  * but with all dynamically-allocated buffers duplicated in new buffers.
27640  */
27641 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
27642
27643 /**
27644  * Creates a new CResult_boolLightningErrorZ in the success state.
27645  */
27646 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
27647
27648 /**
27649  * Creates a new CResult_boolLightningErrorZ in the error state.
27650  */
27651 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
27652
27653 /**
27654  * Checks if the given object is currently in the success state
27655  */
27656 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
27657
27658 /**
27659  * Frees any resources used by the CResult_boolLightningErrorZ.
27660  */
27661 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
27662
27663 /**
27664  * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
27665  * but with all dynamically-allocated buffers duplicated in new buffers.
27666  */
27667 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
27668
27669 /**
27670  * Creates a new tuple which has the same data as `orig`
27671  * but with all dynamically-allocated buffers duplicated in new buffers.
27672  */
27673 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
27674
27675 /**
27676  * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
27677  */
27678 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
27679
27680 /**
27681  * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
27682  */
27683 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
27684
27685 /**
27686  * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
27687  */
27688 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
27689
27690 /**
27691  * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
27692  */
27693 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
27694
27695 /**
27696  * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
27697  */
27698 void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
27699
27700 /**
27701  * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
27702  * but with all dynamically-allocated buffers duplicated in new buffers.
27703  */
27704 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
27705
27706 /**
27707  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27708  */
27709 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
27710
27711 /**
27712  * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
27713  */
27714 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
27715
27716 /**
27717  * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
27718  */
27719 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
27720
27721 /**
27722  * Checks if the given object is currently in the success state
27723  */
27724 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
27725
27726 /**
27727  * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
27728  */
27729 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
27730
27731 /**
27732  * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
27733  * but with all dynamically-allocated buffers duplicated in new buffers.
27734  */
27735 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
27736
27737 /**
27738  * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
27739  */
27740 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
27741
27742 /**
27743  * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
27744  */
27745 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
27746
27747 /**
27748  * Checks if the given object is currently in the success state
27749  */
27750 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
27751
27752 /**
27753  * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
27754  */
27755 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
27756
27757 /**
27758  * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
27759  * but with all dynamically-allocated buffers duplicated in new buffers.
27760  */
27761 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
27762
27763 /**
27764  * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
27765  */
27766 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
27767
27768 /**
27769  * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
27770  */
27771 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
27772
27773 /**
27774  * Checks if the given object is currently in the success state
27775  */
27776 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
27777
27778 /**
27779  * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
27780  */
27781 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
27782
27783 /**
27784  * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
27785  * but with all dynamically-allocated buffers duplicated in new buffers.
27786  */
27787 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
27788
27789 /**
27790  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27791  */
27792 void CVec_SocketAddressZ_free(struct LDKCVec_SocketAddressZ _res);
27793
27794 /**
27795  * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
27796  */
27797 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
27798
27799 /**
27800  * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
27801  */
27802 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
27803
27804 /**
27805  * Checks if the given object is currently in the success state
27806  */
27807 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
27808
27809 /**
27810  * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
27811  */
27812 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
27813
27814 /**
27815  * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
27816  * but with all dynamically-allocated buffers duplicated in new buffers.
27817  */
27818 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
27819
27820 /**
27821  * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
27822  */
27823 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
27824
27825 /**
27826  * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
27827  */
27828 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
27829
27830 /**
27831  * Checks if the given object is currently in the success state
27832  */
27833 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
27834
27835 /**
27836  * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
27837  */
27838 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
27839
27840 /**
27841  * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
27842  * but with all dynamically-allocated buffers duplicated in new buffers.
27843  */
27844 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
27845
27846 /**
27847  * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
27848  */
27849 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
27850
27851 /**
27852  * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
27853  */
27854 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
27855
27856 /**
27857  * Checks if the given object is currently in the success state
27858  */
27859 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
27860
27861 /**
27862  * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
27863  */
27864 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
27865
27866 /**
27867  * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
27868  * but with all dynamically-allocated buffers duplicated in new buffers.
27869  */
27870 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
27871
27872 /**
27873  * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
27874  */
27875 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
27876
27877 /**
27878  * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
27879  */
27880 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
27881
27882 /**
27883  * Checks if the given object is currently in the success state
27884  */
27885 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
27886
27887 /**
27888  * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
27889  */
27890 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
27891
27892 /**
27893  * Constructs a new COption_CVec_SocketAddressZZ containing a crate::c_types::derived::CVec_SocketAddressZ
27894  */
27895 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_some(struct LDKCVec_SocketAddressZ o);
27896
27897 /**
27898  * Constructs a new COption_CVec_SocketAddressZZ containing nothing
27899  */
27900 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_none(void);
27901
27902 /**
27903  * Frees any resources associated with the crate::c_types::derived::CVec_SocketAddressZ, if we are in the Some state
27904  */
27905 void COption_CVec_SocketAddressZZ_free(struct LDKCOption_CVec_SocketAddressZZ _res);
27906
27907 /**
27908  * Creates a new COption_CVec_SocketAddressZZ which has the same data as `orig`
27909  * but with all dynamically-allocated buffers duplicated in new buffers.
27910  */
27911 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_clone(const struct LDKCOption_CVec_SocketAddressZZ *NONNULL_PTR orig);
27912
27913 /**
27914  * Creates a new CResult_u64ShortChannelIdErrorZ in the success state.
27915  */
27916 struct LDKCResult_u64ShortChannelIdErrorZ CResult_u64ShortChannelIdErrorZ_ok(uint64_t o);
27917
27918 /**
27919  * Creates a new CResult_u64ShortChannelIdErrorZ in the error state.
27920  */
27921 struct LDKCResult_u64ShortChannelIdErrorZ CResult_u64ShortChannelIdErrorZ_err(enum LDKShortChannelIdError e);
27922
27923 /**
27924  * Checks if the given object is currently in the success state
27925  */
27926 bool CResult_u64ShortChannelIdErrorZ_is_ok(const struct LDKCResult_u64ShortChannelIdErrorZ *NONNULL_PTR o);
27927
27928 /**
27929  * Frees any resources used by the CResult_u64ShortChannelIdErrorZ.
27930  */
27931 void CResult_u64ShortChannelIdErrorZ_free(struct LDKCResult_u64ShortChannelIdErrorZ _res);
27932
27933 /**
27934  * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the success state.
27935  */
27936 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_ok(struct LDKPendingHTLCInfo o);
27937
27938 /**
27939  * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the error state.
27940  */
27941 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_err(struct LDKInboundHTLCErr e);
27942
27943 /**
27944  * Checks if the given object is currently in the success state
27945  */
27946 bool CResult_PendingHTLCInfoInboundHTLCErrZ_is_ok(const struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR o);
27947
27948 /**
27949  * Frees any resources used by the CResult_PendingHTLCInfoInboundHTLCErrZ.
27950  */
27951 void CResult_PendingHTLCInfoInboundHTLCErrZ_free(struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ _res);
27952
27953 /**
27954  * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ which has the same data as `orig`
27955  * but with all dynamically-allocated buffers duplicated in new buffers.
27956  */
27957 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_clone(const struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR orig);
27958
27959 /**
27960  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27961  */
27962 void CVec_HTLCOutputInCommitmentZ_free(struct LDKCVec_HTLCOutputInCommitmentZ _res);
27963
27964 /**
27965  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27966  */
27967 void CVec_HTLCDescriptorZ_free(struct LDKCVec_HTLCDescriptorZ _res);
27968
27969 /**
27970  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27971  */
27972 void CVec_UtxoZ_free(struct LDKCVec_UtxoZ _res);
27973
27974 /**
27975  * Constructs a new COption_TxOutZ containing a crate::c_types::TxOut
27976  */
27977 struct LDKCOption_TxOutZ COption_TxOutZ_some(struct LDKTxOut o);
27978
27979 /**
27980  * Constructs a new COption_TxOutZ containing nothing
27981  */
27982 struct LDKCOption_TxOutZ COption_TxOutZ_none(void);
27983
27984 /**
27985  * Frees any resources associated with the crate::c_types::TxOut, if we are in the Some state
27986  */
27987 void COption_TxOutZ_free(struct LDKCOption_TxOutZ _res);
27988
27989 /**
27990  * Creates a new COption_TxOutZ which has the same data as `orig`
27991  * but with all dynamically-allocated buffers duplicated in new buffers.
27992  */
27993 struct LDKCOption_TxOutZ COption_TxOutZ_clone(const struct LDKCOption_TxOutZ *NONNULL_PTR orig);
27994
27995 /**
27996  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27997  */
27998 void CVec_InputZ_free(struct LDKCVec_InputZ _res);
27999
28000 /**
28001  * Creates a new CResult_CoinSelectionNoneZ in the success state.
28002  */
28003 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_ok(struct LDKCoinSelection o);
28004
28005 /**
28006  * Creates a new CResult_CoinSelectionNoneZ in the error state.
28007  */
28008 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_err(void);
28009
28010 /**
28011  * Checks if the given object is currently in the success state
28012  */
28013 bool CResult_CoinSelectionNoneZ_is_ok(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR o);
28014
28015 /**
28016  * Frees any resources used by the CResult_CoinSelectionNoneZ.
28017  */
28018 void CResult_CoinSelectionNoneZ_free(struct LDKCResult_CoinSelectionNoneZ _res);
28019
28020 /**
28021  * Creates a new CResult_CoinSelectionNoneZ which has the same data as `orig`
28022  * but with all dynamically-allocated buffers duplicated in new buffers.
28023  */
28024 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_clone(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR orig);
28025
28026 /**
28027  * Creates a new CResult_CVec_UtxoZNoneZ in the success state.
28028  */
28029 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_ok(struct LDKCVec_UtxoZ o);
28030
28031 /**
28032  * Creates a new CResult_CVec_UtxoZNoneZ in the error state.
28033  */
28034 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_err(void);
28035
28036 /**
28037  * Checks if the given object is currently in the success state
28038  */
28039 bool CResult_CVec_UtxoZNoneZ_is_ok(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR o);
28040
28041 /**
28042  * Frees any resources used by the CResult_CVec_UtxoZNoneZ.
28043  */
28044 void CResult_CVec_UtxoZNoneZ_free(struct LDKCResult_CVec_UtxoZNoneZ _res);
28045
28046 /**
28047  * Creates a new CResult_CVec_UtxoZNoneZ which has the same data as `orig`
28048  * but with all dynamically-allocated buffers duplicated in new buffers.
28049  */
28050 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_clone(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR orig);
28051
28052 /**
28053  * Constructs a new COption_PaymentContextZ containing a crate::lightning::blinded_path::payment::PaymentContext
28054  */
28055 struct LDKCOption_PaymentContextZ COption_PaymentContextZ_some(struct LDKPaymentContext o);
28056
28057 /**
28058  * Constructs a new COption_PaymentContextZ containing nothing
28059  */
28060 struct LDKCOption_PaymentContextZ COption_PaymentContextZ_none(void);
28061
28062 /**
28063  * Frees any resources associated with the crate::lightning::blinded_path::payment::PaymentContext, if we are in the Some state
28064  */
28065 void COption_PaymentContextZ_free(struct LDKCOption_PaymentContextZ _res);
28066
28067 /**
28068  * Creates a new COption_PaymentContextZ which has the same data as `orig`
28069  * but with all dynamically-allocated buffers duplicated in new buffers.
28070  */
28071 struct LDKCOption_PaymentContextZ COption_PaymentContextZ_clone(const struct LDKCOption_PaymentContextZ *NONNULL_PTR orig);
28072
28073 /**
28074  * Creates a new tuple which has the same data as `orig`
28075  * but with all dynamically-allocated buffers duplicated in new buffers.
28076  */
28077 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_clone(const struct LDKC2Tuple_u64u16Z *NONNULL_PTR orig);
28078
28079 /**
28080  * Creates a new C2Tuple_u64u16Z from the contained elements.
28081  */
28082 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_new(uint64_t a, uint16_t b);
28083
28084 /**
28085  * Frees any resources used by the C2Tuple_u64u16Z.
28086  */
28087 void C2Tuple_u64u16Z_free(struct LDKC2Tuple_u64u16Z _res);
28088
28089 /**
28090  * Constructs a new COption_C2Tuple_u64u16ZZ containing a crate::c_types::derived::C2Tuple_u64u16Z
28091  */
28092 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_some(struct LDKC2Tuple_u64u16Z o);
28093
28094 /**
28095  * Constructs a new COption_C2Tuple_u64u16ZZ containing nothing
28096  */
28097 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_none(void);
28098
28099 /**
28100  * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u16Z, if we are in the Some state
28101  */
28102 void COption_C2Tuple_u64u16ZZ_free(struct LDKCOption_C2Tuple_u64u16ZZ _res);
28103
28104 /**
28105  * Creates a new COption_C2Tuple_u64u16ZZ which has the same data as `orig`
28106  * but with all dynamically-allocated buffers duplicated in new buffers.
28107  */
28108 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_clone(const struct LDKCOption_C2Tuple_u64u16ZZ *NONNULL_PTR orig);
28109
28110 /**
28111  * Creates a new CResult_ChannelIdAPIErrorZ in the success state.
28112  */
28113 struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_ok(struct LDKChannelId o);
28114
28115 /**
28116  * Creates a new CResult_ChannelIdAPIErrorZ in the error state.
28117  */
28118 struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_err(struct LDKAPIError e);
28119
28120 /**
28121  * Checks if the given object is currently in the success state
28122  */
28123 bool CResult_ChannelIdAPIErrorZ_is_ok(const struct LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR o);
28124
28125 /**
28126  * Frees any resources used by the CResult_ChannelIdAPIErrorZ.
28127  */
28128 void CResult_ChannelIdAPIErrorZ_free(struct LDKCResult_ChannelIdAPIErrorZ _res);
28129
28130 /**
28131  * Creates a new CResult_ChannelIdAPIErrorZ which has the same data as `orig`
28132  * but with all dynamically-allocated buffers duplicated in new buffers.
28133  */
28134 struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_clone(const struct LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR orig);
28135
28136 /**
28137  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28138  */
28139 void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res);
28140
28141 /**
28142  * Creates a new CResult_NonePaymentSendFailureZ in the success state.
28143  */
28144 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
28145
28146 /**
28147  * Creates a new CResult_NonePaymentSendFailureZ in the error state.
28148  */
28149 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
28150
28151 /**
28152  * Checks if the given object is currently in the success state
28153  */
28154 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
28155
28156 /**
28157  * Frees any resources used by the CResult_NonePaymentSendFailureZ.
28158  */
28159 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
28160
28161 /**
28162  * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
28163  * but with all dynamically-allocated buffers duplicated in new buffers.
28164  */
28165 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
28166
28167 /**
28168  * Creates a new CResult_NoneRetryableSendFailureZ in the success state.
28169  */
28170 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_ok(void);
28171
28172 /**
28173  * Creates a new CResult_NoneRetryableSendFailureZ in the error state.
28174  */
28175 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
28176
28177 /**
28178  * Checks if the given object is currently in the success state
28179  */
28180 bool CResult_NoneRetryableSendFailureZ_is_ok(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR o);
28181
28182 /**
28183  * Frees any resources used by the CResult_NoneRetryableSendFailureZ.
28184  */
28185 void CResult_NoneRetryableSendFailureZ_free(struct LDKCResult_NoneRetryableSendFailureZ _res);
28186
28187 /**
28188  * Creates a new CResult_NoneRetryableSendFailureZ which has the same data as `orig`
28189  * but with all dynamically-allocated buffers duplicated in new buffers.
28190  */
28191 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_clone(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR orig);
28192
28193 /**
28194  * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the success state.
28195  */
28196 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
28197
28198 /**
28199  * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the error state.
28200  */
28201 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
28202
28203 /**
28204  * Checks if the given object is currently in the success state
28205  */
28206 bool CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR o);
28207
28208 /**
28209  * Frees any resources used by the CResult_ThirtyTwoBytesPaymentSendFailureZ.
28210  */
28211 void CResult_ThirtyTwoBytesPaymentSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ _res);
28212
28213 /**
28214  * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ which has the same data as `orig`
28215  * but with all dynamically-allocated buffers duplicated in new buffers.
28216  */
28217 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR orig);
28218
28219 /**
28220  * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the success state.
28221  */
28222 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_ok(struct LDKThirtyTwoBytes o);
28223
28224 /**
28225  * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the error state.
28226  */
28227 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
28228
28229 /**
28230  * Checks if the given object is currently in the success state
28231  */
28232 bool CResult_ThirtyTwoBytesRetryableSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR o);
28233
28234 /**
28235  * Frees any resources used by the CResult_ThirtyTwoBytesRetryableSendFailureZ.
28236  */
28237 void CResult_ThirtyTwoBytesRetryableSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ _res);
28238
28239 /**
28240  * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ which has the same data as `orig`
28241  * but with all dynamically-allocated buffers duplicated in new buffers.
28242  */
28243 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR orig);
28244
28245 /**
28246  * Creates a new tuple which has the same data as `orig`
28247  * but with all dynamically-allocated buffers duplicated in new buffers.
28248  */
28249 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *NONNULL_PTR orig);
28250
28251 /**
28252  * Creates a new C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ from the contained elements.
28253  */
28254 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
28255
28256 /**
28257  * Frees any resources used by the C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ.
28258  */
28259 void C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_free(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ _res);
28260
28261 /**
28262  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the success state.
28263  */
28264 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
28265
28266 /**
28267  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the error state.
28268  */
28269 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
28270
28271 /**
28272  * Checks if the given object is currently in the success state
28273  */
28274 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR o);
28275
28276 /**
28277  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.
28278  */
28279 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ _res);
28280
28281 /**
28282  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ which has the same data as `orig`
28283  * but with all dynamically-allocated buffers duplicated in new buffers.
28284  */
28285 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR orig);
28286
28287 /**
28288  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28289  */
28290 void CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ _res);
28291
28292 /**
28293  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the success state.
28294  */
28295 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o);
28296
28297 /**
28298  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the error state.
28299  */
28300 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_err(struct LDKProbeSendFailure e);
28301
28302 /**
28303  * Checks if the given object is currently in the success state
28304  */
28305 bool CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR o);
28306
28307 /**
28308  * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.
28309  */
28310 void CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ _res);
28311
28312 /**
28313  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ which has the same data as `orig`
28314  * but with all dynamically-allocated buffers duplicated in new buffers.
28315  */
28316 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR orig);
28317
28318 /**
28319  * Creates a new tuple which has the same data as `orig`
28320  * but with all dynamically-allocated buffers duplicated in new buffers.
28321  */
28322 struct LDKC2Tuple_ChannelIdPublicKeyZ C2Tuple_ChannelIdPublicKeyZ_clone(const struct LDKC2Tuple_ChannelIdPublicKeyZ *NONNULL_PTR orig);
28323
28324 /**
28325  * Creates a new C2Tuple_ChannelIdPublicKeyZ from the contained elements.
28326  */
28327 struct LDKC2Tuple_ChannelIdPublicKeyZ C2Tuple_ChannelIdPublicKeyZ_new(struct LDKChannelId a, struct LDKPublicKey b);
28328
28329 /**
28330  * Frees any resources used by the C2Tuple_ChannelIdPublicKeyZ.
28331  */
28332 void C2Tuple_ChannelIdPublicKeyZ_free(struct LDKC2Tuple_ChannelIdPublicKeyZ _res);
28333
28334 /**
28335  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28336  */
28337 void CVec_C2Tuple_ChannelIdPublicKeyZZ_free(struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ _res);
28338
28339 /**
28340  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28341  */
28342 void CVec_ChannelIdZ_free(struct LDKCVec_ChannelIdZ _res);
28343
28344 /**
28345  * Creates a new CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ in the success state.
28346  */
28347 struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(struct LDKOfferWithDerivedMetadataBuilder o);
28348
28349 /**
28350  * Creates a new CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ in the error state.
28351  */
28352 struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
28353
28354 /**
28355  * Checks if the given object is currently in the success state
28356  */
28357 bool CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
28358
28359 /**
28360  * Frees any resources used by the CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.
28361  */
28362 void CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ _res);
28363
28364 /**
28365  * Creates a new CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ which has the same data as `orig`
28366  * but with all dynamically-allocated buffers duplicated in new buffers.
28367  */
28368 struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(const struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR orig);
28369
28370 /**
28371  * Constructs a new COption_StrZ containing a crate::c_types::Str
28372  */
28373 struct LDKCOption_StrZ COption_StrZ_some(struct LDKStr o);
28374
28375 /**
28376  * Constructs a new COption_StrZ containing nothing
28377  */
28378 struct LDKCOption_StrZ COption_StrZ_none(void);
28379
28380 /**
28381  * Frees any resources associated with the crate::c_types::Str, if we are in the Some state
28382  */
28383 void COption_StrZ_free(struct LDKCOption_StrZ _res);
28384
28385 /**
28386  * Creates a new COption_StrZ which has the same data as `orig`
28387  * but with all dynamically-allocated buffers duplicated in new buffers.
28388  */
28389 struct LDKCOption_StrZ COption_StrZ_clone(const struct LDKCOption_StrZ *NONNULL_PTR orig);
28390
28391 /**
28392  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the success state.
28393  */
28394 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
28395
28396 /**
28397  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the error state.
28398  */
28399 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_err(void);
28400
28401 /**
28402  * Checks if the given object is currently in the success state
28403  */
28404 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR o);
28405
28406 /**
28407  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.
28408  */
28409 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ _res);
28410
28411 /**
28412  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ which has the same data as `orig`
28413  * but with all dynamically-allocated buffers duplicated in new buffers.
28414  */
28415 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR orig);
28416
28417 /**
28418  * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the success state.
28419  */
28420 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
28421
28422 /**
28423  * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the error state.
28424  */
28425 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_err(struct LDKAPIError e);
28426
28427 /**
28428  * Checks if the given object is currently in the success state
28429  */
28430 bool CResult_ThirtyTwoBytesAPIErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR o);
28431
28432 /**
28433  * Frees any resources used by the CResult_ThirtyTwoBytesAPIErrorZ.
28434  */
28435 void CResult_ThirtyTwoBytesAPIErrorZ_free(struct LDKCResult_ThirtyTwoBytesAPIErrorZ _res);
28436
28437 /**
28438  * Creates a new CResult_ThirtyTwoBytesAPIErrorZ which has the same data as `orig`
28439  * but with all dynamically-allocated buffers duplicated in new buffers.
28440  */
28441 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR orig);
28442
28443 /**
28444  * Constructs a new COption_OffersMessageZ containing a crate::lightning::onion_message::offers::OffersMessage
28445  */
28446 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_some(struct LDKOffersMessage o);
28447
28448 /**
28449  * Constructs a new COption_OffersMessageZ containing nothing
28450  */
28451 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_none(void);
28452
28453 /**
28454  * Frees any resources associated with the crate::lightning::onion_message::offers::OffersMessage, if we are in the Some state
28455  */
28456 void COption_OffersMessageZ_free(struct LDKCOption_OffersMessageZ _res);
28457
28458 /**
28459  * Creates a new COption_OffersMessageZ which has the same data as `orig`
28460  * but with all dynamically-allocated buffers duplicated in new buffers.
28461  */
28462 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_clone(const struct LDKCOption_OffersMessageZ *NONNULL_PTR orig);
28463
28464 /**
28465  * Creates a new tuple which has the same data as `orig`
28466  * but with all dynamically-allocated buffers duplicated in new buffers.
28467  */
28468 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR orig);
28469
28470 /**
28471  * Creates a new C3Tuple_OffersMessageDestinationBlindedPathZ from the contained elements.
28472  */
28473 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_new(struct LDKOffersMessage a, struct LDKDestination b, struct LDKBlindedPath c);
28474
28475 /**
28476  * Frees any resources used by the C3Tuple_OffersMessageDestinationBlindedPathZ.
28477  */
28478 void C3Tuple_OffersMessageDestinationBlindedPathZ_free(struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res);
28479
28480 /**
28481  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28482  */
28483 void CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ _res);
28484
28485 /**
28486  * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
28487  */
28488 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
28489
28490 /**
28491  * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
28492  */
28493 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
28494
28495 /**
28496  * Checks if the given object is currently in the success state
28497  */
28498 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
28499
28500 /**
28501  * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
28502  */
28503 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
28504
28505 /**
28506  * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
28507  * but with all dynamically-allocated buffers duplicated in new buffers.
28508  */
28509 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
28510
28511 /**
28512  * Creates a new CResult_BlindedForwardDecodeErrorZ in the success state.
28513  */
28514 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_ok(struct LDKBlindedForward o);
28515
28516 /**
28517  * Creates a new CResult_BlindedForwardDecodeErrorZ in the error state.
28518  */
28519 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_err(struct LDKDecodeError e);
28520
28521 /**
28522  * Checks if the given object is currently in the success state
28523  */
28524 bool CResult_BlindedForwardDecodeErrorZ_is_ok(const struct LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR o);
28525
28526 /**
28527  * Frees any resources used by the CResult_BlindedForwardDecodeErrorZ.
28528  */
28529 void CResult_BlindedForwardDecodeErrorZ_free(struct LDKCResult_BlindedForwardDecodeErrorZ _res);
28530
28531 /**
28532  * Creates a new CResult_BlindedForwardDecodeErrorZ which has the same data as `orig`
28533  * but with all dynamically-allocated buffers duplicated in new buffers.
28534  */
28535 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_clone(const struct LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR orig);
28536
28537 /**
28538  * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ in the success state.
28539  */
28540 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_ok(struct LDKPendingHTLCRouting o);
28541
28542 /**
28543  * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ in the error state.
28544  */
28545 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_err(struct LDKDecodeError e);
28546
28547 /**
28548  * Checks if the given object is currently in the success state
28549  */
28550 bool CResult_PendingHTLCRoutingDecodeErrorZ_is_ok(const struct LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR o);
28551
28552 /**
28553  * Frees any resources used by the CResult_PendingHTLCRoutingDecodeErrorZ.
28554  */
28555 void CResult_PendingHTLCRoutingDecodeErrorZ_free(struct LDKCResult_PendingHTLCRoutingDecodeErrorZ _res);
28556
28557 /**
28558  * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ which has the same data as `orig`
28559  * but with all dynamically-allocated buffers duplicated in new buffers.
28560  */
28561 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_clone(const struct LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR orig);
28562
28563 /**
28564  * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the success state.
28565  */
28566 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_ok(struct LDKPendingHTLCInfo o);
28567
28568 /**
28569  * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the error state.
28570  */
28571 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_err(struct LDKDecodeError e);
28572
28573 /**
28574  * Checks if the given object is currently in the success state
28575  */
28576 bool CResult_PendingHTLCInfoDecodeErrorZ_is_ok(const struct LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR o);
28577
28578 /**
28579  * Frees any resources used by the CResult_PendingHTLCInfoDecodeErrorZ.
28580  */
28581 void CResult_PendingHTLCInfoDecodeErrorZ_free(struct LDKCResult_PendingHTLCInfoDecodeErrorZ _res);
28582
28583 /**
28584  * Creates a new CResult_PendingHTLCInfoDecodeErrorZ which has the same data as `orig`
28585  * but with all dynamically-allocated buffers duplicated in new buffers.
28586  */
28587 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_clone(const struct LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR orig);
28588
28589 /**
28590  * Creates a new CResult_BlindedFailureDecodeErrorZ in the success state.
28591  */
28592 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_ok(enum LDKBlindedFailure o);
28593
28594 /**
28595  * Creates a new CResult_BlindedFailureDecodeErrorZ in the error state.
28596  */
28597 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_err(struct LDKDecodeError e);
28598
28599 /**
28600  * Checks if the given object is currently in the success state
28601  */
28602 bool CResult_BlindedFailureDecodeErrorZ_is_ok(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR o);
28603
28604 /**
28605  * Frees any resources used by the CResult_BlindedFailureDecodeErrorZ.
28606  */
28607 void CResult_BlindedFailureDecodeErrorZ_free(struct LDKCResult_BlindedFailureDecodeErrorZ _res);
28608
28609 /**
28610  * Creates a new CResult_BlindedFailureDecodeErrorZ which has the same data as `orig`
28611  * but with all dynamically-allocated buffers duplicated in new buffers.
28612  */
28613 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_clone(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR orig);
28614
28615 /**
28616  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28617  */
28618 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
28619
28620 /**
28621  * Creates a new C2Tuple_ThirtyTwoBytesChannelManagerZ from the contained elements.
28622  */
28623 struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ C2Tuple_ThirtyTwoBytesChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
28624
28625 /**
28626  * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelManagerZ.
28627  */
28628 void C2Tuple_ThirtyTwoBytesChannelManagerZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ _res);
28629
28630 /**
28631  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the success state.
28632  */
28633 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ o);
28634
28635 /**
28636  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the error state.
28637  */
28638 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
28639
28640 /**
28641  * Checks if the given object is currently in the success state
28642  */
28643 bool CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ *NONNULL_PTR o);
28644
28645 /**
28646  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.
28647  */
28648 void CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ _res);
28649
28650 /**
28651  * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the success state.
28652  */
28653 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_ok(struct LDKMaxDustHTLCExposure o);
28654
28655 /**
28656  * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the error state.
28657  */
28658 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_err(struct LDKDecodeError e);
28659
28660 /**
28661  * Checks if the given object is currently in the success state
28662  */
28663 bool CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR o);
28664
28665 /**
28666  * Frees any resources used by the CResult_MaxDustHTLCExposureDecodeErrorZ.
28667  */
28668 void CResult_MaxDustHTLCExposureDecodeErrorZ_free(struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ _res);
28669
28670 /**
28671  * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ which has the same data as `orig`
28672  * but with all dynamically-allocated buffers duplicated in new buffers.
28673  */
28674 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_clone(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR orig);
28675
28676 /**
28677  * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
28678  */
28679 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
28680
28681 /**
28682  * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
28683  */
28684 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
28685
28686 /**
28687  * Checks if the given object is currently in the success state
28688  */
28689 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
28690
28691 /**
28692  * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
28693  */
28694 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
28695
28696 /**
28697  * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
28698  * but with all dynamically-allocated buffers duplicated in new buffers.
28699  */
28700 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
28701
28702 /**
28703  * Constructs a new COption_MaxDustHTLCExposureZ containing a crate::lightning::util::config::MaxDustHTLCExposure
28704  */
28705 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_some(struct LDKMaxDustHTLCExposure o);
28706
28707 /**
28708  * Constructs a new COption_MaxDustHTLCExposureZ containing nothing
28709  */
28710 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_none(void);
28711
28712 /**
28713  * Frees any resources associated with the crate::lightning::util::config::MaxDustHTLCExposure, if we are in the Some state
28714  */
28715 void COption_MaxDustHTLCExposureZ_free(struct LDKCOption_MaxDustHTLCExposureZ _res);
28716
28717 /**
28718  * Creates a new COption_MaxDustHTLCExposureZ which has the same data as `orig`
28719  * but with all dynamically-allocated buffers duplicated in new buffers.
28720  */
28721 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_clone(const struct LDKCOption_MaxDustHTLCExposureZ *NONNULL_PTR orig);
28722
28723 /**
28724  * Constructs a new COption_APIErrorZ containing a crate::lightning::util::errors::APIError
28725  */
28726 struct LDKCOption_APIErrorZ COption_APIErrorZ_some(struct LDKAPIError o);
28727
28728 /**
28729  * Constructs a new COption_APIErrorZ containing nothing
28730  */
28731 struct LDKCOption_APIErrorZ COption_APIErrorZ_none(void);
28732
28733 /**
28734  * Frees any resources associated with the crate::lightning::util::errors::APIError, if we are in the Some state
28735  */
28736 void COption_APIErrorZ_free(struct LDKCOption_APIErrorZ _res);
28737
28738 /**
28739  * Creates a new COption_APIErrorZ which has the same data as `orig`
28740  * but with all dynamically-allocated buffers duplicated in new buffers.
28741  */
28742 struct LDKCOption_APIErrorZ COption_APIErrorZ_clone(const struct LDKCOption_APIErrorZ *NONNULL_PTR orig);
28743
28744 /**
28745  * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the success state.
28746  */
28747 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_ok(struct LDKCOption_APIErrorZ o);
28748
28749 /**
28750  * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the error state.
28751  */
28752 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_err(struct LDKDecodeError e);
28753
28754 /**
28755  * Checks if the given object is currently in the success state
28756  */
28757 bool CResult_COption_APIErrorZDecodeErrorZ_is_ok(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR o);
28758
28759 /**
28760  * Frees any resources used by the CResult_COption_APIErrorZDecodeErrorZ.
28761  */
28762 void CResult_COption_APIErrorZDecodeErrorZ_free(struct LDKCResult_COption_APIErrorZDecodeErrorZ _res);
28763
28764 /**
28765  * Creates a new CResult_COption_APIErrorZDecodeErrorZ which has the same data as `orig`
28766  * but with all dynamically-allocated buffers duplicated in new buffers.
28767  */
28768 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_clone(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR orig);
28769
28770 /**
28771  * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
28772  */
28773 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
28774
28775 /**
28776  * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
28777  */
28778 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
28779
28780 /**
28781  * Checks if the given object is currently in the success state
28782  */
28783 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
28784
28785 /**
28786  * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
28787  */
28788 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
28789
28790 /**
28791  * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
28792  * but with all dynamically-allocated buffers duplicated in new buffers.
28793  */
28794 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
28795
28796 /**
28797  * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
28798  */
28799 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
28800
28801 /**
28802  * Constructs a new COption_MonitorEventZ containing nothing
28803  */
28804 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
28805
28806 /**
28807  * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
28808  */
28809 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
28810
28811 /**
28812  * Creates a new COption_MonitorEventZ which has the same data as `orig`
28813  * but with all dynamically-allocated buffers duplicated in new buffers.
28814  */
28815 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
28816
28817 /**
28818  * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
28819  */
28820 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
28821
28822 /**
28823  * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
28824  */
28825 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
28826
28827 /**
28828  * Checks if the given object is currently in the success state
28829  */
28830 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
28831
28832 /**
28833  * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
28834  */
28835 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
28836
28837 /**
28838  * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
28839  * but with all dynamically-allocated buffers duplicated in new buffers.
28840  */
28841 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
28842
28843 /**
28844  * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
28845  */
28846 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
28847
28848 /**
28849  * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
28850  */
28851 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
28852
28853 /**
28854  * Checks if the given object is currently in the success state
28855  */
28856 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
28857
28858 /**
28859  * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
28860  */
28861 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
28862
28863 /**
28864  * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
28865  * but with all dynamically-allocated buffers duplicated in new buffers.
28866  */
28867 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
28868
28869 /**
28870  * Creates a new tuple which has the same data as `orig`
28871  * but with all dynamically-allocated buffers duplicated in new buffers.
28872  */
28873 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_clone(const struct LDKC2Tuple_OutPointCVec_u8ZZ *NONNULL_PTR orig);
28874
28875 /**
28876  * Creates a new C2Tuple_OutPointCVec_u8ZZ from the contained elements.
28877  */
28878 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
28879
28880 /**
28881  * Frees any resources used by the C2Tuple_OutPointCVec_u8ZZ.
28882  */
28883 void C2Tuple_OutPointCVec_u8ZZ_free(struct LDKC2Tuple_OutPointCVec_u8ZZ _res);
28884
28885 /**
28886  * Creates a new tuple which has the same data as `orig`
28887  * but with all dynamically-allocated buffers duplicated in new buffers.
28888  */
28889 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_clone(const struct LDKC2Tuple_u32CVec_u8ZZ *NONNULL_PTR orig);
28890
28891 /**
28892  * Creates a new C2Tuple_u32CVec_u8ZZ from the contained elements.
28893  */
28894 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_new(uint32_t a, struct LDKCVec_u8Z b);
28895
28896 /**
28897  * Frees any resources used by the C2Tuple_u32CVec_u8ZZ.
28898  */
28899 void C2Tuple_u32CVec_u8ZZ_free(struct LDKC2Tuple_u32CVec_u8ZZ _res);
28900
28901 /**
28902  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28903  */
28904 void CVec_C2Tuple_u32CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u32CVec_u8ZZZ _res);
28905
28906 /**
28907  * Creates a new tuple which has the same data as `orig`
28908  * but with all dynamically-allocated buffers duplicated in new buffers.
28909  */
28910 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *NONNULL_PTR orig);
28911
28912 /**
28913  * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ from the contained elements.
28914  */
28915 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b);
28916
28917 /**
28918  * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.
28919  */
28920 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ _res);
28921
28922 /**
28923  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28924  */
28925 void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ _res);
28926
28927 /**
28928  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28929  */
28930 void CVec_CommitmentTransactionZ_free(struct LDKCVec_CommitmentTransactionZ _res);
28931
28932 /**
28933  * Creates a new tuple which has the same data as `orig`
28934  * but with all dynamically-allocated buffers duplicated in new buffers.
28935  */
28936 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
28937
28938 /**
28939  * Creates a new C2Tuple_u32TxOutZ from the contained elements.
28940  */
28941 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
28942
28943 /**
28944  * Frees any resources used by the C2Tuple_u32TxOutZ.
28945  */
28946 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
28947
28948 /**
28949  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28950  */
28951 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
28952
28953 /**
28954  * Creates a new tuple which has the same data as `orig`
28955  * but with all dynamically-allocated buffers duplicated in new buffers.
28956  */
28957 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
28958
28959 /**
28960  * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ from the contained elements.
28961  */
28962 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
28963
28964 /**
28965  * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.
28966  */
28967 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ _res);
28968
28969 /**
28970  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28971  */
28972 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
28973
28974 /**
28975  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28976  */
28977 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
28978
28979 /**
28980  * Creates a new tuple which has the same data as `orig`
28981  * but with all dynamically-allocated buffers duplicated in new buffers.
28982  */
28983 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *NONNULL_PTR orig);
28984
28985 /**
28986  * Creates a new C2Tuple_ThirtyTwoBytesChannelMonitorZ from the contained elements.
28987  */
28988 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
28989
28990 /**
28991  * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelMonitorZ.
28992  */
28993 void C2Tuple_ThirtyTwoBytesChannelMonitorZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ _res);
28994
28995 /**
28996  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the success state.
28997  */
28998 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
28999
29000 /**
29001  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the error state.
29002  */
29003 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
29004
29005 /**
29006  * Checks if the given object is currently in the success state
29007  */
29008 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
29009
29010 /**
29011  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.
29012  */
29013 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ _res);
29014
29015 /**
29016  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ which has the same data as `orig`
29017  * but with all dynamically-allocated buffers duplicated in new buffers.
29018  */
29019 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR orig);
29020
29021 /**
29022  * Creates a new tuple which has the same data as `orig`
29023  * but with all dynamically-allocated buffers duplicated in new buffers.
29024  */
29025 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig);
29026
29027 /**
29028  * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
29029  */
29030 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
29031
29032 /**
29033  * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
29034  */
29035 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
29036
29037 /**
29038  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29039  */
29040 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
29041
29042 /**
29043  * Creates a new tuple which has the same data as `orig`
29044  * but with all dynamically-allocated buffers duplicated in new buffers.
29045  */
29046 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR orig);
29047
29048 /**
29049  * Creates a new C2Tuple_PublicKeyCVec_SocketAddressZZ from the contained elements.
29050  */
29051 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_new(struct LDKPublicKey a, struct LDKCVec_SocketAddressZ b);
29052
29053 /**
29054  * Frees any resources used by the C2Tuple_PublicKeyCVec_SocketAddressZZ.
29055  */
29056 void C2Tuple_PublicKeyCVec_SocketAddressZZ_free(struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res);
29057
29058 /**
29059  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29060  */
29061 void CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ _res);
29062
29063 /**
29064  * Constructs a new COption_OnionMessageContentsZ containing a crate::lightning::onion_message::packet::OnionMessageContents
29065  */
29066 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_some(struct LDKOnionMessageContents o);
29067
29068 /**
29069  * Constructs a new COption_OnionMessageContentsZ containing nothing
29070  */
29071 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_none(void);
29072
29073 /**
29074  * Frees any resources associated with the crate::lightning::onion_message::packet::OnionMessageContents, if we are in the Some state
29075  */
29076 void COption_OnionMessageContentsZ_free(struct LDKCOption_OnionMessageContentsZ _res);
29077
29078 /**
29079  * Creates a new COption_OnionMessageContentsZ which has the same data as `orig`
29080  * but with all dynamically-allocated buffers duplicated in new buffers.
29081  */
29082 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_clone(const struct LDKCOption_OnionMessageContentsZ *NONNULL_PTR orig);
29083
29084 /**
29085  * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the success state.
29086  */
29087 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_OnionMessageContentsZ o);
29088
29089 /**
29090  * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the error state.
29091  */
29092 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
29093
29094 /**
29095  * Checks if the given object is currently in the success state
29096  */
29097 bool CResult_COption_OnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
29098
29099 /**
29100  * Frees any resources used by the CResult_COption_OnionMessageContentsZDecodeErrorZ.
29101  */
29102 void CResult_COption_OnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ _res);
29103
29104 /**
29105  * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ which has the same data as `orig`
29106  * but with all dynamically-allocated buffers duplicated in new buffers.
29107  */
29108 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_clone(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR orig);
29109
29110 /**
29111  * Creates a new tuple which has the same data as `orig`
29112  * but with all dynamically-allocated buffers duplicated in new buffers.
29113  */
29114 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR orig);
29115
29116 /**
29117  * Creates a new C3Tuple_OnionMessageContentsDestinationBlindedPathZ from the contained elements.
29118  */
29119 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(struct LDKOnionMessageContents a, struct LDKDestination b, struct LDKBlindedPath c);
29120
29121 /**
29122  * Frees any resources used by the C3Tuple_OnionMessageContentsDestinationBlindedPathZ.
29123  */
29124 void C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res);
29125
29126 /**
29127  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29128  */
29129 void CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ _res);
29130
29131 /**
29132  * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
29133  */
29134 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
29135
29136 /**
29137  * Constructs a new COption_TypeZ containing nothing
29138  */
29139 struct LDKCOption_TypeZ COption_TypeZ_none(void);
29140
29141 /**
29142  * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
29143  */
29144 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
29145
29146 /**
29147  * Creates a new COption_TypeZ which has the same data as `orig`
29148  * but with all dynamically-allocated buffers duplicated in new buffers.
29149  */
29150 struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig);
29151
29152 /**
29153  * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
29154  */
29155 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
29156
29157 /**
29158  * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
29159  */
29160 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
29161
29162 /**
29163  * Checks if the given object is currently in the success state
29164  */
29165 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
29166
29167 /**
29168  * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
29169  */
29170 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
29171
29172 /**
29173  * Creates a new CResult_COption_TypeZDecodeErrorZ which has the same data as `orig`
29174  * but with all dynamically-allocated buffers duplicated in new buffers.
29175  */
29176 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig);
29177
29178 /**
29179  * Constructs a new COption_SocketAddressZ containing a crate::lightning::ln::msgs::SocketAddress
29180  */
29181 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_some(struct LDKSocketAddress o);
29182
29183 /**
29184  * Constructs a new COption_SocketAddressZ containing nothing
29185  */
29186 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_none(void);
29187
29188 /**
29189  * Frees any resources associated with the crate::lightning::ln::msgs::SocketAddress, if we are in the Some state
29190  */
29191 void COption_SocketAddressZ_free(struct LDKCOption_SocketAddressZ _res);
29192
29193 /**
29194  * Creates a new COption_SocketAddressZ which has the same data as `orig`
29195  * but with all dynamically-allocated buffers duplicated in new buffers.
29196  */
29197 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_clone(const struct LDKCOption_SocketAddressZ *NONNULL_PTR orig);
29198
29199 /**
29200  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29201  */
29202 void CVec_PeerDetailsZ_free(struct LDKCVec_PeerDetailsZ _res);
29203
29204 /**
29205  * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
29206  */
29207 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
29208
29209 /**
29210  * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
29211  */
29212 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
29213
29214 /**
29215  * Checks if the given object is currently in the success state
29216  */
29217 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
29218
29219 /**
29220  * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
29221  */
29222 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
29223
29224 /**
29225  * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
29226  * but with all dynamically-allocated buffers duplicated in new buffers.
29227  */
29228 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
29229
29230 /**
29231  * Creates a new CResult_NonePeerHandleErrorZ in the success state.
29232  */
29233 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
29234
29235 /**
29236  * Creates a new CResult_NonePeerHandleErrorZ in the error state.
29237  */
29238 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
29239
29240 /**
29241  * Checks if the given object is currently in the success state
29242  */
29243 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
29244
29245 /**
29246  * Frees any resources used by the CResult_NonePeerHandleErrorZ.
29247  */
29248 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
29249
29250 /**
29251  * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
29252  * but with all dynamically-allocated buffers duplicated in new buffers.
29253  */
29254 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
29255
29256 /**
29257  * Creates a new CResult_boolPeerHandleErrorZ in the success state.
29258  */
29259 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
29260
29261 /**
29262  * Creates a new CResult_boolPeerHandleErrorZ in the error state.
29263  */
29264 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
29265
29266 /**
29267  * Checks if the given object is currently in the success state
29268  */
29269 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
29270
29271 /**
29272  * Frees any resources used by the CResult_boolPeerHandleErrorZ.
29273  */
29274 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
29275
29276 /**
29277  * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
29278  * but with all dynamically-allocated buffers duplicated in new buffers.
29279  */
29280 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
29281
29282 /**
29283  * Creates a new CResult_u32GraphSyncErrorZ in the success state.
29284  */
29285 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
29286
29287 /**
29288  * Creates a new CResult_u32GraphSyncErrorZ in the error state.
29289  */
29290 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
29291
29292 /**
29293  * Checks if the given object is currently in the success state
29294  */
29295 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
29296
29297 /**
29298  * Frees any resources used by the CResult_u32GraphSyncErrorZ.
29299  */
29300 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
29301
29302 /**
29303  * Creates a new CResult_CVec_u8ZIOErrorZ in the success state.
29304  */
29305 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_ok(struct LDKCVec_u8Z o);
29306
29307 /**
29308  * Creates a new CResult_CVec_u8ZIOErrorZ in the error state.
29309  */
29310 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_err(enum LDKIOError e);
29311
29312 /**
29313  * Checks if the given object is currently in the success state
29314  */
29315 bool CResult_CVec_u8ZIOErrorZ_is_ok(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR o);
29316
29317 /**
29318  * Frees any resources used by the CResult_CVec_u8ZIOErrorZ.
29319  */
29320 void CResult_CVec_u8ZIOErrorZ_free(struct LDKCResult_CVec_u8ZIOErrorZ _res);
29321
29322 /**
29323  * Creates a new CResult_CVec_u8ZIOErrorZ which has the same data as `orig`
29324  * but with all dynamically-allocated buffers duplicated in new buffers.
29325  */
29326 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_clone(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR orig);
29327
29328 /**
29329  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29330  */
29331 void CVec_StrZ_free(struct LDKCVec_StrZ _res);
29332
29333 /**
29334  * Creates a new CResult_CVec_StrZIOErrorZ in the success state.
29335  */
29336 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_ok(struct LDKCVec_StrZ o);
29337
29338 /**
29339  * Creates a new CResult_CVec_StrZIOErrorZ in the error state.
29340  */
29341 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_err(enum LDKIOError e);
29342
29343 /**
29344  * Checks if the given object is currently in the success state
29345  */
29346 bool CResult_CVec_StrZIOErrorZ_is_ok(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR o);
29347
29348 /**
29349  * Frees any resources used by the CResult_CVec_StrZIOErrorZ.
29350  */
29351 void CResult_CVec_StrZIOErrorZ_free(struct LDKCResult_CVec_StrZIOErrorZ _res);
29352
29353 /**
29354  * Creates a new CResult_CVec_StrZIOErrorZ which has the same data as `orig`
29355  * but with all dynamically-allocated buffers duplicated in new buffers.
29356  */
29357 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_clone(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR orig);
29358
29359 /**
29360  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29361  */
29362 void CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ _res);
29363
29364 /**
29365  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the success state.
29366  */
29367 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ o);
29368
29369 /**
29370  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the error state.
29371  */
29372 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_err(enum LDKIOError e);
29373
29374 /**
29375  * Checks if the given object is currently in the success state
29376  */
29377 bool CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR o);
29378
29379 /**
29380  * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.
29381  */
29382 void CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ _res);
29383
29384 /**
29385  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ which has the same data as `orig`
29386  * but with all dynamically-allocated buffers duplicated in new buffers.
29387  */
29388 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR orig);
29389
29390 /**
29391  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the success state.
29392  */
29393 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
29394
29395 /**
29396  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the error state.
29397  */
29398 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_err(enum LDKIOError e);
29399
29400 /**
29401  * Checks if the given object is currently in the success state
29402  */
29403 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR o);
29404
29405 /**
29406  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.
29407  */
29408 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ _res);
29409
29410 /**
29411  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ which has the same data as `orig`
29412  * but with all dynamically-allocated buffers duplicated in new buffers.
29413  */
29414 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR orig);
29415
29416 /**
29417  * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ in the success state.
29418  */
29419 struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(struct LDKUnsignedInvoiceRequest o);
29420
29421 /**
29422  * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ in the error state.
29423  */
29424 struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29425
29426 /**
29427  * Checks if the given object is currently in the success state
29428  */
29429 bool CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(const struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR o);
29430
29431 /**
29432  * Frees any resources used by the CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ.
29433  */
29434 void CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ _res);
29435
29436 /**
29437  * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ which has the same data as `orig`
29438  * but with all dynamically-allocated buffers duplicated in new buffers.
29439  */
29440 struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(const struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR orig);
29441
29442 /**
29443  * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ in the success state.
29444  */
29445 struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_ok(struct LDKInvoiceRequest o);
29446
29447 /**
29448  * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ in the error state.
29449  */
29450 struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29451
29452 /**
29453  * Checks if the given object is currently in the success state
29454  */
29455 bool CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR o);
29456
29457 /**
29458  * Frees any resources used by the CResult_InvoiceRequestBolt12SemanticErrorZ.
29459  */
29460 void CResult_InvoiceRequestBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ _res);
29461
29462 /**
29463  * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ which has the same data as `orig`
29464  * but with all dynamically-allocated buffers duplicated in new buffers.
29465  */
29466 struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_clone(const struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR orig);
29467
29468 /**
29469  * Constructs a new COption_SecretKeyZ containing a crate::c_types::SecretKey
29470  */
29471 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_some(struct LDKSecretKey o);
29472
29473 /**
29474  * Constructs a new COption_SecretKeyZ containing nothing
29475  */
29476 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_none(void);
29477
29478 /**
29479  * Frees any resources associated with the crate::c_types::SecretKey, if we are in the Some state
29480  */
29481 void COption_SecretKeyZ_free(struct LDKCOption_SecretKeyZ _res);
29482
29483 /**
29484  * Creates a new COption_SecretKeyZ which has the same data as `orig`
29485  * but with all dynamically-allocated buffers duplicated in new buffers.
29486  */
29487 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_clone(const struct LDKCOption_SecretKeyZ *NONNULL_PTR orig);
29488
29489 /**
29490  * Creates a new CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ in the success state.
29491  */
29492 struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceWithExplicitSigningPubkeyBuilder o);
29493
29494 /**
29495  * Creates a new CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ in the error state.
29496  */
29497 struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29498
29499 /**
29500  * Checks if the given object is currently in the success state
29501  */
29502 bool CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
29503
29504 /**
29505  * Frees any resources used by the CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ.
29506  */
29507 void CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ _res);
29508
29509 /**
29510  * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the success state.
29511  */
29512 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_ok(struct LDKVerifiedInvoiceRequest o);
29513
29514 /**
29515  * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the error state.
29516  */
29517 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_err(void);
29518
29519 /**
29520  * Checks if the given object is currently in the success state
29521  */
29522 bool CResult_VerifiedInvoiceRequestNoneZ_is_ok(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR o);
29523
29524 /**
29525  * Frees any resources used by the CResult_VerifiedInvoiceRequestNoneZ.
29526  */
29527 void CResult_VerifiedInvoiceRequestNoneZ_free(struct LDKCResult_VerifiedInvoiceRequestNoneZ _res);
29528
29529 /**
29530  * Creates a new CResult_VerifiedInvoiceRequestNoneZ which has the same data as `orig`
29531  * but with all dynamically-allocated buffers duplicated in new buffers.
29532  */
29533 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_clone(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR orig);
29534
29535 /**
29536  * Creates a new CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ in the success state.
29537  */
29538 struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceWithDerivedSigningPubkeyBuilder o);
29539
29540 /**
29541  * Creates a new CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ in the error state.
29542  */
29543 struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29544
29545 /**
29546  * Checks if the given object is currently in the success state
29547  */
29548 bool CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
29549
29550 /**
29551  * Frees any resources used by the CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ.
29552  */
29553 void CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ _res);
29554
29555 /**
29556  * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ in the success state.
29557  */
29558 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_ok(struct LDKInvoiceRequestFields o);
29559
29560 /**
29561  * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ in the error state.
29562  */
29563 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_err(struct LDKDecodeError e);
29564
29565 /**
29566  * Checks if the given object is currently in the success state
29567  */
29568 bool CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR o);
29569
29570 /**
29571  * Frees any resources used by the CResult_InvoiceRequestFieldsDecodeErrorZ.
29572  */
29573 void CResult_InvoiceRequestFieldsDecodeErrorZ_free(struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ _res);
29574
29575 /**
29576  * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ which has the same data as `orig`
29577  * but with all dynamically-allocated buffers duplicated in new buffers.
29578  */
29579 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_clone(const struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR orig);
29580
29581 /**
29582  * Constructs a new COption_NoneZ containing a
29583  */
29584 enum LDKCOption_NoneZ COption_NoneZ_some(void);
29585
29586 /**
29587  * Constructs a new COption_NoneZ containing nothing
29588  */
29589 enum LDKCOption_NoneZ COption_NoneZ_none(void);
29590
29591 /**
29592  * Frees any resources associated with the , if we are in the Some state
29593  */
29594 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
29595
29596 /**
29597  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29598  */
29599 void CVec_WitnessZ_free(struct LDKCVec_WitnessZ _res);
29600
29601 /**
29602  * Constructs a new COption_ECDSASignatureZ containing a crate::c_types::ECDSASignature
29603  */
29604 struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_some(struct LDKECDSASignature o);
29605
29606 /**
29607  * Constructs a new COption_ECDSASignatureZ containing nothing
29608  */
29609 struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_none(void);
29610
29611 /**
29612  * Frees any resources associated with the crate::c_types::ECDSASignature, if we are in the Some state
29613  */
29614 void COption_ECDSASignatureZ_free(struct LDKCOption_ECDSASignatureZ _res);
29615
29616 /**
29617  * Creates a new COption_ECDSASignatureZ which has the same data as `orig`
29618  * but with all dynamically-allocated buffers duplicated in new buffers.
29619  */
29620 struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_clone(const struct LDKCOption_ECDSASignatureZ *NONNULL_PTR orig);
29621
29622 /**
29623  * Constructs a new COption_i64Z containing a i64
29624  */
29625 struct LDKCOption_i64Z COption_i64Z_some(int64_t o);
29626
29627 /**
29628  * Constructs a new COption_i64Z containing nothing
29629  */
29630 struct LDKCOption_i64Z COption_i64Z_none(void);
29631
29632 /**
29633  * Frees any resources associated with the i64, if we are in the Some state
29634  */
29635 void COption_i64Z_free(struct LDKCOption_i64Z _res);
29636
29637 /**
29638  * Creates a new COption_i64Z which has the same data as `orig`
29639  * but with all dynamically-allocated buffers duplicated in new buffers.
29640  */
29641 struct LDKCOption_i64Z COption_i64Z_clone(const struct LDKCOption_i64Z *NONNULL_PTR orig);
29642
29643 /**
29644  * Creates a new CResult_SocketAddressDecodeErrorZ in the success state.
29645  */
29646 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_ok(struct LDKSocketAddress o);
29647
29648 /**
29649  * Creates a new CResult_SocketAddressDecodeErrorZ in the error state.
29650  */
29651 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_err(struct LDKDecodeError e);
29652
29653 /**
29654  * Checks if the given object is currently in the success state
29655  */
29656 bool CResult_SocketAddressDecodeErrorZ_is_ok(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR o);
29657
29658 /**
29659  * Frees any resources used by the CResult_SocketAddressDecodeErrorZ.
29660  */
29661 void CResult_SocketAddressDecodeErrorZ_free(struct LDKCResult_SocketAddressDecodeErrorZ _res);
29662
29663 /**
29664  * Creates a new CResult_SocketAddressDecodeErrorZ which has the same data as `orig`
29665  * but with all dynamically-allocated buffers duplicated in new buffers.
29666  */
29667 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_clone(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR orig);
29668
29669 /**
29670  * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the success state.
29671  */
29672 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_ok(struct LDKSocketAddress o);
29673
29674 /**
29675  * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the error state.
29676  */
29677 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_err(enum LDKSocketAddressParseError e);
29678
29679 /**
29680  * Checks if the given object is currently in the success state
29681  */
29682 bool CResult_SocketAddressSocketAddressParseErrorZ_is_ok(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR o);
29683
29684 /**
29685  * Frees any resources used by the CResult_SocketAddressSocketAddressParseErrorZ.
29686  */
29687 void CResult_SocketAddressSocketAddressParseErrorZ_free(struct LDKCResult_SocketAddressSocketAddressParseErrorZ _res);
29688
29689 /**
29690  * Creates a new CResult_SocketAddressSocketAddressParseErrorZ which has the same data as `orig`
29691  * but with all dynamically-allocated buffers duplicated in new buffers.
29692  */
29693 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_clone(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR orig);
29694
29695 /**
29696  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29697  */
29698 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
29699
29700 /**
29701  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29702  */
29703 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
29704
29705 /**
29706  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29707  */
29708 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
29709
29710 /**
29711  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29712  */
29713 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
29714
29715 /**
29716  * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
29717  */
29718 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
29719
29720 /**
29721  * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
29722  */
29723 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
29724
29725 /**
29726  * Checks if the given object is currently in the success state
29727  */
29728 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
29729
29730 /**
29731  * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
29732  */
29733 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
29734
29735 /**
29736  * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
29737  * but with all dynamically-allocated buffers duplicated in new buffers.
29738  */
29739 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
29740
29741 /**
29742  * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the success state.
29743  */
29744 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_ok(struct LDKAcceptChannelV2 o);
29745
29746 /**
29747  * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the error state.
29748  */
29749 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
29750
29751 /**
29752  * Checks if the given object is currently in the success state
29753  */
29754 bool CResult_AcceptChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR o);
29755
29756 /**
29757  * Frees any resources used by the CResult_AcceptChannelV2DecodeErrorZ.
29758  */
29759 void CResult_AcceptChannelV2DecodeErrorZ_free(struct LDKCResult_AcceptChannelV2DecodeErrorZ _res);
29760
29761 /**
29762  * Creates a new CResult_AcceptChannelV2DecodeErrorZ which has the same data as `orig`
29763  * but with all dynamically-allocated buffers duplicated in new buffers.
29764  */
29765 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_clone(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR orig);
29766
29767 /**
29768  * Creates a new CResult_StfuDecodeErrorZ in the success state.
29769  */
29770 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_ok(struct LDKStfu o);
29771
29772 /**
29773  * Creates a new CResult_StfuDecodeErrorZ in the error state.
29774  */
29775 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_err(struct LDKDecodeError e);
29776
29777 /**
29778  * Checks if the given object is currently in the success state
29779  */
29780 bool CResult_StfuDecodeErrorZ_is_ok(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR o);
29781
29782 /**
29783  * Frees any resources used by the CResult_StfuDecodeErrorZ.
29784  */
29785 void CResult_StfuDecodeErrorZ_free(struct LDKCResult_StfuDecodeErrorZ _res);
29786
29787 /**
29788  * Creates a new CResult_StfuDecodeErrorZ which has the same data as `orig`
29789  * but with all dynamically-allocated buffers duplicated in new buffers.
29790  */
29791 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_clone(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR orig);
29792
29793 /**
29794  * Creates a new CResult_SpliceDecodeErrorZ in the success state.
29795  */
29796 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_ok(struct LDKSplice o);
29797
29798 /**
29799  * Creates a new CResult_SpliceDecodeErrorZ in the error state.
29800  */
29801 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_err(struct LDKDecodeError e);
29802
29803 /**
29804  * Checks if the given object is currently in the success state
29805  */
29806 bool CResult_SpliceDecodeErrorZ_is_ok(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR o);
29807
29808 /**
29809  * Frees any resources used by the CResult_SpliceDecodeErrorZ.
29810  */
29811 void CResult_SpliceDecodeErrorZ_free(struct LDKCResult_SpliceDecodeErrorZ _res);
29812
29813 /**
29814  * Creates a new CResult_SpliceDecodeErrorZ which has the same data as `orig`
29815  * but with all dynamically-allocated buffers duplicated in new buffers.
29816  */
29817 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_clone(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR orig);
29818
29819 /**
29820  * Creates a new CResult_SpliceAckDecodeErrorZ in the success state.
29821  */
29822 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_ok(struct LDKSpliceAck o);
29823
29824 /**
29825  * Creates a new CResult_SpliceAckDecodeErrorZ in the error state.
29826  */
29827 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_err(struct LDKDecodeError e);
29828
29829 /**
29830  * Checks if the given object is currently in the success state
29831  */
29832 bool CResult_SpliceAckDecodeErrorZ_is_ok(const struct LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR o);
29833
29834 /**
29835  * Frees any resources used by the CResult_SpliceAckDecodeErrorZ.
29836  */
29837 void CResult_SpliceAckDecodeErrorZ_free(struct LDKCResult_SpliceAckDecodeErrorZ _res);
29838
29839 /**
29840  * Creates a new CResult_SpliceAckDecodeErrorZ which has the same data as `orig`
29841  * but with all dynamically-allocated buffers duplicated in new buffers.
29842  */
29843 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_clone(const struct LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR orig);
29844
29845 /**
29846  * Creates a new CResult_SpliceLockedDecodeErrorZ in the success state.
29847  */
29848 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_ok(struct LDKSpliceLocked o);
29849
29850 /**
29851  * Creates a new CResult_SpliceLockedDecodeErrorZ in the error state.
29852  */
29853 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_err(struct LDKDecodeError e);
29854
29855 /**
29856  * Checks if the given object is currently in the success state
29857  */
29858 bool CResult_SpliceLockedDecodeErrorZ_is_ok(const struct LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR o);
29859
29860 /**
29861  * Frees any resources used by the CResult_SpliceLockedDecodeErrorZ.
29862  */
29863 void CResult_SpliceLockedDecodeErrorZ_free(struct LDKCResult_SpliceLockedDecodeErrorZ _res);
29864
29865 /**
29866  * Creates a new CResult_SpliceLockedDecodeErrorZ which has the same data as `orig`
29867  * but with all dynamically-allocated buffers duplicated in new buffers.
29868  */
29869 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_clone(const struct LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR orig);
29870
29871 /**
29872  * Creates a new CResult_TxAddInputDecodeErrorZ in the success state.
29873  */
29874 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_ok(struct LDKTxAddInput o);
29875
29876 /**
29877  * Creates a new CResult_TxAddInputDecodeErrorZ in the error state.
29878  */
29879 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_err(struct LDKDecodeError e);
29880
29881 /**
29882  * Checks if the given object is currently in the success state
29883  */
29884 bool CResult_TxAddInputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR o);
29885
29886 /**
29887  * Frees any resources used by the CResult_TxAddInputDecodeErrorZ.
29888  */
29889 void CResult_TxAddInputDecodeErrorZ_free(struct LDKCResult_TxAddInputDecodeErrorZ _res);
29890
29891 /**
29892  * Creates a new CResult_TxAddInputDecodeErrorZ which has the same data as `orig`
29893  * but with all dynamically-allocated buffers duplicated in new buffers.
29894  */
29895 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_clone(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR orig);
29896
29897 /**
29898  * Creates a new CResult_TxAddOutputDecodeErrorZ in the success state.
29899  */
29900 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_ok(struct LDKTxAddOutput o);
29901
29902 /**
29903  * Creates a new CResult_TxAddOutputDecodeErrorZ in the error state.
29904  */
29905 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_err(struct LDKDecodeError e);
29906
29907 /**
29908  * Checks if the given object is currently in the success state
29909  */
29910 bool CResult_TxAddOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR o);
29911
29912 /**
29913  * Frees any resources used by the CResult_TxAddOutputDecodeErrorZ.
29914  */
29915 void CResult_TxAddOutputDecodeErrorZ_free(struct LDKCResult_TxAddOutputDecodeErrorZ _res);
29916
29917 /**
29918  * Creates a new CResult_TxAddOutputDecodeErrorZ which has the same data as `orig`
29919  * but with all dynamically-allocated buffers duplicated in new buffers.
29920  */
29921 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_clone(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR orig);
29922
29923 /**
29924  * Creates a new CResult_TxRemoveInputDecodeErrorZ in the success state.
29925  */
29926 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_ok(struct LDKTxRemoveInput o);
29927
29928 /**
29929  * Creates a new CResult_TxRemoveInputDecodeErrorZ in the error state.
29930  */
29931 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_err(struct LDKDecodeError e);
29932
29933 /**
29934  * Checks if the given object is currently in the success state
29935  */
29936 bool CResult_TxRemoveInputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR o);
29937
29938 /**
29939  * Frees any resources used by the CResult_TxRemoveInputDecodeErrorZ.
29940  */
29941 void CResult_TxRemoveInputDecodeErrorZ_free(struct LDKCResult_TxRemoveInputDecodeErrorZ _res);
29942
29943 /**
29944  * Creates a new CResult_TxRemoveInputDecodeErrorZ which has the same data as `orig`
29945  * but with all dynamically-allocated buffers duplicated in new buffers.
29946  */
29947 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR orig);
29948
29949 /**
29950  * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the success state.
29951  */
29952 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_ok(struct LDKTxRemoveOutput o);
29953
29954 /**
29955  * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the error state.
29956  */
29957 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_err(struct LDKDecodeError e);
29958
29959 /**
29960  * Checks if the given object is currently in the success state
29961  */
29962 bool CResult_TxRemoveOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR o);
29963
29964 /**
29965  * Frees any resources used by the CResult_TxRemoveOutputDecodeErrorZ.
29966  */
29967 void CResult_TxRemoveOutputDecodeErrorZ_free(struct LDKCResult_TxRemoveOutputDecodeErrorZ _res);
29968
29969 /**
29970  * Creates a new CResult_TxRemoveOutputDecodeErrorZ which has the same data as `orig`
29971  * but with all dynamically-allocated buffers duplicated in new buffers.
29972  */
29973 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR orig);
29974
29975 /**
29976  * Creates a new CResult_TxCompleteDecodeErrorZ in the success state.
29977  */
29978 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_ok(struct LDKTxComplete o);
29979
29980 /**
29981  * Creates a new CResult_TxCompleteDecodeErrorZ in the error state.
29982  */
29983 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_err(struct LDKDecodeError e);
29984
29985 /**
29986  * Checks if the given object is currently in the success state
29987  */
29988 bool CResult_TxCompleteDecodeErrorZ_is_ok(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR o);
29989
29990 /**
29991  * Frees any resources used by the CResult_TxCompleteDecodeErrorZ.
29992  */
29993 void CResult_TxCompleteDecodeErrorZ_free(struct LDKCResult_TxCompleteDecodeErrorZ _res);
29994
29995 /**
29996  * Creates a new CResult_TxCompleteDecodeErrorZ which has the same data as `orig`
29997  * but with all dynamically-allocated buffers duplicated in new buffers.
29998  */
29999 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_clone(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR orig);
30000
30001 /**
30002  * Creates a new CResult_TxSignaturesDecodeErrorZ in the success state.
30003  */
30004 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_ok(struct LDKTxSignatures o);
30005
30006 /**
30007  * Creates a new CResult_TxSignaturesDecodeErrorZ in the error state.
30008  */
30009 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
30010
30011 /**
30012  * Checks if the given object is currently in the success state
30013  */
30014 bool CResult_TxSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR o);
30015
30016 /**
30017  * Frees any resources used by the CResult_TxSignaturesDecodeErrorZ.
30018  */
30019 void CResult_TxSignaturesDecodeErrorZ_free(struct LDKCResult_TxSignaturesDecodeErrorZ _res);
30020
30021 /**
30022  * Creates a new CResult_TxSignaturesDecodeErrorZ which has the same data as `orig`
30023  * but with all dynamically-allocated buffers duplicated in new buffers.
30024  */
30025 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_clone(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR orig);
30026
30027 /**
30028  * Creates a new CResult_TxInitRbfDecodeErrorZ in the success state.
30029  */
30030 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_ok(struct LDKTxInitRbf o);
30031
30032 /**
30033  * Creates a new CResult_TxInitRbfDecodeErrorZ in the error state.
30034  */
30035 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_err(struct LDKDecodeError e);
30036
30037 /**
30038  * Checks if the given object is currently in the success state
30039  */
30040 bool CResult_TxInitRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR o);
30041
30042 /**
30043  * Frees any resources used by the CResult_TxInitRbfDecodeErrorZ.
30044  */
30045 void CResult_TxInitRbfDecodeErrorZ_free(struct LDKCResult_TxInitRbfDecodeErrorZ _res);
30046
30047 /**
30048  * Creates a new CResult_TxInitRbfDecodeErrorZ which has the same data as `orig`
30049  * but with all dynamically-allocated buffers duplicated in new buffers.
30050  */
30051 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_clone(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR orig);
30052
30053 /**
30054  * Creates a new CResult_TxAckRbfDecodeErrorZ in the success state.
30055  */
30056 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_ok(struct LDKTxAckRbf o);
30057
30058 /**
30059  * Creates a new CResult_TxAckRbfDecodeErrorZ in the error state.
30060  */
30061 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_err(struct LDKDecodeError e);
30062
30063 /**
30064  * Checks if the given object is currently in the success state
30065  */
30066 bool CResult_TxAckRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR o);
30067
30068 /**
30069  * Frees any resources used by the CResult_TxAckRbfDecodeErrorZ.
30070  */
30071 void CResult_TxAckRbfDecodeErrorZ_free(struct LDKCResult_TxAckRbfDecodeErrorZ _res);
30072
30073 /**
30074  * Creates a new CResult_TxAckRbfDecodeErrorZ which has the same data as `orig`
30075  * but with all dynamically-allocated buffers duplicated in new buffers.
30076  */
30077 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_clone(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR orig);
30078
30079 /**
30080  * Creates a new CResult_TxAbortDecodeErrorZ in the success state.
30081  */
30082 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_ok(struct LDKTxAbort o);
30083
30084 /**
30085  * Creates a new CResult_TxAbortDecodeErrorZ in the error state.
30086  */
30087 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_err(struct LDKDecodeError e);
30088
30089 /**
30090  * Checks if the given object is currently in the success state
30091  */
30092 bool CResult_TxAbortDecodeErrorZ_is_ok(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR o);
30093
30094 /**
30095  * Frees any resources used by the CResult_TxAbortDecodeErrorZ.
30096  */
30097 void CResult_TxAbortDecodeErrorZ_free(struct LDKCResult_TxAbortDecodeErrorZ _res);
30098
30099 /**
30100  * Creates a new CResult_TxAbortDecodeErrorZ which has the same data as `orig`
30101  * but with all dynamically-allocated buffers duplicated in new buffers.
30102  */
30103 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_clone(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR orig);
30104
30105 /**
30106  * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
30107  */
30108 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
30109
30110 /**
30111  * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
30112  */
30113 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
30114
30115 /**
30116  * Checks if the given object is currently in the success state
30117  */
30118 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
30119
30120 /**
30121  * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
30122  */
30123 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
30124
30125 /**
30126  * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
30127  * but with all dynamically-allocated buffers duplicated in new buffers.
30128  */
30129 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
30130
30131 /**
30132  * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
30133  */
30134 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
30135
30136 /**
30137  * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
30138  */
30139 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
30140
30141 /**
30142  * Checks if the given object is currently in the success state
30143  */
30144 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
30145
30146 /**
30147  * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
30148  */
30149 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
30150
30151 /**
30152  * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
30153  * but with all dynamically-allocated buffers duplicated in new buffers.
30154  */
30155 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
30156
30157 /**
30158  * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
30159  */
30160 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
30161
30162 /**
30163  * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
30164  */
30165 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
30166
30167 /**
30168  * Checks if the given object is currently in the success state
30169  */
30170 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
30171
30172 /**
30173  * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
30174  */
30175 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
30176
30177 /**
30178  * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
30179  * but with all dynamically-allocated buffers duplicated in new buffers.
30180  */
30181 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
30182
30183 /**
30184  * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
30185  */
30186 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
30187
30188 /**
30189  * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
30190  */
30191 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
30192
30193 /**
30194  * Checks if the given object is currently in the success state
30195  */
30196 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
30197
30198 /**
30199  * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
30200  */
30201 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
30202
30203 /**
30204  * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
30205  * but with all dynamically-allocated buffers duplicated in new buffers.
30206  */
30207 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
30208
30209 /**
30210  * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
30211  */
30212 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
30213
30214 /**
30215  * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
30216  */
30217 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
30218
30219 /**
30220  * Checks if the given object is currently in the success state
30221  */
30222 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
30223
30224 /**
30225  * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
30226  */
30227 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
30228
30229 /**
30230  * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
30231  * but with all dynamically-allocated buffers duplicated in new buffers.
30232  */
30233 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
30234
30235 /**
30236  * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
30237  */
30238 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
30239
30240 /**
30241  * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
30242  */
30243 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
30244
30245 /**
30246  * Checks if the given object is currently in the success state
30247  */
30248 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
30249
30250 /**
30251  * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
30252  */
30253 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
30254
30255 /**
30256  * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
30257  * but with all dynamically-allocated buffers duplicated in new buffers.
30258  */
30259 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
30260
30261 /**
30262  * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
30263  */
30264 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
30265
30266 /**
30267  * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
30268  */
30269 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
30270
30271 /**
30272  * Checks if the given object is currently in the success state
30273  */
30274 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
30275
30276 /**
30277  * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
30278  */
30279 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
30280
30281 /**
30282  * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
30283  * but with all dynamically-allocated buffers duplicated in new buffers.
30284  */
30285 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
30286
30287 /**
30288  * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
30289  */
30290 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
30291
30292 /**
30293  * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
30294  */
30295 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
30296
30297 /**
30298  * Checks if the given object is currently in the success state
30299  */
30300 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
30301
30302 /**
30303  * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
30304  */
30305 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
30306
30307 /**
30308  * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
30309  * but with all dynamically-allocated buffers duplicated in new buffers.
30310  */
30311 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
30312
30313 /**
30314  * Creates a new CResult_InitDecodeErrorZ in the success state.
30315  */
30316 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
30317
30318 /**
30319  * Creates a new CResult_InitDecodeErrorZ in the error state.
30320  */
30321 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
30322
30323 /**
30324  * Checks if the given object is currently in the success state
30325  */
30326 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
30327
30328 /**
30329  * Frees any resources used by the CResult_InitDecodeErrorZ.
30330  */
30331 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
30332
30333 /**
30334  * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
30335  * but with all dynamically-allocated buffers duplicated in new buffers.
30336  */
30337 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
30338
30339 /**
30340  * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
30341  */
30342 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
30343
30344 /**
30345  * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
30346  */
30347 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
30348
30349 /**
30350  * Checks if the given object is currently in the success state
30351  */
30352 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
30353
30354 /**
30355  * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
30356  */
30357 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
30358
30359 /**
30360  * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
30361  * but with all dynamically-allocated buffers duplicated in new buffers.
30362  */
30363 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
30364
30365 /**
30366  * Creates a new CResult_OpenChannelV2DecodeErrorZ in the success state.
30367  */
30368 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_ok(struct LDKOpenChannelV2 o);
30369
30370 /**
30371  * Creates a new CResult_OpenChannelV2DecodeErrorZ in the error state.
30372  */
30373 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
30374
30375 /**
30376  * Checks if the given object is currently in the success state
30377  */
30378 bool CResult_OpenChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR o);
30379
30380 /**
30381  * Frees any resources used by the CResult_OpenChannelV2DecodeErrorZ.
30382  */
30383 void CResult_OpenChannelV2DecodeErrorZ_free(struct LDKCResult_OpenChannelV2DecodeErrorZ _res);
30384
30385 /**
30386  * Creates a new CResult_OpenChannelV2DecodeErrorZ which has the same data as `orig`
30387  * but with all dynamically-allocated buffers duplicated in new buffers.
30388  */
30389 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_clone(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR orig);
30390
30391 /**
30392  * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
30393  */
30394 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
30395
30396 /**
30397  * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
30398  */
30399 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
30400
30401 /**
30402  * Checks if the given object is currently in the success state
30403  */
30404 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
30405
30406 /**
30407  * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
30408  */
30409 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
30410
30411 /**
30412  * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
30413  * but with all dynamically-allocated buffers duplicated in new buffers.
30414  */
30415 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
30416
30417 /**
30418  * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
30419  */
30420 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
30421
30422 /**
30423  * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
30424  */
30425 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
30426
30427 /**
30428  * Checks if the given object is currently in the success state
30429  */
30430 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
30431
30432 /**
30433  * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
30434  */
30435 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
30436
30437 /**
30438  * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
30439  * but with all dynamically-allocated buffers duplicated in new buffers.
30440  */
30441 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
30442
30443 /**
30444  * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
30445  */
30446 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
30447
30448 /**
30449  * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
30450  */
30451 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30452
30453 /**
30454  * Checks if the given object is currently in the success state
30455  */
30456 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
30457
30458 /**
30459  * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
30460  */
30461 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
30462
30463 /**
30464  * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
30465  * but with all dynamically-allocated buffers duplicated in new buffers.
30466  */
30467 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
30468
30469 /**
30470  * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
30471  */
30472 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
30473
30474 /**
30475  * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
30476  */
30477 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30478
30479 /**
30480  * Checks if the given object is currently in the success state
30481  */
30482 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
30483
30484 /**
30485  * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
30486  */
30487 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
30488
30489 /**
30490  * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
30491  * but with all dynamically-allocated buffers duplicated in new buffers.
30492  */
30493 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
30494
30495 /**
30496  * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
30497  */
30498 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
30499
30500 /**
30501  * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
30502  */
30503 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
30504
30505 /**
30506  * Checks if the given object is currently in the success state
30507  */
30508 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
30509
30510 /**
30511  * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
30512  */
30513 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
30514
30515 /**
30516  * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
30517  * but with all dynamically-allocated buffers duplicated in new buffers.
30518  */
30519 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
30520
30521 /**
30522  * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
30523  */
30524 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
30525
30526 /**
30527  * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
30528  */
30529 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30530
30531 /**
30532  * Checks if the given object is currently in the success state
30533  */
30534 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
30535
30536 /**
30537  * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
30538  */
30539 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
30540
30541 /**
30542  * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
30543  * but with all dynamically-allocated buffers duplicated in new buffers.
30544  */
30545 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
30546
30547 /**
30548  * Creates a new CResult_OnionPacketDecodeErrorZ in the success state.
30549  */
30550 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_ok(struct LDKOnionPacket o);
30551
30552 /**
30553  * Creates a new CResult_OnionPacketDecodeErrorZ in the error state.
30554  */
30555 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_err(struct LDKDecodeError e);
30556
30557 /**
30558  * Checks if the given object is currently in the success state
30559  */
30560 bool CResult_OnionPacketDecodeErrorZ_is_ok(const struct LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR o);
30561
30562 /**
30563  * Frees any resources used by the CResult_OnionPacketDecodeErrorZ.
30564  */
30565 void CResult_OnionPacketDecodeErrorZ_free(struct LDKCResult_OnionPacketDecodeErrorZ _res);
30566
30567 /**
30568  * Creates a new CResult_OnionPacketDecodeErrorZ which has the same data as `orig`
30569  * but with all dynamically-allocated buffers duplicated in new buffers.
30570  */
30571 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_clone(const struct LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR orig);
30572
30573 /**
30574  * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
30575  */
30576 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
30577
30578 /**
30579  * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
30580  */
30581 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30582
30583 /**
30584  * Checks if the given object is currently in the success state
30585  */
30586 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
30587
30588 /**
30589  * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
30590  */
30591 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
30592
30593 /**
30594  * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
30595  * but with all dynamically-allocated buffers duplicated in new buffers.
30596  */
30597 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
30598
30599 /**
30600  * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
30601  */
30602 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
30603
30604 /**
30605  * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
30606  */
30607 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
30608
30609 /**
30610  * Checks if the given object is currently in the success state
30611  */
30612 bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
30613
30614 /**
30615  * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
30616  */
30617 void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
30618
30619 /**
30620  * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
30621  * but with all dynamically-allocated buffers duplicated in new buffers.
30622  */
30623 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
30624
30625 /**
30626  * Creates a new CResult_FinalOnionHopDataDecodeErrorZ in the success state.
30627  */
30628 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_ok(struct LDKFinalOnionHopData o);
30629
30630 /**
30631  * Creates a new CResult_FinalOnionHopDataDecodeErrorZ in the error state.
30632  */
30633 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_err(struct LDKDecodeError e);
30634
30635 /**
30636  * Checks if the given object is currently in the success state
30637  */
30638 bool CResult_FinalOnionHopDataDecodeErrorZ_is_ok(const struct LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR o);
30639
30640 /**
30641  * Frees any resources used by the CResult_FinalOnionHopDataDecodeErrorZ.
30642  */
30643 void CResult_FinalOnionHopDataDecodeErrorZ_free(struct LDKCResult_FinalOnionHopDataDecodeErrorZ _res);
30644
30645 /**
30646  * Creates a new CResult_FinalOnionHopDataDecodeErrorZ which has the same data as `orig`
30647  * but with all dynamically-allocated buffers duplicated in new buffers.
30648  */
30649 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_clone(const struct LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR orig);
30650
30651 /**
30652  * Creates a new CResult_PingDecodeErrorZ in the success state.
30653  */
30654 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
30655
30656 /**
30657  * Creates a new CResult_PingDecodeErrorZ in the error state.
30658  */
30659 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
30660
30661 /**
30662  * Checks if the given object is currently in the success state
30663  */
30664 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
30665
30666 /**
30667  * Frees any resources used by the CResult_PingDecodeErrorZ.
30668  */
30669 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
30670
30671 /**
30672  * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
30673  * but with all dynamically-allocated buffers duplicated in new buffers.
30674  */
30675 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
30676
30677 /**
30678  * Creates a new CResult_PongDecodeErrorZ in the success state.
30679  */
30680 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
30681
30682 /**
30683  * Creates a new CResult_PongDecodeErrorZ in the error state.
30684  */
30685 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
30686
30687 /**
30688  * Checks if the given object is currently in the success state
30689  */
30690 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
30691
30692 /**
30693  * Frees any resources used by the CResult_PongDecodeErrorZ.
30694  */
30695 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
30696
30697 /**
30698  * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
30699  * but with all dynamically-allocated buffers duplicated in new buffers.
30700  */
30701 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
30702
30703 /**
30704  * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
30705  */
30706 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
30707
30708 /**
30709  * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
30710  */
30711 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30712
30713 /**
30714  * Checks if the given object is currently in the success state
30715  */
30716 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
30717
30718 /**
30719  * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
30720  */
30721 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
30722
30723 /**
30724  * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
30725  * but with all dynamically-allocated buffers duplicated in new buffers.
30726  */
30727 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30728
30729 /**
30730  * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
30731  */
30732 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
30733
30734 /**
30735  * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
30736  */
30737 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30738
30739 /**
30740  * Checks if the given object is currently in the success state
30741  */
30742 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
30743
30744 /**
30745  * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
30746  */
30747 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
30748
30749 /**
30750  * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
30751  * but with all dynamically-allocated buffers duplicated in new buffers.
30752  */
30753 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30754
30755 /**
30756  * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
30757  */
30758 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
30759
30760 /**
30761  * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
30762  */
30763 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
30764
30765 /**
30766  * Checks if the given object is currently in the success state
30767  */
30768 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
30769
30770 /**
30771  * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
30772  */
30773 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
30774
30775 /**
30776  * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
30777  * but with all dynamically-allocated buffers duplicated in new buffers.
30778  */
30779 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
30780
30781 /**
30782  * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
30783  */
30784 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
30785
30786 /**
30787  * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
30788  */
30789 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
30790
30791 /**
30792  * Checks if the given object is currently in the success state
30793  */
30794 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
30795
30796 /**
30797  * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
30798  */
30799 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
30800
30801 /**
30802  * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
30803  * but with all dynamically-allocated buffers duplicated in new buffers.
30804  */
30805 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
30806
30807 /**
30808  * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
30809  */
30810 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
30811
30812 /**
30813  * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
30814  */
30815 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
30816
30817 /**
30818  * Checks if the given object is currently in the success state
30819  */
30820 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
30821
30822 /**
30823  * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
30824  */
30825 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
30826
30827 /**
30828  * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
30829  * but with all dynamically-allocated buffers duplicated in new buffers.
30830  */
30831 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
30832
30833 /**
30834  * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
30835  */
30836 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
30837
30838 /**
30839  * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
30840  */
30841 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
30842
30843 /**
30844  * Checks if the given object is currently in the success state
30845  */
30846 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
30847
30848 /**
30849  * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
30850  */
30851 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
30852
30853 /**
30854  * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
30855  * but with all dynamically-allocated buffers duplicated in new buffers.
30856  */
30857 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
30858
30859 /**
30860  * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
30861  */
30862 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
30863
30864 /**
30865  * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
30866  */
30867 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30868
30869 /**
30870  * Checks if the given object is currently in the success state
30871  */
30872 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
30873
30874 /**
30875  * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
30876  */
30877 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
30878
30879 /**
30880  * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
30881  * but with all dynamically-allocated buffers duplicated in new buffers.
30882  */
30883 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30884
30885 /**
30886  * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
30887  */
30888 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
30889
30890 /**
30891  * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
30892  */
30893 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30894
30895 /**
30896  * Checks if the given object is currently in the success state
30897  */
30898 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
30899
30900 /**
30901  * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
30902  */
30903 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
30904
30905 /**
30906  * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
30907  * but with all dynamically-allocated buffers duplicated in new buffers.
30908  */
30909 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30910
30911 /**
30912  * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
30913  */
30914 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
30915
30916 /**
30917  * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
30918  */
30919 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
30920
30921 /**
30922  * Checks if the given object is currently in the success state
30923  */
30924 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
30925
30926 /**
30927  * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
30928  */
30929 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
30930
30931 /**
30932  * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
30933  * but with all dynamically-allocated buffers duplicated in new buffers.
30934  */
30935 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
30936
30937 /**
30938  * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
30939  */
30940 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
30941
30942 /**
30943  * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
30944  */
30945 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
30946
30947 /**
30948  * Checks if the given object is currently in the success state
30949  */
30950 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
30951
30952 /**
30953  * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
30954  */
30955 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
30956
30957 /**
30958  * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
30959  * but with all dynamically-allocated buffers duplicated in new buffers.
30960  */
30961 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
30962
30963 /**
30964  * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
30965  */
30966 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
30967
30968 /**
30969  * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
30970  */
30971 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
30972
30973 /**
30974  * Checks if the given object is currently in the success state
30975  */
30976 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
30977
30978 /**
30979  * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
30980  */
30981 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
30982
30983 /**
30984  * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
30985  * but with all dynamically-allocated buffers duplicated in new buffers.
30986  */
30987 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
30988
30989 /**
30990  * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
30991  */
30992 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
30993
30994 /**
30995  * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
30996  */
30997 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
30998
30999 /**
31000  * Checks if the given object is currently in the success state
31001  */
31002 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
31003
31004 /**
31005  * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
31006  */
31007 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
31008
31009 /**
31010  * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
31011  * but with all dynamically-allocated buffers duplicated in new buffers.
31012  */
31013 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
31014
31015 /**
31016  * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
31017  */
31018 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
31019
31020 /**
31021  * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
31022  */
31023 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
31024
31025 /**
31026  * Checks if the given object is currently in the success state
31027  */
31028 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
31029
31030 /**
31031  * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
31032  */
31033 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
31034
31035 /**
31036  * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
31037  * but with all dynamically-allocated buffers duplicated in new buffers.
31038  */
31039 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
31040
31041 /**
31042  * Frees the buffer pointed to by `data` if `datalen` is non-0.
31043  */
31044 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
31045
31046 /**
31047  * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the success state.
31048  */
31049 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o);
31050
31051 /**
31052  * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the error state.
31053  */
31054 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
31055
31056 /**
31057  * Checks if the given object is currently in the success state
31058  */
31059 bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
31060
31061 /**
31062  * Frees any resources used by the CResult_Bolt11InvoiceSignOrCreationErrorZ.
31063  */
31064 void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res);
31065
31066 /**
31067  * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ which has the same data as `orig`
31068  * but with all dynamically-allocated buffers duplicated in new buffers.
31069  */
31070 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
31071
31072 /**
31073  * Constructs a new COption_InboundHTLCStateDetailsZ containing a crate::lightning::ln::channel_state::InboundHTLCStateDetails
31074  */
31075 struct LDKCOption_InboundHTLCStateDetailsZ COption_InboundHTLCStateDetailsZ_some(enum LDKInboundHTLCStateDetails o);
31076
31077 /**
31078  * Constructs a new COption_InboundHTLCStateDetailsZ containing nothing
31079  */
31080 struct LDKCOption_InboundHTLCStateDetailsZ COption_InboundHTLCStateDetailsZ_none(void);
31081
31082 /**
31083  * Frees any resources associated with the crate::lightning::ln::channel_state::InboundHTLCStateDetails, if we are in the Some state
31084  */
31085 void COption_InboundHTLCStateDetailsZ_free(struct LDKCOption_InboundHTLCStateDetailsZ _res);
31086
31087 /**
31088  * Creates a new COption_InboundHTLCStateDetailsZ which has the same data as `orig`
31089  * but with all dynamically-allocated buffers duplicated in new buffers.
31090  */
31091 struct LDKCOption_InboundHTLCStateDetailsZ COption_InboundHTLCStateDetailsZ_clone(const struct LDKCOption_InboundHTLCStateDetailsZ *NONNULL_PTR orig);
31092
31093 /**
31094  * Creates a new CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ in the success state.
31095  */
31096 struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_ok(struct LDKCOption_InboundHTLCStateDetailsZ o);
31097
31098 /**
31099  * Creates a new CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ in the error state.
31100  */
31101 struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_err(struct LDKDecodeError e);
31102
31103 /**
31104  * Checks if the given object is currently in the success state
31105  */
31106 bool CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR o);
31107
31108 /**
31109  * Frees any resources used by the CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ.
31110  */
31111 void CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_free(struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ _res);
31112
31113 /**
31114  * Creates a new CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ which has the same data as `orig`
31115  * but with all dynamically-allocated buffers duplicated in new buffers.
31116  */
31117 struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone(const struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR orig);
31118
31119 /**
31120  * Creates a new CResult_InboundHTLCDetailsDecodeErrorZ in the success state.
31121  */
31122 struct LDKCResult_InboundHTLCDetailsDecodeErrorZ CResult_InboundHTLCDetailsDecodeErrorZ_ok(struct LDKInboundHTLCDetails o);
31123
31124 /**
31125  * Creates a new CResult_InboundHTLCDetailsDecodeErrorZ in the error state.
31126  */
31127 struct LDKCResult_InboundHTLCDetailsDecodeErrorZ CResult_InboundHTLCDetailsDecodeErrorZ_err(struct LDKDecodeError e);
31128
31129 /**
31130  * Checks if the given object is currently in the success state
31131  */
31132 bool CResult_InboundHTLCDetailsDecodeErrorZ_is_ok(const struct LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR o);
31133
31134 /**
31135  * Frees any resources used by the CResult_InboundHTLCDetailsDecodeErrorZ.
31136  */
31137 void CResult_InboundHTLCDetailsDecodeErrorZ_free(struct LDKCResult_InboundHTLCDetailsDecodeErrorZ _res);
31138
31139 /**
31140  * Creates a new CResult_InboundHTLCDetailsDecodeErrorZ which has the same data as `orig`
31141  * but with all dynamically-allocated buffers duplicated in new buffers.
31142  */
31143 struct LDKCResult_InboundHTLCDetailsDecodeErrorZ CResult_InboundHTLCDetailsDecodeErrorZ_clone(const struct LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR orig);
31144
31145 /**
31146  * Constructs a new COption_OutboundHTLCStateDetailsZ containing a crate::lightning::ln::channel_state::OutboundHTLCStateDetails
31147  */
31148 struct LDKCOption_OutboundHTLCStateDetailsZ COption_OutboundHTLCStateDetailsZ_some(enum LDKOutboundHTLCStateDetails o);
31149
31150 /**
31151  * Constructs a new COption_OutboundHTLCStateDetailsZ containing nothing
31152  */
31153 struct LDKCOption_OutboundHTLCStateDetailsZ COption_OutboundHTLCStateDetailsZ_none(void);
31154
31155 /**
31156  * Frees any resources associated with the crate::lightning::ln::channel_state::OutboundHTLCStateDetails, if we are in the Some state
31157  */
31158 void COption_OutboundHTLCStateDetailsZ_free(struct LDKCOption_OutboundHTLCStateDetailsZ _res);
31159
31160 /**
31161  * Creates a new COption_OutboundHTLCStateDetailsZ which has the same data as `orig`
31162  * but with all dynamically-allocated buffers duplicated in new buffers.
31163  */
31164 struct LDKCOption_OutboundHTLCStateDetailsZ COption_OutboundHTLCStateDetailsZ_clone(const struct LDKCOption_OutboundHTLCStateDetailsZ *NONNULL_PTR orig);
31165
31166 /**
31167  * Creates a new CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ in the success state.
31168  */
31169 struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_ok(struct LDKCOption_OutboundHTLCStateDetailsZ o);
31170
31171 /**
31172  * Creates a new CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ in the error state.
31173  */
31174 struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_err(struct LDKDecodeError e);
31175
31176 /**
31177  * Checks if the given object is currently in the success state
31178  */
31179 bool CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR o);
31180
31181 /**
31182  * Frees any resources used by the CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ.
31183  */
31184 void CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_free(struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ _res);
31185
31186 /**
31187  * Creates a new CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ which has the same data as `orig`
31188  * but with all dynamically-allocated buffers duplicated in new buffers.
31189  */
31190 struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone(const struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR orig);
31191
31192 /**
31193  * Creates a new CResult_OutboundHTLCDetailsDecodeErrorZ in the success state.
31194  */
31195 struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ CResult_OutboundHTLCDetailsDecodeErrorZ_ok(struct LDKOutboundHTLCDetails o);
31196
31197 /**
31198  * Creates a new CResult_OutboundHTLCDetailsDecodeErrorZ in the error state.
31199  */
31200 struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ CResult_OutboundHTLCDetailsDecodeErrorZ_err(struct LDKDecodeError e);
31201
31202 /**
31203  * Checks if the given object is currently in the success state
31204  */
31205 bool CResult_OutboundHTLCDetailsDecodeErrorZ_is_ok(const struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR o);
31206
31207 /**
31208  * Frees any resources used by the CResult_OutboundHTLCDetailsDecodeErrorZ.
31209  */
31210 void CResult_OutboundHTLCDetailsDecodeErrorZ_free(struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ _res);
31211
31212 /**
31213  * Creates a new CResult_OutboundHTLCDetailsDecodeErrorZ which has the same data as `orig`
31214  * but with all dynamically-allocated buffers duplicated in new buffers.
31215  */
31216 struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ CResult_OutboundHTLCDetailsDecodeErrorZ_clone(const struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR orig);
31217
31218 /**
31219  * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
31220  */
31221 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
31222
31223 /**
31224  * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
31225  */
31226 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
31227
31228 /**
31229  * Checks if the given object is currently in the success state
31230  */
31231 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
31232
31233 /**
31234  * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
31235  */
31236 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
31237
31238 /**
31239  * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
31240  * but with all dynamically-allocated buffers duplicated in new buffers.
31241  */
31242 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
31243
31244 /**
31245  * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
31246  */
31247 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
31248
31249 /**
31250  * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
31251  */
31252 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
31253
31254 /**
31255  * Checks if the given object is currently in the success state
31256  */
31257 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
31258
31259 /**
31260  * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
31261  */
31262 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
31263
31264 /**
31265  * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
31266  * but with all dynamically-allocated buffers duplicated in new buffers.
31267  */
31268 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
31269
31270 /**
31271  * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channel_state::ChannelShutdownState
31272  */
31273 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o);
31274
31275 /**
31276  * Constructs a new COption_ChannelShutdownStateZ containing nothing
31277  */
31278 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void);
31279
31280 /**
31281  * Frees any resources associated with the crate::lightning::ln::channel_state::ChannelShutdownState, if we are in the Some state
31282  */
31283 void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res);
31284
31285 /**
31286  * Creates a new COption_ChannelShutdownStateZ which has the same data as `orig`
31287  * but with all dynamically-allocated buffers duplicated in new buffers.
31288  */
31289 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig);
31290
31291 /**
31292  * Frees the buffer pointed to by `data` if `datalen` is non-0.
31293  */
31294 void CVec_InboundHTLCDetailsZ_free(struct LDKCVec_InboundHTLCDetailsZ _res);
31295
31296 /**
31297  * Frees the buffer pointed to by `data` if `datalen` is non-0.
31298  */
31299 void CVec_OutboundHTLCDetailsZ_free(struct LDKCVec_OutboundHTLCDetailsZ _res);
31300
31301 /**
31302  * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
31303  */
31304 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
31305
31306 /**
31307  * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
31308  */
31309 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
31310
31311 /**
31312  * Checks if the given object is currently in the success state
31313  */
31314 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
31315
31316 /**
31317  * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
31318  */
31319 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
31320
31321 /**
31322  * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
31323  * but with all dynamically-allocated buffers duplicated in new buffers.
31324  */
31325 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
31326
31327 /**
31328  * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the success state.
31329  */
31330 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o);
31331
31332 /**
31333  * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the error state.
31334  */
31335 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e);
31336
31337 /**
31338  * Checks if the given object is currently in the success state
31339  */
31340 bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o);
31341
31342 /**
31343  * Frees any resources used by the CResult_ChannelShutdownStateDecodeErrorZ.
31344  */
31345 void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res);
31346
31347 /**
31348  * Creates a new CResult_ChannelShutdownStateDecodeErrorZ which has the same data as `orig`
31349  * but with all dynamically-allocated buffers duplicated in new buffers.
31350  */
31351 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig);
31352
31353 /**
31354  * Frees the buffer pointed to by `data` if `datalen` is non-0.
31355  */
31356 void CVec_FutureZ_free(struct LDKCVec_FutureZ _res);
31357
31358 /**
31359  * Creates a new CResult_OffersMessageDecodeErrorZ in the success state.
31360  */
31361 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o);
31362
31363 /**
31364  * Creates a new CResult_OffersMessageDecodeErrorZ in the error state.
31365  */
31366 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e);
31367
31368 /**
31369  * Checks if the given object is currently in the success state
31370  */
31371 bool CResult_OffersMessageDecodeErrorZ_is_ok(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR o);
31372
31373 /**
31374  * Frees any resources used by the CResult_OffersMessageDecodeErrorZ.
31375  */
31376 void CResult_OffersMessageDecodeErrorZ_free(struct LDKCResult_OffersMessageDecodeErrorZ _res);
31377
31378 /**
31379  * Creates a new CResult_OffersMessageDecodeErrorZ which has the same data as `orig`
31380  * but with all dynamically-allocated buffers duplicated in new buffers.
31381  */
31382 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_clone(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR orig);
31383
31384 /**
31385  * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
31386  */
31387 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
31388
31389 /**
31390  * Constructs a new COption_HTLCClaimZ containing nothing
31391  */
31392 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
31393
31394 /**
31395  * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
31396  */
31397 void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
31398
31399 /**
31400  * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
31401  */
31402 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
31403
31404 /**
31405  * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
31406  */
31407 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
31408
31409 /**
31410  * Checks if the given object is currently in the success state
31411  */
31412 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
31413
31414 /**
31415  * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
31416  */
31417 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
31418
31419 /**
31420  * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
31421  * but with all dynamically-allocated buffers duplicated in new buffers.
31422  */
31423 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
31424
31425 /**
31426  * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
31427  */
31428 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
31429
31430 /**
31431  * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
31432  */
31433 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
31434
31435 /**
31436  * Checks if the given object is currently in the success state
31437  */
31438 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
31439
31440 /**
31441  * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
31442  */
31443 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
31444
31445 /**
31446  * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
31447  * but with all dynamically-allocated buffers duplicated in new buffers.
31448  */
31449 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
31450
31451 /**
31452  * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
31453  */
31454 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
31455
31456 /**
31457  * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
31458  */
31459 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
31460
31461 /**
31462  * Checks if the given object is currently in the success state
31463  */
31464 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
31465
31466 /**
31467  * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
31468  */
31469 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
31470
31471 /**
31472  * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
31473  * but with all dynamically-allocated buffers duplicated in new buffers.
31474  */
31475 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
31476
31477 /**
31478  * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
31479  */
31480 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
31481
31482 /**
31483  * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
31484  */
31485 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
31486
31487 /**
31488  * Checks if the given object is currently in the success state
31489  */
31490 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
31491
31492 /**
31493  * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
31494  */
31495 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
31496
31497 /**
31498  * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
31499  * but with all dynamically-allocated buffers duplicated in new buffers.
31500  */
31501 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
31502
31503 /**
31504  * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
31505  */
31506 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
31507
31508 /**
31509  * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
31510  */
31511 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
31512
31513 /**
31514  * Checks if the given object is currently in the success state
31515  */
31516 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
31517
31518 /**
31519  * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
31520  */
31521 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
31522
31523 /**
31524  * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
31525  * but with all dynamically-allocated buffers duplicated in new buffers.
31526  */
31527 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
31528
31529 /**
31530  * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
31531  */
31532 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
31533
31534 /**
31535  * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
31536  */
31537 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
31538
31539 /**
31540  * Checks if the given object is currently in the success state
31541  */
31542 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
31543
31544 /**
31545  * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
31546  */
31547 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
31548
31549 /**
31550  * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
31551  * but with all dynamically-allocated buffers duplicated in new buffers.
31552  */
31553 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
31554
31555 /**
31556  * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
31557  */
31558 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
31559
31560 /**
31561  * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
31562  */
31563 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
31564
31565 /**
31566  * Checks if the given object is currently in the success state
31567  */
31568 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
31569
31570 /**
31571  * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
31572  */
31573 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
31574
31575 /**
31576  * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
31577  * but with all dynamically-allocated buffers duplicated in new buffers.
31578  */
31579 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
31580
31581 /**
31582  * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
31583  */
31584 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
31585
31586 /**
31587  * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
31588  */
31589 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
31590
31591 /**
31592  * Checks if the given object is currently in the success state
31593  */
31594 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
31595
31596 /**
31597  * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
31598  */
31599 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
31600
31601 /**
31602  * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
31603  * but with all dynamically-allocated buffers duplicated in new buffers.
31604  */
31605 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
31606
31607 /**
31608  * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
31609  */
31610 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
31611
31612 /**
31613  * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
31614  */
31615 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
31616
31617 /**
31618  * Checks if the given object is currently in the success state
31619  */
31620 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
31621
31622 /**
31623  * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
31624  */
31625 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
31626
31627 /**
31628  * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
31629  */
31630 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
31631
31632 /**
31633  * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
31634  */
31635 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
31636
31637 /**
31638  * Checks if the given object is currently in the success state
31639  */
31640 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
31641
31642 /**
31643  * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
31644  */
31645 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
31646
31647 /**
31648  * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
31649  * but with all dynamically-allocated buffers duplicated in new buffers.
31650  */
31651 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
31652
31653 /**
31654  * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
31655  */
31656 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
31657
31658 /**
31659  * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
31660  */
31661 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
31662
31663 /**
31664  * Checks if the given object is currently in the success state
31665  */
31666 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
31667
31668 /**
31669  * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
31670  */
31671 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
31672
31673 /**
31674  * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the success state.
31675  */
31676 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_ok(struct LDKCVec_ECDSASignatureZ o);
31677
31678 /**
31679  * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the error state.
31680  */
31681 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_err(void);
31682
31683 /**
31684  * Checks if the given object is currently in the success state
31685  */
31686 bool CResult_CVec_ECDSASignatureZNoneZ_is_ok(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR o);
31687
31688 /**
31689  * Frees any resources used by the CResult_CVec_ECDSASignatureZNoneZ.
31690  */
31691 void CResult_CVec_ECDSASignatureZNoneZ_free(struct LDKCResult_CVec_ECDSASignatureZNoneZ _res);
31692
31693 /**
31694  * Creates a new CResult_CVec_ECDSASignatureZNoneZ which has the same data as `orig`
31695  * but with all dynamically-allocated buffers duplicated in new buffers.
31696  */
31697 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_clone(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR orig);
31698
31699 /**
31700  * Constructs a new COption_usizeZ containing a usize
31701  */
31702 struct LDKCOption_usizeZ COption_usizeZ_some(uintptr_t o);
31703
31704 /**
31705  * Constructs a new COption_usizeZ containing nothing
31706  */
31707 struct LDKCOption_usizeZ COption_usizeZ_none(void);
31708
31709 /**
31710  * Frees any resources associated with the usize, if we are in the Some state
31711  */
31712 void COption_usizeZ_free(struct LDKCOption_usizeZ _res);
31713
31714 /**
31715  * Creates a new COption_usizeZ which has the same data as `orig`
31716  * but with all dynamically-allocated buffers duplicated in new buffers.
31717  */
31718 struct LDKCOption_usizeZ COption_usizeZ_clone(const struct LDKCOption_usizeZ *NONNULL_PTR orig);
31719
31720 /**
31721  * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
31722  */
31723 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
31724
31725 /**
31726  * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
31727  */
31728 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
31729
31730 /**
31731  * Checks if the given object is currently in the success state
31732  */
31733 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
31734
31735 /**
31736  * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
31737  */
31738 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
31739
31740 /**
31741  * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
31742  * but with all dynamically-allocated buffers duplicated in new buffers.
31743  */
31744 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
31745
31746 /**
31747  * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
31748  */
31749 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
31750
31751 /**
31752  * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
31753  */
31754 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
31755
31756 /**
31757  * Checks if the given object is currently in the success state
31758  */
31759 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
31760
31761 /**
31762  * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
31763  */
31764 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
31765
31766 /**
31767  * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
31768  * but with all dynamically-allocated buffers duplicated in new buffers.
31769  */
31770 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
31771
31772 /**
31773  * Frees the buffer pointed to by `data` if `datalen` is non-0.
31774  */
31775 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
31776
31777 /**
31778  * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
31779  */
31780 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
31781
31782 /**
31783  * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
31784  */
31785 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
31786
31787 /**
31788  * Checks if the given object is currently in the success state
31789  */
31790 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
31791
31792 /**
31793  * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
31794  */
31795 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
31796
31797 /**
31798  * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
31799  * but with all dynamically-allocated buffers duplicated in new buffers.
31800  */
31801 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
31802
31803 /**
31804  * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the success state.
31805  */
31806 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_ok(struct LDKClaimedHTLC o);
31807
31808 /**
31809  * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the error state.
31810  */
31811 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
31812
31813 /**
31814  * Checks if the given object is currently in the success state
31815  */
31816 bool CResult_ClaimedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR o);
31817
31818 /**
31819  * Frees any resources used by the CResult_ClaimedHTLCDecodeErrorZ.
31820  */
31821 void CResult_ClaimedHTLCDecodeErrorZ_free(struct LDKCResult_ClaimedHTLCDecodeErrorZ _res);
31822
31823 /**
31824  * Creates a new CResult_ClaimedHTLCDecodeErrorZ which has the same data as `orig`
31825  * but with all dynamically-allocated buffers duplicated in new buffers.
31826  */
31827 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_clone(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR orig);
31828
31829 /**
31830  * Constructs a new COption_PathFailureZ containing a crate::lightning::events::PathFailure
31831  */
31832 struct LDKCOption_PathFailureZ COption_PathFailureZ_some(struct LDKPathFailure o);
31833
31834 /**
31835  * Constructs a new COption_PathFailureZ containing nothing
31836  */
31837 struct LDKCOption_PathFailureZ COption_PathFailureZ_none(void);
31838
31839 /**
31840  * Frees any resources associated with the crate::lightning::events::PathFailure, if we are in the Some state
31841  */
31842 void COption_PathFailureZ_free(struct LDKCOption_PathFailureZ _res);
31843
31844 /**
31845  * Creates a new COption_PathFailureZ which has the same data as `orig`
31846  * but with all dynamically-allocated buffers duplicated in new buffers.
31847  */
31848 struct LDKCOption_PathFailureZ COption_PathFailureZ_clone(const struct LDKCOption_PathFailureZ *NONNULL_PTR orig);
31849
31850 /**
31851  * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the success state.
31852  */
31853 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_ok(struct LDKCOption_PathFailureZ o);
31854
31855 /**
31856  * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the error state.
31857  */
31858 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_err(struct LDKDecodeError e);
31859
31860 /**
31861  * Checks if the given object is currently in the success state
31862  */
31863 bool CResult_COption_PathFailureZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR o);
31864
31865 /**
31866  * Frees any resources used by the CResult_COption_PathFailureZDecodeErrorZ.
31867  */
31868 void CResult_COption_PathFailureZDecodeErrorZ_free(struct LDKCResult_COption_PathFailureZDecodeErrorZ _res);
31869
31870 /**
31871  * Creates a new CResult_COption_PathFailureZDecodeErrorZ which has the same data as `orig`
31872  * but with all dynamically-allocated buffers duplicated in new buffers.
31873  */
31874 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_clone(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR orig);
31875
31876 /**
31877  * Constructs a new COption_ClosureReasonZ containing a crate::lightning::events::ClosureReason
31878  */
31879 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
31880
31881 /**
31882  * Constructs a new COption_ClosureReasonZ containing nothing
31883  */
31884 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
31885
31886 /**
31887  * Frees any resources associated with the crate::lightning::events::ClosureReason, if we are in the Some state
31888  */
31889 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
31890
31891 /**
31892  * Creates a new COption_ClosureReasonZ which has the same data as `orig`
31893  * but with all dynamically-allocated buffers duplicated in new buffers.
31894  */
31895 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
31896
31897 /**
31898  * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
31899  */
31900 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
31901
31902 /**
31903  * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
31904  */
31905 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
31906
31907 /**
31908  * Checks if the given object is currently in the success state
31909  */
31910 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
31911
31912 /**
31913  * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
31914  */
31915 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
31916
31917 /**
31918  * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
31919  * but with all dynamically-allocated buffers duplicated in new buffers.
31920  */
31921 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
31922
31923 /**
31924  * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::events::HTLCDestination
31925  */
31926 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
31927
31928 /**
31929  * Constructs a new COption_HTLCDestinationZ containing nothing
31930  */
31931 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
31932
31933 /**
31934  * Frees any resources associated with the crate::lightning::events::HTLCDestination, if we are in the Some state
31935  */
31936 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
31937
31938 /**
31939  * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
31940  * but with all dynamically-allocated buffers duplicated in new buffers.
31941  */
31942 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
31943
31944 /**
31945  * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
31946  */
31947 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
31948
31949 /**
31950  * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
31951  */
31952 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
31953
31954 /**
31955  * Checks if the given object is currently in the success state
31956  */
31957 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
31958
31959 /**
31960  * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
31961  */
31962 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
31963
31964 /**
31965  * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
31966  * but with all dynamically-allocated buffers duplicated in new buffers.
31967  */
31968 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
31969
31970 /**
31971  * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the success state.
31972  */
31973 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_ok(enum LDKPaymentFailureReason o);
31974
31975 /**
31976  * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the error state.
31977  */
31978 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_err(struct LDKDecodeError e);
31979
31980 /**
31981  * Checks if the given object is currently in the success state
31982  */
31983 bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR o);
31984
31985 /**
31986  * Frees any resources used by the CResult_PaymentFailureReasonDecodeErrorZ.
31987  */
31988 void CResult_PaymentFailureReasonDecodeErrorZ_free(struct LDKCResult_PaymentFailureReasonDecodeErrorZ _res);
31989
31990 /**
31991  * Creates a new CResult_PaymentFailureReasonDecodeErrorZ which has the same data as `orig`
31992  * but with all dynamically-allocated buffers duplicated in new buffers.
31993  */
31994 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_clone(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR orig);
31995
31996 /**
31997  * Constructs a new COption_U128Z containing a crate::c_types::U128
31998  */
31999 struct LDKCOption_U128Z COption_U128Z_some(struct LDKU128 o);
32000
32001 /**
32002  * Constructs a new COption_U128Z containing nothing
32003  */
32004 struct LDKCOption_U128Z COption_U128Z_none(void);
32005
32006 /**
32007  * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
32008  */
32009 void COption_U128Z_free(struct LDKCOption_U128Z _res);
32010
32011 /**
32012  * Creates a new COption_U128Z which has the same data as `orig`
32013  * but with all dynamically-allocated buffers duplicated in new buffers.
32014  */
32015 struct LDKCOption_U128Z COption_U128Z_clone(const struct LDKCOption_U128Z *NONNULL_PTR orig);
32016
32017 /**
32018  * Frees the buffer pointed to by `data` if `datalen` is non-0.
32019  */
32020 void CVec_ClaimedHTLCZ_free(struct LDKCVec_ClaimedHTLCZ _res);
32021
32022 /**
32023  * Constructs a new COption_PaymentFailureReasonZ containing a crate::lightning::events::PaymentFailureReason
32024  */
32025 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o);
32026
32027 /**
32028  * Constructs a new COption_PaymentFailureReasonZ containing nothing
32029  */
32030 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void);
32031
32032 /**
32033  * Frees any resources associated with the crate::lightning::events::PaymentFailureReason, if we are in the Some state
32034  */
32035 void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res);
32036
32037 /**
32038  * Creates a new COption_PaymentFailureReasonZ which has the same data as `orig`
32039  * but with all dynamically-allocated buffers duplicated in new buffers.
32040  */
32041 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig);
32042
32043 /**
32044  * Constructs a new COption_EventZ containing a crate::lightning::events::Event
32045  */
32046 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
32047
32048 /**
32049  * Constructs a new COption_EventZ containing nothing
32050  */
32051 struct LDKCOption_EventZ COption_EventZ_none(void);
32052
32053 /**
32054  * Frees any resources associated with the crate::lightning::events::Event, if we are in the Some state
32055  */
32056 void COption_EventZ_free(struct LDKCOption_EventZ _res);
32057
32058 /**
32059  * Creates a new COption_EventZ which has the same data as `orig`
32060  * but with all dynamically-allocated buffers duplicated in new buffers.
32061  */
32062 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
32063
32064 /**
32065  * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
32066  */
32067 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
32068
32069 /**
32070  * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
32071  */
32072 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
32073
32074 /**
32075  * Checks if the given object is currently in the success state
32076  */
32077 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
32078
32079 /**
32080  * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
32081  */
32082 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
32083
32084 /**
32085  * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
32086  * but with all dynamically-allocated buffers duplicated in new buffers.
32087  */
32088 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
32089
32090 /**
32091  * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the success state.
32092  */
32093 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_ok(enum LDKSiPrefix o);
32094
32095 /**
32096  * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the error state.
32097  */
32098 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
32099
32100 /**
32101  * Checks if the given object is currently in the success state
32102  */
32103 bool CResult_SiPrefixBolt11ParseErrorZ_is_ok(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR o);
32104
32105 /**
32106  * Frees any resources used by the CResult_SiPrefixBolt11ParseErrorZ.
32107  */
32108 void CResult_SiPrefixBolt11ParseErrorZ_free(struct LDKCResult_SiPrefixBolt11ParseErrorZ _res);
32109
32110 /**
32111  * Creates a new CResult_SiPrefixBolt11ParseErrorZ which has the same data as `orig`
32112  * but with all dynamically-allocated buffers duplicated in new buffers.
32113  */
32114 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_clone(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR orig);
32115
32116 /**
32117  * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the success state.
32118  */
32119 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(struct LDKBolt11Invoice o);
32120
32121 /**
32122  * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the error state.
32123  */
32124 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
32125
32126 /**
32127  * Checks if the given object is currently in the success state
32128  */
32129 bool CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
32130
32131 /**
32132  * Frees any resources used by the CResult_Bolt11InvoiceParseOrSemanticErrorZ.
32133  */
32134 void CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res);
32135
32136 /**
32137  * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ which has the same data as `orig`
32138  * but with all dynamically-allocated buffers duplicated in new buffers.
32139  */
32140 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
32141
32142 /**
32143  * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the success state.
32144  */
32145 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(struct LDKSignedRawBolt11Invoice o);
32146
32147 /**
32148  * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the error state.
32149  */
32150 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
32151
32152 /**
32153  * Checks if the given object is currently in the success state
32154  */
32155 bool CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR o);
32156
32157 /**
32158  * Frees any resources used by the CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ.
32159  */
32160 void CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res);
32161
32162 /**
32163  * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ which has the same data as `orig`
32164  * but with all dynamically-allocated buffers duplicated in new buffers.
32165  */
32166 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR orig);
32167
32168 /**
32169  * Creates a new tuple which has the same data as `orig`
32170  * but with all dynamically-allocated buffers duplicated in new buffers.
32171  */
32172 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR orig);
32173
32174 /**
32175  * Creates a new C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ from the contained elements.
32176  */
32177 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(struct LDKRawBolt11Invoice a, struct LDKThirtyTwoBytes b, struct LDKBolt11InvoiceSignature c);
32178
32179 /**
32180  * Frees any resources used by the C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.
32181  */
32182 void C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res);
32183
32184 /**
32185  * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the success state.
32186  */
32187 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_ok(struct LDKPayeePubKey o);
32188
32189 /**
32190  * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the error state.
32191  */
32192 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
32193
32194 /**
32195  * Checks if the given object is currently in the success state
32196  */
32197 bool CResult_PayeePubKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR o);
32198
32199 /**
32200  * Frees any resources used by the CResult_PayeePubKeySecp256k1ErrorZ.
32201  */
32202 void CResult_PayeePubKeySecp256k1ErrorZ_free(struct LDKCResult_PayeePubKeySecp256k1ErrorZ _res);
32203
32204 /**
32205  * Creates a new CResult_PayeePubKeySecp256k1ErrorZ which has the same data as `orig`
32206  * but with all dynamically-allocated buffers duplicated in new buffers.
32207  */
32208 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_clone(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR orig);
32209
32210 /**
32211  * Frees the buffer pointed to by `data` if `datalen` is non-0.
32212  */
32213 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
32214
32215 /**
32216  * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
32217  */
32218 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
32219
32220 /**
32221  * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
32222  */
32223 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
32224
32225 /**
32226  * Checks if the given object is currently in the success state
32227  */
32228 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
32229
32230 /**
32231  * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
32232  */
32233 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
32234
32235 /**
32236  * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
32237  * but with all dynamically-allocated buffers duplicated in new buffers.
32238  */
32239 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
32240
32241 /**
32242  * Creates a new CResult_NoneBolt11SemanticErrorZ in the success state.
32243  */
32244 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_ok(void);
32245
32246 /**
32247  * Creates a new CResult_NoneBolt11SemanticErrorZ in the error state.
32248  */
32249 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
32250
32251 /**
32252  * Checks if the given object is currently in the success state
32253  */
32254 bool CResult_NoneBolt11SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR o);
32255
32256 /**
32257  * Frees any resources used by the CResult_NoneBolt11SemanticErrorZ.
32258  */
32259 void CResult_NoneBolt11SemanticErrorZ_free(struct LDKCResult_NoneBolt11SemanticErrorZ _res);
32260
32261 /**
32262  * Creates a new CResult_NoneBolt11SemanticErrorZ which has the same data as `orig`
32263  * but with all dynamically-allocated buffers duplicated in new buffers.
32264  */
32265 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_clone(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR orig);
32266
32267 /**
32268  * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the success state.
32269  */
32270 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(struct LDKBolt11Invoice o);
32271
32272 /**
32273  * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the error state.
32274  */
32275 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
32276
32277 /**
32278  * Checks if the given object is currently in the success state
32279  */
32280 bool CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR o);
32281
32282 /**
32283  * Frees any resources used by the CResult_Bolt11InvoiceBolt11SemanticErrorZ.
32284  */
32285 void CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res);
32286
32287 /**
32288  * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ which has the same data as `orig`
32289  * but with all dynamically-allocated buffers duplicated in new buffers.
32290  */
32291 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR orig);
32292
32293 /**
32294  * Creates a new CResult_DescriptionCreationErrorZ in the success state.
32295  */
32296 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
32297
32298 /**
32299  * Creates a new CResult_DescriptionCreationErrorZ in the error state.
32300  */
32301 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
32302
32303 /**
32304  * Checks if the given object is currently in the success state
32305  */
32306 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
32307
32308 /**
32309  * Frees any resources used by the CResult_DescriptionCreationErrorZ.
32310  */
32311 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
32312
32313 /**
32314  * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
32315  * but with all dynamically-allocated buffers duplicated in new buffers.
32316  */
32317 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
32318
32319 /**
32320  * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
32321  */
32322 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
32323
32324 /**
32325  * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
32326  */
32327 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
32328
32329 /**
32330  * Checks if the given object is currently in the success state
32331  */
32332 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
32333
32334 /**
32335  * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
32336  */
32337 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
32338
32339 /**
32340  * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
32341  * but with all dynamically-allocated buffers duplicated in new buffers.
32342  */
32343 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
32344
32345 /**
32346  * Creates a new CResult_OutPointDecodeErrorZ in the success state.
32347  */
32348 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
32349
32350 /**
32351  * Creates a new CResult_OutPointDecodeErrorZ in the error state.
32352  */
32353 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
32354
32355 /**
32356  * Checks if the given object is currently in the success state
32357  */
32358 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
32359
32360 /**
32361  * Frees any resources used by the CResult_OutPointDecodeErrorZ.
32362  */
32363 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
32364
32365 /**
32366  * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
32367  * but with all dynamically-allocated buffers duplicated in new buffers.
32368  */
32369 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
32370
32371 /**
32372  * Creates a new CResult_BigSizeDecodeErrorZ in the success state.
32373  */
32374 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_ok(struct LDKBigSize o);
32375
32376 /**
32377  * Creates a new CResult_BigSizeDecodeErrorZ in the error state.
32378  */
32379 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_err(struct LDKDecodeError e);
32380
32381 /**
32382  * Checks if the given object is currently in the success state
32383  */
32384 bool CResult_BigSizeDecodeErrorZ_is_ok(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR o);
32385
32386 /**
32387  * Frees any resources used by the CResult_BigSizeDecodeErrorZ.
32388  */
32389 void CResult_BigSizeDecodeErrorZ_free(struct LDKCResult_BigSizeDecodeErrorZ _res);
32390
32391 /**
32392  * Creates a new CResult_BigSizeDecodeErrorZ which has the same data as `orig`
32393  * but with all dynamically-allocated buffers duplicated in new buffers.
32394  */
32395 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_clone(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR orig);
32396
32397 /**
32398  * Creates a new CResult_HostnameDecodeErrorZ in the success state.
32399  */
32400 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_ok(struct LDKHostname o);
32401
32402 /**
32403  * Creates a new CResult_HostnameDecodeErrorZ in the error state.
32404  */
32405 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_err(struct LDKDecodeError e);
32406
32407 /**
32408  * Checks if the given object is currently in the success state
32409  */
32410 bool CResult_HostnameDecodeErrorZ_is_ok(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR o);
32411
32412 /**
32413  * Frees any resources used by the CResult_HostnameDecodeErrorZ.
32414  */
32415 void CResult_HostnameDecodeErrorZ_free(struct LDKCResult_HostnameDecodeErrorZ _res);
32416
32417 /**
32418  * Creates a new CResult_HostnameDecodeErrorZ which has the same data as `orig`
32419  * but with all dynamically-allocated buffers duplicated in new buffers.
32420  */
32421 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_clone(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR orig);
32422
32423 /**
32424  * Creates a new CResult_TransactionU16LenLimitedNoneZ in the success state.
32425  */
32426 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_ok(struct LDKTransactionU16LenLimited o);
32427
32428 /**
32429  * Creates a new CResult_TransactionU16LenLimitedNoneZ in the error state.
32430  */
32431 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_err(void);
32432
32433 /**
32434  * Checks if the given object is currently in the success state
32435  */
32436 bool CResult_TransactionU16LenLimitedNoneZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR o);
32437
32438 /**
32439  * Frees any resources used by the CResult_TransactionU16LenLimitedNoneZ.
32440  */
32441 void CResult_TransactionU16LenLimitedNoneZ_free(struct LDKCResult_TransactionU16LenLimitedNoneZ _res);
32442
32443 /**
32444  * Creates a new CResult_TransactionU16LenLimitedNoneZ which has the same data as `orig`
32445  * but with all dynamically-allocated buffers duplicated in new buffers.
32446  */
32447 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_clone(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR orig);
32448
32449 /**
32450  * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the success state.
32451  */
32452 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_ok(struct LDKTransactionU16LenLimited o);
32453
32454 /**
32455  * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the error state.
32456  */
32457 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_err(struct LDKDecodeError e);
32458
32459 /**
32460  * Checks if the given object is currently in the success state
32461  */
32462 bool CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR o);
32463
32464 /**
32465  * Frees any resources used by the CResult_TransactionU16LenLimitedDecodeErrorZ.
32466  */
32467 void CResult_TransactionU16LenLimitedDecodeErrorZ_free(struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res);
32468
32469 /**
32470  * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ which has the same data as `orig`
32471  * but with all dynamically-allocated buffers duplicated in new buffers.
32472  */
32473 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_clone(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR orig);
32474
32475 /**
32476  * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state.
32477  */
32478 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o);
32479
32480 /**
32481  * Creates a new CResult_UntrustedStringDecodeErrorZ in the error state.
32482  */
32483 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e);
32484
32485 /**
32486  * Checks if the given object is currently in the success state
32487  */
32488 bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o);
32489
32490 /**
32491  * Frees any resources used by the CResult_UntrustedStringDecodeErrorZ.
32492  */
32493 void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res);
32494
32495 /**
32496  * Creates a new CResult_UntrustedStringDecodeErrorZ which has the same data as `orig`
32497  * but with all dynamically-allocated buffers duplicated in new buffers.
32498  */
32499 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig);
32500
32501 /**
32502  * Creates a new CResult_ChannelIdDecodeErrorZ in the success state.
32503  */
32504 struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_ok(struct LDKChannelId o);
32505
32506 /**
32507  * Creates a new CResult_ChannelIdDecodeErrorZ in the error state.
32508  */
32509 struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_err(struct LDKDecodeError e);
32510
32511 /**
32512  * Checks if the given object is currently in the success state
32513  */
32514 bool CResult_ChannelIdDecodeErrorZ_is_ok(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR o);
32515
32516 /**
32517  * Frees any resources used by the CResult_ChannelIdDecodeErrorZ.
32518  */
32519 void CResult_ChannelIdDecodeErrorZ_free(struct LDKCResult_ChannelIdDecodeErrorZ _res);
32520
32521 /**
32522  * Creates a new CResult_ChannelIdDecodeErrorZ which has the same data as `orig`
32523  * but with all dynamically-allocated buffers duplicated in new buffers.
32524  */
32525 struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_clone(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR orig);
32526
32527 /**
32528  * Creates a new tuple which has the same data as `orig`
32529  * but with all dynamically-allocated buffers duplicated in new buffers.
32530  */
32531 struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_clone(const struct LDKC2Tuple__u832u16Z *NONNULL_PTR orig);
32532
32533 /**
32534  * Creates a new C2Tuple__u832u16Z from the contained elements.
32535  */
32536 struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_new(struct LDKThirtyTwoBytes a, uint16_t b);
32537
32538 /**
32539  * Frees any resources used by the C2Tuple__u832u16Z.
32540  */
32541 void C2Tuple__u832u16Z_free(struct LDKC2Tuple__u832u16Z _res);
32542
32543 /**
32544  * Creates a new CResult_PaymentRelayDecodeErrorZ in the success state.
32545  */
32546 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_ok(struct LDKPaymentRelay o);
32547
32548 /**
32549  * Creates a new CResult_PaymentRelayDecodeErrorZ in the error state.
32550  */
32551 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_err(struct LDKDecodeError e);
32552
32553 /**
32554  * Checks if the given object is currently in the success state
32555  */
32556 bool CResult_PaymentRelayDecodeErrorZ_is_ok(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR o);
32557
32558 /**
32559  * Frees any resources used by the CResult_PaymentRelayDecodeErrorZ.
32560  */
32561 void CResult_PaymentRelayDecodeErrorZ_free(struct LDKCResult_PaymentRelayDecodeErrorZ _res);
32562
32563 /**
32564  * Creates a new CResult_PaymentRelayDecodeErrorZ which has the same data as `orig`
32565  * but with all dynamically-allocated buffers duplicated in new buffers.
32566  */
32567 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_clone(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR orig);
32568
32569 /**
32570  * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the success state.
32571  */
32572 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_ok(struct LDKPaymentConstraints o);
32573
32574 /**
32575  * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the error state.
32576  */
32577 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_err(struct LDKDecodeError e);
32578
32579 /**
32580  * Checks if the given object is currently in the success state
32581  */
32582 bool CResult_PaymentConstraintsDecodeErrorZ_is_ok(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR o);
32583
32584 /**
32585  * Frees any resources used by the CResult_PaymentConstraintsDecodeErrorZ.
32586  */
32587 void CResult_PaymentConstraintsDecodeErrorZ_free(struct LDKCResult_PaymentConstraintsDecodeErrorZ _res);
32588
32589 /**
32590  * Creates a new CResult_PaymentConstraintsDecodeErrorZ which has the same data as `orig`
32591  * but with all dynamically-allocated buffers duplicated in new buffers.
32592  */
32593 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_clone(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR orig);
32594
32595 /**
32596  * Creates a new CResult_PaymentContextDecodeErrorZ in the success state.
32597  */
32598 struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_ok(struct LDKPaymentContext o);
32599
32600 /**
32601  * Creates a new CResult_PaymentContextDecodeErrorZ in the error state.
32602  */
32603 struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_err(struct LDKDecodeError e);
32604
32605 /**
32606  * Checks if the given object is currently in the success state
32607  */
32608 bool CResult_PaymentContextDecodeErrorZ_is_ok(const struct LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR o);
32609
32610 /**
32611  * Frees any resources used by the CResult_PaymentContextDecodeErrorZ.
32612  */
32613 void CResult_PaymentContextDecodeErrorZ_free(struct LDKCResult_PaymentContextDecodeErrorZ _res);
32614
32615 /**
32616  * Creates a new CResult_PaymentContextDecodeErrorZ which has the same data as `orig`
32617  * but with all dynamically-allocated buffers duplicated in new buffers.
32618  */
32619 struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_clone(const struct LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR orig);
32620
32621 /**
32622  * Creates a new CResult_UnknownPaymentContextDecodeErrorZ in the success state.
32623  */
32624 struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_ok(struct LDKUnknownPaymentContext o);
32625
32626 /**
32627  * Creates a new CResult_UnknownPaymentContextDecodeErrorZ in the error state.
32628  */
32629 struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_err(struct LDKDecodeError e);
32630
32631 /**
32632  * Checks if the given object is currently in the success state
32633  */
32634 bool CResult_UnknownPaymentContextDecodeErrorZ_is_ok(const struct LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR o);
32635
32636 /**
32637  * Frees any resources used by the CResult_UnknownPaymentContextDecodeErrorZ.
32638  */
32639 void CResult_UnknownPaymentContextDecodeErrorZ_free(struct LDKCResult_UnknownPaymentContextDecodeErrorZ _res);
32640
32641 /**
32642  * Creates a new CResult_UnknownPaymentContextDecodeErrorZ which has the same data as `orig`
32643  * but with all dynamically-allocated buffers duplicated in new buffers.
32644  */
32645 struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_clone(const struct LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR orig);
32646
32647 /**
32648  * Creates a new CResult_Bolt12OfferContextDecodeErrorZ in the success state.
32649  */
32650 struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_ok(struct LDKBolt12OfferContext o);
32651
32652 /**
32653  * Creates a new CResult_Bolt12OfferContextDecodeErrorZ in the error state.
32654  */
32655 struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_err(struct LDKDecodeError e);
32656
32657 /**
32658  * Checks if the given object is currently in the success state
32659  */
32660 bool CResult_Bolt12OfferContextDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR o);
32661
32662 /**
32663  * Frees any resources used by the CResult_Bolt12OfferContextDecodeErrorZ.
32664  */
32665 void CResult_Bolt12OfferContextDecodeErrorZ_free(struct LDKCResult_Bolt12OfferContextDecodeErrorZ _res);
32666
32667 /**
32668  * Creates a new CResult_Bolt12OfferContextDecodeErrorZ which has the same data as `orig`
32669  * but with all dynamically-allocated buffers duplicated in new buffers.
32670  */
32671 struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_clone(const struct LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR orig);
32672
32673 /**
32674  * Creates a new CResult_Bolt12RefundContextDecodeErrorZ in the success state.
32675  */
32676 struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_ok(struct LDKBolt12RefundContext o);
32677
32678 /**
32679  * Creates a new CResult_Bolt12RefundContextDecodeErrorZ in the error state.
32680  */
32681 struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_err(struct LDKDecodeError e);
32682
32683 /**
32684  * Checks if the given object is currently in the success state
32685  */
32686 bool CResult_Bolt12RefundContextDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR o);
32687
32688 /**
32689  * Frees any resources used by the CResult_Bolt12RefundContextDecodeErrorZ.
32690  */
32691 void CResult_Bolt12RefundContextDecodeErrorZ_free(struct LDKCResult_Bolt12RefundContextDecodeErrorZ _res);
32692
32693 /**
32694  * Creates a new CResult_Bolt12RefundContextDecodeErrorZ which has the same data as `orig`
32695  * but with all dynamically-allocated buffers duplicated in new buffers.
32696  */
32697 struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_clone(const struct LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR orig);
32698
32699 /**
32700  * Creates a new CResult_StrSecp256k1ErrorZ in the success state.
32701  */
32702 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_ok(struct LDKStr o);
32703
32704 /**
32705  * Creates a new CResult_StrSecp256k1ErrorZ in the error state.
32706  */
32707 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
32708
32709 /**
32710  * Checks if the given object is currently in the success state
32711  */
32712 bool CResult_StrSecp256k1ErrorZ_is_ok(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR o);
32713
32714 /**
32715  * Frees any resources used by the CResult_StrSecp256k1ErrorZ.
32716  */
32717 void CResult_StrSecp256k1ErrorZ_free(struct LDKCResult_StrSecp256k1ErrorZ _res);
32718
32719 /**
32720  * Creates a new CResult_StrSecp256k1ErrorZ which has the same data as `orig`
32721  * but with all dynamically-allocated buffers duplicated in new buffers.
32722  */
32723 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_clone(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR orig);
32724
32725 /**
32726  * Creates a new tuple which has the same data as `orig`
32727  * but with all dynamically-allocated buffers duplicated in new buffers.
32728  */
32729 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR orig);
32730
32731 /**
32732  * Creates a new C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ from the contained elements.
32733  */
32734 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(struct LDKThirtyTwoBytes a, struct LDKRecipientOnionFields b, struct LDKRouteParameters c);
32735
32736 /**
32737  * Frees any resources used by the C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.
32738  */
32739 void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res);
32740
32741 /**
32742  * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the success state.
32743  */
32744 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o);
32745
32746 /**
32747  * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the error state.
32748  */
32749 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(void);
32750
32751 /**
32752  * Checks if the given object is currently in the success state
32753  */
32754 bool CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR o);
32755
32756 /**
32757  * Frees any resources used by the CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ.
32758  */
32759 void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res);
32760
32761 /**
32762  * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ which has the same data as `orig`
32763  * but with all dynamically-allocated buffers duplicated in new buffers.
32764  */
32765 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR orig);
32766
32767 /**
32768  * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state.
32769  */
32770 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o);
32771
32772 /**
32773  * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state.
32774  */
32775 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e);
32776
32777 /**
32778  * Checks if the given object is currently in the success state
32779  */
32780 bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o);
32781
32782 /**
32783  * Frees any resources used by the CResult_TxOutUtxoLookupErrorZ.
32784  */
32785 void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res);
32786
32787 /**
32788  * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig`
32789  * but with all dynamically-allocated buffers duplicated in new buffers.
32790  */
32791 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig);
32792
32793 /**
32794  * Creates a new tuple which has the same data as `orig`
32795  * but with all dynamically-allocated buffers duplicated in new buffers.
32796  */
32797 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(const struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR orig);
32798
32799 /**
32800  * Creates a new C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ from the contained elements.
32801  */
32802 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(struct LDKPublicKey a, struct LDKOnionMessage b, struct LDKCOption_CVec_SocketAddressZZ c);
32803
32804 /**
32805  * Frees any resources used by the C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ.
32806  */
32807 void C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ _res);
32808
32809 /**
32810  * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ in the success state.
32811  */
32812 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ o);
32813
32814 /**
32815  * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ in the error state.
32816  */
32817 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(struct LDKSendError e);
32818
32819 /**
32820  * Checks if the given object is currently in the success state
32821  */
32822 bool CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(const struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR o);
32823
32824 /**
32825  * Frees any resources used by the CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.
32826  */
32827 void CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ _res);
32828
32829 /**
32830  * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ which has the same data as `orig`
32831  * but with all dynamically-allocated buffers duplicated in new buffers.
32832  */
32833 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(const struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR orig);
32834
32835 /**
32836  * Creates a new CResult_PeeledOnionNoneZ in the success state.
32837  */
32838 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_ok(struct LDKPeeledOnion o);
32839
32840 /**
32841  * Creates a new CResult_PeeledOnionNoneZ in the error state.
32842  */
32843 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_err(void);
32844
32845 /**
32846  * Checks if the given object is currently in the success state
32847  */
32848 bool CResult_PeeledOnionNoneZ_is_ok(const struct LDKCResult_PeeledOnionNoneZ *NONNULL_PTR o);
32849
32850 /**
32851  * Frees any resources used by the CResult_PeeledOnionNoneZ.
32852  */
32853 void CResult_PeeledOnionNoneZ_free(struct LDKCResult_PeeledOnionNoneZ _res);
32854
32855 /**
32856  * Creates a new CResult_PeeledOnionNoneZ which has the same data as `orig`
32857  * but with all dynamically-allocated buffers duplicated in new buffers.
32858  */
32859 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_clone(const struct LDKCResult_PeeledOnionNoneZ *NONNULL_PTR orig);
32860
32861 /**
32862  * Creates a new CResult_SendSuccessSendErrorZ in the success state.
32863  */
32864 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_ok(struct LDKSendSuccess o);
32865
32866 /**
32867  * Creates a new CResult_SendSuccessSendErrorZ in the error state.
32868  */
32869 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_err(struct LDKSendError e);
32870
32871 /**
32872  * Checks if the given object is currently in the success state
32873  */
32874 bool CResult_SendSuccessSendErrorZ_is_ok(const struct LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR o);
32875
32876 /**
32877  * Frees any resources used by the CResult_SendSuccessSendErrorZ.
32878  */
32879 void CResult_SendSuccessSendErrorZ_free(struct LDKCResult_SendSuccessSendErrorZ _res);
32880
32881 /**
32882  * Creates a new CResult_SendSuccessSendErrorZ which has the same data as `orig`
32883  * but with all dynamically-allocated buffers duplicated in new buffers.
32884  */
32885 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_clone(const struct LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR orig);
32886
32887 /**
32888  * Creates a new CResult_BlindedPathNoneZ in the success state.
32889  */
32890 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o);
32891
32892 /**
32893  * Creates a new CResult_BlindedPathNoneZ in the error state.
32894  */
32895 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void);
32896
32897 /**
32898  * Checks if the given object is currently in the success state
32899  */
32900 bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o);
32901
32902 /**
32903  * Frees any resources used by the CResult_BlindedPathNoneZ.
32904  */
32905 void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res);
32906
32907 /**
32908  * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig`
32909  * but with all dynamically-allocated buffers duplicated in new buffers.
32910  */
32911 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig);
32912
32913 /**
32914  * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the success state.
32915  */
32916 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ o);
32917
32918 /**
32919  * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the error state.
32920  */
32921 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(void);
32922
32923 /**
32924  * Checks if the given object is currently in the success state
32925  */
32926 bool CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR o);
32927
32928 /**
32929  * Frees any resources used by the CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.
32930  */
32931 void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res);
32932
32933 /**
32934  * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ which has the same data as `orig`
32935  * but with all dynamically-allocated buffers duplicated in new buffers.
32936  */
32937 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR orig);
32938
32939 /**
32940  * Frees the buffer pointed to by `data` if `datalen` is non-0.
32941  */
32942 void CVec_ForwardNodeZ_free(struct LDKCVec_ForwardNodeZ _res);
32943
32944 /**
32945  * Creates a new CResult_BlindedPathDecodeErrorZ in the success state.
32946  */
32947 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o);
32948
32949 /**
32950  * Creates a new CResult_BlindedPathDecodeErrorZ in the error state.
32951  */
32952 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e);
32953
32954 /**
32955  * Checks if the given object is currently in the success state
32956  */
32957 bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o);
32958
32959 /**
32960  * Frees any resources used by the CResult_BlindedPathDecodeErrorZ.
32961  */
32962 void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res);
32963
32964 /**
32965  * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig`
32966  * but with all dynamically-allocated buffers duplicated in new buffers.
32967  */
32968 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig);
32969
32970 /**
32971  * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
32972  */
32973 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
32974
32975 /**
32976  * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
32977  */
32978 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
32979
32980 /**
32981  * Checks if the given object is currently in the success state
32982  */
32983 bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
32984
32985 /**
32986  * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
32987  */
32988 void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
32989
32990 /**
32991  * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
32992  * but with all dynamically-allocated buffers duplicated in new buffers.
32993  */
32994 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
32995
32996 /**
32997  * Creates a new CResult_InvoiceErrorDecodeErrorZ in the success state.
32998  */
32999 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_ok(struct LDKInvoiceError o);
33000
33001 /**
33002  * Creates a new CResult_InvoiceErrorDecodeErrorZ in the error state.
33003  */
33004 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_err(struct LDKDecodeError e);
33005
33006 /**
33007  * Checks if the given object is currently in the success state
33008  */
33009 bool CResult_InvoiceErrorDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR o);
33010
33011 /**
33012  * Frees any resources used by the CResult_InvoiceErrorDecodeErrorZ.
33013  */
33014 void CResult_InvoiceErrorDecodeErrorZ_free(struct LDKCResult_InvoiceErrorDecodeErrorZ _res);
33015
33016 /**
33017  * Creates a new CResult_InvoiceErrorDecodeErrorZ which has the same data as `orig`
33018  * but with all dynamically-allocated buffers duplicated in new buffers.
33019  */
33020 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_clone(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR orig);
33021
33022 /**
33023  * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ in the success state.
33024  */
33025 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_ok(struct LDKTrackedSpendableOutput o);
33026
33027 /**
33028  * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ in the error state.
33029  */
33030 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_err(struct LDKDecodeError e);
33031
33032 /**
33033  * Checks if the given object is currently in the success state
33034  */
33035 bool CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(const struct LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR o);
33036
33037 /**
33038  * Frees any resources used by the CResult_TrackedSpendableOutputDecodeErrorZ.
33039  */
33040 void CResult_TrackedSpendableOutputDecodeErrorZ_free(struct LDKCResult_TrackedSpendableOutputDecodeErrorZ _res);
33041
33042 /**
33043  * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ which has the same data as `orig`
33044  * but with all dynamically-allocated buffers duplicated in new buffers.
33045  */
33046 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_clone(const struct LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR orig);
33047
33048 /**
33049  * Creates a new CResult_OutputSpendStatusDecodeErrorZ in the success state.
33050  */
33051 struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_ok(struct LDKOutputSpendStatus o);
33052
33053 /**
33054  * Creates a new CResult_OutputSpendStatusDecodeErrorZ in the error state.
33055  */
33056 struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_err(struct LDKDecodeError e);
33057
33058 /**
33059  * Checks if the given object is currently in the success state
33060  */
33061 bool CResult_OutputSpendStatusDecodeErrorZ_is_ok(const struct LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR o);
33062
33063 /**
33064  * Frees any resources used by the CResult_OutputSpendStatusDecodeErrorZ.
33065  */
33066 void CResult_OutputSpendStatusDecodeErrorZ_free(struct LDKCResult_OutputSpendStatusDecodeErrorZ _res);
33067
33068 /**
33069  * Creates a new CResult_OutputSpendStatusDecodeErrorZ which has the same data as `orig`
33070  * but with all dynamically-allocated buffers duplicated in new buffers.
33071  */
33072 struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_clone(const struct LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR orig);
33073
33074 /**
33075  * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
33076  */
33077 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
33078
33079 /**
33080  * Constructs a new COption_FilterZ containing nothing
33081  */
33082 struct LDKCOption_FilterZ COption_FilterZ_none(void);
33083
33084 /**
33085  * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
33086  */
33087 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
33088
33089 /**
33090  * Frees the buffer pointed to by `data` if `datalen` is non-0.
33091  */
33092 void CVec_TrackedSpendableOutputZ_free(struct LDKCVec_TrackedSpendableOutputZ _res);
33093
33094 /**
33095  * Creates a new CResult_OutputSweeperDecodeErrorZ in the success state.
33096  */
33097 struct LDKCResult_OutputSweeperDecodeErrorZ CResult_OutputSweeperDecodeErrorZ_ok(struct LDKOutputSweeper o);
33098
33099 /**
33100  * Creates a new CResult_OutputSweeperDecodeErrorZ in the error state.
33101  */
33102 struct LDKCResult_OutputSweeperDecodeErrorZ CResult_OutputSweeperDecodeErrorZ_err(struct LDKDecodeError e);
33103
33104 /**
33105  * Checks if the given object is currently in the success state
33106  */
33107 bool CResult_OutputSweeperDecodeErrorZ_is_ok(const struct LDKCResult_OutputSweeperDecodeErrorZ *NONNULL_PTR o);
33108
33109 /**
33110  * Frees any resources used by the CResult_OutputSweeperDecodeErrorZ.
33111  */
33112 void CResult_OutputSweeperDecodeErrorZ_free(struct LDKCResult_OutputSweeperDecodeErrorZ _res);
33113
33114 /**
33115  * Creates a new C2Tuple_BestBlockOutputSweeperZ from the contained elements.
33116  */
33117 struct LDKC2Tuple_BestBlockOutputSweeperZ C2Tuple_BestBlockOutputSweeperZ_new(struct LDKBestBlock a, struct LDKOutputSweeper b);
33118
33119 /**
33120  * Frees any resources used by the C2Tuple_BestBlockOutputSweeperZ.
33121  */
33122 void C2Tuple_BestBlockOutputSweeperZ_free(struct LDKC2Tuple_BestBlockOutputSweeperZ _res);
33123
33124 /**
33125  * Creates a new CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ in the success state.
33126  */
33127 struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(struct LDKC2Tuple_BestBlockOutputSweeperZ o);
33128
33129 /**
33130  * Creates a new CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ in the error state.
33131  */
33132 struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(struct LDKDecodeError e);
33133
33134 /**
33135  * Checks if the given object is currently in the success state
33136  */
33137 bool CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ *NONNULL_PTR o);
33138
33139 /**
33140  * Frees any resources used by the CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.
33141  */
33142 void CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ _res);
33143
33144 /**
33145  * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ in the success state.
33146  */
33147 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_ok(struct LDKDelayedPaymentBasepoint o);
33148
33149 /**
33150  * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ in the error state.
33151  */
33152 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_err(struct LDKDecodeError e);
33153
33154 /**
33155  * Checks if the given object is currently in the success state
33156  */
33157 bool CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR o);
33158
33159 /**
33160  * Frees any resources used by the CResult_DelayedPaymentBasepointDecodeErrorZ.
33161  */
33162 void CResult_DelayedPaymentBasepointDecodeErrorZ_free(struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ _res);
33163
33164 /**
33165  * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ which has the same data as `orig`
33166  * but with all dynamically-allocated buffers duplicated in new buffers.
33167  */
33168 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR orig);
33169
33170 /**
33171  * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ in the success state.
33172  */
33173 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_ok(struct LDKDelayedPaymentKey o);
33174
33175 /**
33176  * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ in the error state.
33177  */
33178 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_err(struct LDKDecodeError e);
33179
33180 /**
33181  * Checks if the given object is currently in the success state
33182  */
33183 bool CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR o);
33184
33185 /**
33186  * Frees any resources used by the CResult_DelayedPaymentKeyDecodeErrorZ.
33187  */
33188 void CResult_DelayedPaymentKeyDecodeErrorZ_free(struct LDKCResult_DelayedPaymentKeyDecodeErrorZ _res);
33189
33190 /**
33191  * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ which has the same data as `orig`
33192  * but with all dynamically-allocated buffers duplicated in new buffers.
33193  */
33194 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR orig);
33195
33196 /**
33197  * Creates a new CResult_HtlcBasepointDecodeErrorZ in the success state.
33198  */
33199 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_ok(struct LDKHtlcBasepoint o);
33200
33201 /**
33202  * Creates a new CResult_HtlcBasepointDecodeErrorZ in the error state.
33203  */
33204 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_err(struct LDKDecodeError e);
33205
33206 /**
33207  * Checks if the given object is currently in the success state
33208  */
33209 bool CResult_HtlcBasepointDecodeErrorZ_is_ok(const struct LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR o);
33210
33211 /**
33212  * Frees any resources used by the CResult_HtlcBasepointDecodeErrorZ.
33213  */
33214 void CResult_HtlcBasepointDecodeErrorZ_free(struct LDKCResult_HtlcBasepointDecodeErrorZ _res);
33215
33216 /**
33217  * Creates a new CResult_HtlcBasepointDecodeErrorZ which has the same data as `orig`
33218  * but with all dynamically-allocated buffers duplicated in new buffers.
33219  */
33220 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_clone(const struct LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR orig);
33221
33222 /**
33223  * Creates a new CResult_HtlcKeyDecodeErrorZ in the success state.
33224  */
33225 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_ok(struct LDKHtlcKey o);
33226
33227 /**
33228  * Creates a new CResult_HtlcKeyDecodeErrorZ in the error state.
33229  */
33230 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_err(struct LDKDecodeError e);
33231
33232 /**
33233  * Checks if the given object is currently in the success state
33234  */
33235 bool CResult_HtlcKeyDecodeErrorZ_is_ok(const struct LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR o);
33236
33237 /**
33238  * Frees any resources used by the CResult_HtlcKeyDecodeErrorZ.
33239  */
33240 void CResult_HtlcKeyDecodeErrorZ_free(struct LDKCResult_HtlcKeyDecodeErrorZ _res);
33241
33242 /**
33243  * Creates a new CResult_HtlcKeyDecodeErrorZ which has the same data as `orig`
33244  * but with all dynamically-allocated buffers duplicated in new buffers.
33245  */
33246 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_clone(const struct LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR orig);
33247
33248 /**
33249  * Creates a new CResult_RevocationBasepointDecodeErrorZ in the success state.
33250  */
33251 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_ok(struct LDKRevocationBasepoint o);
33252
33253 /**
33254  * Creates a new CResult_RevocationBasepointDecodeErrorZ in the error state.
33255  */
33256 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_err(struct LDKDecodeError e);
33257
33258 /**
33259  * Checks if the given object is currently in the success state
33260  */
33261 bool CResult_RevocationBasepointDecodeErrorZ_is_ok(const struct LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR o);
33262
33263 /**
33264  * Frees any resources used by the CResult_RevocationBasepointDecodeErrorZ.
33265  */
33266 void CResult_RevocationBasepointDecodeErrorZ_free(struct LDKCResult_RevocationBasepointDecodeErrorZ _res);
33267
33268 /**
33269  * Creates a new CResult_RevocationBasepointDecodeErrorZ which has the same data as `orig`
33270  * but with all dynamically-allocated buffers duplicated in new buffers.
33271  */
33272 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_clone(const struct LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR orig);
33273
33274 /**
33275  * Creates a new CResult_RevocationKeyDecodeErrorZ in the success state.
33276  */
33277 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_ok(struct LDKRevocationKey o);
33278
33279 /**
33280  * Creates a new CResult_RevocationKeyDecodeErrorZ in the error state.
33281  */
33282 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_err(struct LDKDecodeError e);
33283
33284 /**
33285  * Checks if the given object is currently in the success state
33286  */
33287 bool CResult_RevocationKeyDecodeErrorZ_is_ok(const struct LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR o);
33288
33289 /**
33290  * Frees any resources used by the CResult_RevocationKeyDecodeErrorZ.
33291  */
33292 void CResult_RevocationKeyDecodeErrorZ_free(struct LDKCResult_RevocationKeyDecodeErrorZ _res);
33293
33294 /**
33295  * Creates a new CResult_RevocationKeyDecodeErrorZ which has the same data as `orig`
33296  * but with all dynamically-allocated buffers duplicated in new buffers.
33297  */
33298 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_clone(const struct LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR orig);
33299
33300 /**
33301  * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
33302  */
33303 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
33304
33305 /**
33306  * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
33307  */
33308 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
33309
33310 /**
33311  * Checks if the given object is currently in the success state
33312  */
33313 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
33314
33315 /**
33316  * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
33317  */
33318 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
33319
33320 /**
33321  * Creates a new tuple which has the same data as `orig`
33322  * but with all dynamically-allocated buffers duplicated in new buffers.
33323  */
33324 struct LDKC2Tuple_OutPointChannelIdZ C2Tuple_OutPointChannelIdZ_clone(const struct LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR orig);
33325
33326 /**
33327  * Creates a new C2Tuple_OutPointChannelIdZ from the contained elements.
33328  */
33329 struct LDKC2Tuple_OutPointChannelIdZ C2Tuple_OutPointChannelIdZ_new(struct LDKOutPoint a, struct LDKChannelId b);
33330
33331 /**
33332  * Frees any resources used by the C2Tuple_OutPointChannelIdZ.
33333  */
33334 void C2Tuple_OutPointChannelIdZ_free(struct LDKC2Tuple_OutPointChannelIdZ _res);
33335
33336 /**
33337  * Frees the buffer pointed to by `data` if `datalen` is non-0.
33338  */
33339 void CVec_C2Tuple_OutPointChannelIdZZ_free(struct LDKCVec_C2Tuple_OutPointChannelIdZZ _res);
33340
33341 /**
33342  * Frees the buffer pointed to by `data` if `datalen` is non-0.
33343  */
33344 void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res);
33345
33346 /**
33347  * Creates a new tuple which has the same data as `orig`
33348  * but with all dynamically-allocated buffers duplicated in new buffers.
33349  */
33350 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig);
33351
33352 /**
33353  * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements.
33354  */
33355 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b);
33356
33357 /**
33358  * Frees any resources used by the C2Tuple_OutPointCVec_MonitorUpdateIdZZ.
33359  */
33360 void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res);
33361
33362 /**
33363  * Frees the buffer pointed to by `data` if `datalen` is non-0.
33364  */
33365 void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res);
33366
33367 /**
33368  * Frees any resources used by the APIError
33369  */
33370 void APIError_free(struct LDKAPIError this_ptr);
33371
33372 /**
33373  * Creates a copy of the APIError
33374  */
33375 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
33376
33377 /**
33378  * Utility method to constructs a new APIMisuseError-variant APIError
33379  */
33380 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
33381
33382 /**
33383  * Utility method to constructs a new FeeRateTooHigh-variant APIError
33384  */
33385 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
33386
33387 /**
33388  * Utility method to constructs a new InvalidRoute-variant APIError
33389  */
33390 struct LDKAPIError APIError_invalid_route(struct LDKStr err);
33391
33392 /**
33393  * Utility method to constructs a new ChannelUnavailable-variant APIError
33394  */
33395 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
33396
33397 /**
33398  * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
33399  */
33400 struct LDKAPIError APIError_monitor_update_in_progress(void);
33401
33402 /**
33403  * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
33404  */
33405 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
33406
33407 /**
33408  * Checks if two APIErrors contain equal inner contents.
33409  * This ignores pointers and is_owned flags and looks at the values in fields.
33410  */
33411 bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
33412
33413 /**
33414  * Serialize the APIError object into a byte array which can be read by APIError_read
33415  */
33416 struct LDKCVec_u8Z APIError_write(const struct LDKAPIError *NONNULL_PTR obj);
33417
33418 /**
33419  * Read a APIError from a byte array, created by APIError_write
33420  */
33421 struct LDKCResult_COption_APIErrorZDecodeErrorZ APIError_read(struct LDKu8slice ser);
33422
33423 /**
33424  * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
33425  */
33426 void BigSize_free(struct LDKBigSize this_obj);
33427
33428 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
33429
33430 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
33431
33432 /**
33433  * Constructs a new BigSize given each field
33434  */
33435 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
33436
33437 /**
33438  * Creates a copy of the BigSize
33439  */
33440 struct LDKBigSize BigSize_clone(const struct LDKBigSize *NONNULL_PTR orig);
33441
33442 /**
33443  * Generates a non-cryptographic 64-bit hash of the BigSize.
33444  */
33445 uint64_t BigSize_hash(const struct LDKBigSize *NONNULL_PTR o);
33446
33447 /**
33448  * Checks if two BigSizes contain equal inner contents.
33449  * This ignores pointers and is_owned flags and looks at the values in fields.
33450  * Two objects with NULL inner values will be considered "equal" here.
33451  */
33452 bool BigSize_eq(const struct LDKBigSize *NONNULL_PTR a, const struct LDKBigSize *NONNULL_PTR b);
33453
33454 /**
33455  * Serialize the BigSize object into a byte array which can be read by BigSize_read
33456  */
33457 struct LDKCVec_u8Z BigSize_write(const struct LDKBigSize *NONNULL_PTR obj);
33458
33459 /**
33460  * Read a BigSize from a byte array, created by BigSize_write
33461  */
33462 struct LDKCResult_BigSizeDecodeErrorZ BigSize_read(struct LDKu8slice ser);
33463
33464 /**
33465  * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
33466  */
33467 void Hostname_free(struct LDKHostname this_obj);
33468
33469 /**
33470  * Creates a copy of the Hostname
33471  */
33472 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
33473
33474 /**
33475  * Generates a non-cryptographic 64-bit hash of the Hostname.
33476  */
33477 uint64_t Hostname_hash(const struct LDKHostname *NONNULL_PTR o);
33478
33479 /**
33480  * Checks if two Hostnames contain equal inner contents.
33481  * This ignores pointers and is_owned flags and looks at the values in fields.
33482  * Two objects with NULL inner values will be considered "equal" here.
33483  */
33484 bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
33485
33486 /**
33487  * Returns the length of the hostname.
33488  */
33489 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
33490
33491 /**
33492  * Get the string representation of a Hostname object
33493  */
33494 struct LDKStr Hostname_to_str(const struct LDKHostname *NONNULL_PTR o);
33495
33496 /**
33497  * Serialize the Hostname object into a byte array which can be read by Hostname_read
33498  */
33499 struct LDKCVec_u8Z Hostname_write(const struct LDKHostname *NONNULL_PTR obj);
33500
33501 /**
33502  * Read a Hostname from a byte array, created by Hostname_write
33503  */
33504 struct LDKCResult_HostnameDecodeErrorZ Hostname_read(struct LDKu8slice ser);
33505
33506 /**
33507  * Frees any resources used by the TransactionU16LenLimited, if is_owned is set and inner is non-NULL.
33508  */
33509 void TransactionU16LenLimited_free(struct LDKTransactionU16LenLimited this_obj);
33510
33511 /**
33512  * Creates a copy of the TransactionU16LenLimited
33513  */
33514 struct LDKTransactionU16LenLimited TransactionU16LenLimited_clone(const struct LDKTransactionU16LenLimited *NONNULL_PTR orig);
33515
33516 /**
33517  * Generates a non-cryptographic 64-bit hash of the TransactionU16LenLimited.
33518  */
33519 uint64_t TransactionU16LenLimited_hash(const struct LDKTransactionU16LenLimited *NONNULL_PTR o);
33520
33521 /**
33522  * Checks if two TransactionU16LenLimiteds contain equal inner contents.
33523  * This ignores pointers and is_owned flags and looks at the values in fields.
33524  * Two objects with NULL inner values will be considered "equal" here.
33525  */
33526 bool TransactionU16LenLimited_eq(const struct LDKTransactionU16LenLimited *NONNULL_PTR a, const struct LDKTransactionU16LenLimited *NONNULL_PTR b);
33527
33528 /**
33529  * Constructs a new `TransactionU16LenLimited` from a `Transaction` only if it's consensus-
33530  * serialized length is <= u16::MAX.
33531  */
33532 MUST_USE_RES struct LDKCResult_TransactionU16LenLimitedNoneZ TransactionU16LenLimited_new(struct LDKTransaction transaction);
33533
33534 /**
33535  * Consumes this `TransactionU16LenLimited` and returns its contained `Transaction`.
33536  */
33537 MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_into_transaction(struct LDKTransactionU16LenLimited this_arg);
33538
33539 /**
33540  * Returns a reference to the contained `Transaction`
33541  */
33542 MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_as_transaction(const struct LDKTransactionU16LenLimited *NONNULL_PTR this_arg);
33543
33544 /**
33545  * Serialize the TransactionU16LenLimited object into a byte array which can be read by TransactionU16LenLimited_read
33546  */
33547 struct LDKCVec_u8Z TransactionU16LenLimited_write(const struct LDKTransactionU16LenLimited *NONNULL_PTR obj);
33548
33549 /**
33550  * Read a TransactionU16LenLimited from a byte array, created by TransactionU16LenLimited_write
33551  */
33552 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_read(struct LDKu8slice ser);
33553
33554 /**
33555  * Creates a digital signature of a message given a SecretKey, like the node's secret.
33556  * A receiver knowing the PublicKey (e.g. the node's id) and the message can be sure that the signature was generated by the caller.
33557  * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
33558  */
33559 struct LDKCResult_StrSecp256k1ErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
33560
33561 /**
33562  * Recovers the PublicKey of the signer of the message given the message and the signature.
33563  */
33564 struct LDKCResult_PublicKeySecp256k1ErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
33565
33566 /**
33567  * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
33568  * and the PublicKey.
33569  */
33570 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
33571
33572 /**
33573  * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
33574  */
33575 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature);
33576
33577 /**
33578  * Calls the free function if one is set
33579  */
33580 void KVStore_free(struct LDKKVStore this_ptr);
33581
33582 /**
33583  * Calls the free function if one is set
33584  */
33585 void Persister_free(struct LDKPersister this_ptr);
33586
33587 /**
33588  * Read previously persisted [`ChannelMonitor`]s from the store.
33589  */
33590 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ read_channel_monitors(struct LDKKVStore kv_store, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider);
33591
33592 /**
33593  * Frees any resources used by the MonitorUpdatingPersister, if is_owned is set and inner is non-NULL.
33594  */
33595 void MonitorUpdatingPersister_free(struct LDKMonitorUpdatingPersister this_obj);
33596
33597 /**
33598  * Constructs a new [`MonitorUpdatingPersister`].
33599  *
33600  * The `maximum_pending_updates` parameter controls how many updates may be stored before a
33601  * [`MonitorUpdatingPersister`] consolidates updates by writing a full monitor. Note that
33602  * consolidation will frequently occur with fewer updates than what you set here; this number
33603  * is merely the maximum that may be stored. When setting this value, consider that for higher
33604  * values of `maximum_pending_updates`:
33605  *
33606  *   - [`MonitorUpdatingPersister`] will tend to write more [`ChannelMonitorUpdate`]s than
33607  * [`ChannelMonitor`]s, approaching one [`ChannelMonitor`] write for every
33608  * `maximum_pending_updates` [`ChannelMonitorUpdate`]s.
33609  *   - [`MonitorUpdatingPersister`] will issue deletes differently. Lazy deletes will come in
33610  * \"waves\" for each [`ChannelMonitor`] write. A larger `maximum_pending_updates` means bigger,
33611  * less frequent \"waves.\"
33612  *   - [`MonitorUpdatingPersister`] will potentially have more listing to do if you need to run
33613  * [`MonitorUpdatingPersister::cleanup_stale_updates`].
33614  */
33615 MUST_USE_RES struct LDKMonitorUpdatingPersister MonitorUpdatingPersister_new(struct LDKKVStore kv_store, struct LDKLogger logger, uint64_t maximum_pending_updates, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider);
33616
33617 /**
33618  * Reads all stored channel monitors, along with any stored updates for them.
33619  *
33620  * It is extremely important that your [`KVStore::read`] implementation uses the
33621  * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
33622  * documentation for [`MonitorUpdatingPersister`].
33623  */
33624 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ MonitorUpdatingPersister_read_all_channel_monitors_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator);
33625
33626 /**
33627  * Read a single channel monitor, along with any stored updates for it.
33628  *
33629  * It is extremely important that your [`KVStore::read`] implementation uses the
33630  * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
33631  * documentation for [`MonitorUpdatingPersister`].
33632  *
33633  * For `monitor_key`, channel storage keys be the channel's transaction ID and index, or
33634  * [`OutPoint`], with an underscore `_` between them. For example, given:
33635  *
33636  *   - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
33637  *   - Index: `1`
33638  *
33639  * The correct `monitor_key` would be:
33640  * `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
33641  *
33642  * Loading a large number of monitors will be faster if done in parallel. You can use this
33643  * function to accomplish this. Take care to limit the number of parallel readers.
33644  */
33645 MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ MonitorUpdatingPersister_read_channel_monitor_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, struct LDKStr monitor_key);
33646
33647 /**
33648  * Cleans up stale updates for all monitors.
33649  *
33650  * This function works by first listing all monitors, and then for each of them, listing all
33651  * updates. The updates that have an `update_id` less than or equal to than the stored monitor
33652  * are deleted. The deletion can either be lazy or non-lazy based on the `lazy` flag; this will
33653  * be passed to [`KVStore::remove`].
33654  */
33655 MUST_USE_RES struct LDKCResult_NoneIOErrorZ MonitorUpdatingPersister_cleanup_stale_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, bool lazy);
33656
33657 /**
33658  * Constructs a new Persist which calls the relevant methods on this_arg.
33659  * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
33660  */
33661 struct LDKPersist MonitorUpdatingPersister_as_Persist(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg);
33662
33663 /**
33664  * Creates a copy of the ShortChannelIdError
33665  */
33666 enum LDKShortChannelIdError ShortChannelIdError_clone(const enum LDKShortChannelIdError *NONNULL_PTR orig);
33667
33668 /**
33669  * Utility method to constructs a new BlockOverflow-variant ShortChannelIdError
33670  */
33671 enum LDKShortChannelIdError ShortChannelIdError_block_overflow(void);
33672
33673 /**
33674  * Utility method to constructs a new TxIndexOverflow-variant ShortChannelIdError
33675  */
33676 enum LDKShortChannelIdError ShortChannelIdError_tx_index_overflow(void);
33677
33678 /**
33679  * Utility method to constructs a new VoutIndexOverflow-variant ShortChannelIdError
33680  */
33681 enum LDKShortChannelIdError ShortChannelIdError_vout_index_overflow(void);
33682
33683 /**
33684  * Checks if two ShortChannelIdErrors contain equal inner contents.
33685  * This ignores pointers and is_owned flags and looks at the values in fields.
33686  */
33687 bool ShortChannelIdError_eq(const enum LDKShortChannelIdError *NONNULL_PTR a, const enum LDKShortChannelIdError *NONNULL_PTR b);
33688
33689 /**
33690  * Extracts the block height (most significant 3-bytes) from the `short_channel_id`
33691  */
33692 uint32_t block_from_scid(uint64_t short_channel_id);
33693
33694 /**
33695  * Extracts the tx index (bytes [2..4]) from the `short_channel_id`
33696  */
33697 uint32_t tx_index_from_scid(uint64_t short_channel_id);
33698
33699 /**
33700  * Extracts the vout (bytes [0..2]) from the `short_channel_id`
33701  */
33702 uint16_t vout_from_scid(uint64_t short_channel_id);
33703
33704 /**
33705  * Constructs a `short_channel_id` using the components pieces. Results in an error
33706  * if the block height, tx index, or vout index overflow the maximum sizes.
33707  */
33708 struct LDKCResult_u64ShortChannelIdErrorZ scid_from_parts(uint64_t block, uint64_t tx_index, uint64_t vout_index);
33709
33710 /**
33711  * Frees any resources used by the UntrustedString, if is_owned is set and inner is non-NULL.
33712  */
33713 void UntrustedString_free(struct LDKUntrustedString this_obj);
33714
33715 struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr);
33716
33717 void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val);
33718
33719 /**
33720  * Constructs a new UntrustedString given each field
33721  */
33722 MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg);
33723
33724 /**
33725  * Creates a copy of the UntrustedString
33726  */
33727 struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig);
33728
33729 /**
33730  * Checks if two UntrustedStrings contain equal inner contents.
33731  * This ignores pointers and is_owned flags and looks at the values in fields.
33732  * Two objects with NULL inner values will be considered "equal" here.
33733  */
33734 bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b);
33735
33736 /**
33737  * Generates a non-cryptographic 64-bit hash of the UntrustedString.
33738  */
33739 uint64_t UntrustedString_hash(const struct LDKUntrustedString *NONNULL_PTR o);
33740
33741 /**
33742  * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read
33743  */
33744 struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj);
33745
33746 /**
33747  * Read a UntrustedString from a byte array, created by UntrustedString_write
33748  */
33749 struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser);
33750
33751 /**
33752  * Get the string representation of a UntrustedString object
33753  */
33754 struct LDKStr UntrustedString_to_str(const struct LDKUntrustedString *NONNULL_PTR o);
33755
33756 /**
33757  * Frees any resources used by the PrintableString, if is_owned is set and inner is non-NULL.
33758  */
33759 void PrintableString_free(struct LDKPrintableString this_obj);
33760
33761 struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr);
33762
33763 void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val);
33764
33765 /**
33766  * Constructs a new PrintableString given each field
33767  */
33768 MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg);
33769
33770 /**
33771  * Get the string representation of a PrintableString object
33772  */
33773 struct LDKStr PrintableString_to_str(const struct LDKPrintableString *NONNULL_PTR o);
33774
33775 /**
33776  * Frees any resources used by the TrackedSpendableOutput, if is_owned is set and inner is non-NULL.
33777  */
33778 void TrackedSpendableOutput_free(struct LDKTrackedSpendableOutput this_obj);
33779
33780 /**
33781  * The tracked output descriptor.
33782  */
33783 struct LDKSpendableOutputDescriptor TrackedSpendableOutput_get_descriptor(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
33784
33785 /**
33786  * The tracked output descriptor.
33787  */
33788 void TrackedSpendableOutput_set_descriptor(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKSpendableOutputDescriptor val);
33789
33790 /**
33791  * The channel this output belongs to.
33792  *
33793  * Will be `None` if no `channel_id` was given to [`OutputSweeper::track_spendable_outputs`]
33794  *
33795  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33796  */
33797 struct LDKChannelId TrackedSpendableOutput_get_channel_id(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
33798
33799 /**
33800  * The channel this output belongs to.
33801  *
33802  * Will be `None` if no `channel_id` was given to [`OutputSweeper::track_spendable_outputs`]
33803  *
33804  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33805  */
33806 void TrackedSpendableOutput_set_channel_id(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
33807
33808 /**
33809  * The current status of the output spend.
33810  */
33811 struct LDKOutputSpendStatus TrackedSpendableOutput_get_status(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
33812
33813 /**
33814  * The current status of the output spend.
33815  */
33816 void TrackedSpendableOutput_set_status(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKOutputSpendStatus val);
33817
33818 /**
33819  * Constructs a new TrackedSpendableOutput given each field
33820  *
33821  * Note that channel_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
33822  */
33823 MUST_USE_RES struct LDKTrackedSpendableOutput TrackedSpendableOutput_new(struct LDKSpendableOutputDescriptor descriptor_arg, struct LDKChannelId channel_id_arg, struct LDKOutputSpendStatus status_arg);
33824
33825 /**
33826  * Creates a copy of the TrackedSpendableOutput
33827  */
33828 struct LDKTrackedSpendableOutput TrackedSpendableOutput_clone(const struct LDKTrackedSpendableOutput *NONNULL_PTR orig);
33829
33830 /**
33831  * Checks if two TrackedSpendableOutputs contain equal inner contents.
33832  * This ignores pointers and is_owned flags and looks at the values in fields.
33833  * Two objects with NULL inner values will be considered "equal" here.
33834  */
33835 bool TrackedSpendableOutput_eq(const struct LDKTrackedSpendableOutput *NONNULL_PTR a, const struct LDKTrackedSpendableOutput *NONNULL_PTR b);
33836
33837 /**
33838  * Returns whether the output is spent in the given transaction.
33839  */
33840 MUST_USE_RES bool TrackedSpendableOutput_is_spent_in(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_arg, struct LDKTransaction tx);
33841
33842 /**
33843  * Serialize the TrackedSpendableOutput object into a byte array which can be read by TrackedSpendableOutput_read
33844  */
33845 struct LDKCVec_u8Z TrackedSpendableOutput_write(const struct LDKTrackedSpendableOutput *NONNULL_PTR obj);
33846
33847 /**
33848  * Read a TrackedSpendableOutput from a byte array, created by TrackedSpendableOutput_write
33849  */
33850 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ TrackedSpendableOutput_read(struct LDKu8slice ser);
33851
33852 /**
33853  * Frees any resources used by the OutputSpendStatus
33854  */
33855 void OutputSpendStatus_free(struct LDKOutputSpendStatus this_ptr);
33856
33857 /**
33858  * Creates a copy of the OutputSpendStatus
33859  */
33860 struct LDKOutputSpendStatus OutputSpendStatus_clone(const struct LDKOutputSpendStatus *NONNULL_PTR orig);
33861
33862 /**
33863  * Utility method to constructs a new PendingInitialBroadcast-variant OutputSpendStatus
33864  */
33865 struct LDKOutputSpendStatus OutputSpendStatus_pending_initial_broadcast(struct LDKCOption_u32Z delayed_until_height);
33866
33867 /**
33868  * Utility method to constructs a new PendingFirstConfirmation-variant OutputSpendStatus
33869  */
33870 struct LDKOutputSpendStatus OutputSpendStatus_pending_first_confirmation(struct LDKThirtyTwoBytes first_broadcast_hash, uint32_t latest_broadcast_height, struct LDKTransaction latest_spending_tx);
33871
33872 /**
33873  * Utility method to constructs a new PendingThresholdConfirmations-variant OutputSpendStatus
33874  */
33875 struct LDKOutputSpendStatus OutputSpendStatus_pending_threshold_confirmations(struct LDKThirtyTwoBytes first_broadcast_hash, uint32_t latest_broadcast_height, struct LDKTransaction latest_spending_tx, uint32_t confirmation_height, struct LDKThirtyTwoBytes confirmation_hash);
33876
33877 /**
33878  * Checks if two OutputSpendStatuss contain equal inner contents.
33879  * This ignores pointers and is_owned flags and looks at the values in fields.
33880  */
33881 bool OutputSpendStatus_eq(const struct LDKOutputSpendStatus *NONNULL_PTR a, const struct LDKOutputSpendStatus *NONNULL_PTR b);
33882
33883 /**
33884  * Serialize the OutputSpendStatus object into a byte array which can be read by OutputSpendStatus_read
33885  */
33886 struct LDKCVec_u8Z OutputSpendStatus_write(const struct LDKOutputSpendStatus *NONNULL_PTR obj);
33887
33888 /**
33889  * Read a OutputSpendStatus from a byte array, created by OutputSpendStatus_write
33890  */
33891 struct LDKCResult_OutputSpendStatusDecodeErrorZ OutputSpendStatus_read(struct LDKu8slice ser);
33892
33893 /**
33894  * Frees any resources used by the OutputSweeper, if is_owned is set and inner is non-NULL.
33895  */
33896 void OutputSweeper_free(struct LDKOutputSweeper this_obj);
33897
33898 /**
33899  * Constructs a new [`OutputSweeper`].
33900  *
33901  * If chain data is provided via the [`Confirm`] interface or via filtered blocks, users also
33902  * need to register their [`Filter`] implementation via the given `chain_data_source`.
33903  */
33904 MUST_USE_RES struct LDKOutputSweeper OutputSweeper_new(struct LDKBestBlock best_block, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKCOption_FilterZ chain_data_source, struct LDKOutputSpender output_spender, struct LDKChangeDestinationSource change_destination_source, struct LDKKVStore kv_store, struct LDKLogger logger);
33905
33906 /**
33907  * Tells the sweeper to track the given outputs descriptors.
33908  *
33909  * Usually, this should be called based on the values emitted by the
33910  * [`Event::SpendableOutputs`].
33911  *
33912  * The given `exclude_static_outputs` flag controls whether the sweeper will filter out
33913  * [`SpendableOutputDescriptor::StaticOutput`]s, which may be handled directly by the on-chain
33914  * wallet implementation.
33915  *
33916  * If `delay_until_height` is set, we will delay the spending until the respective block
33917  * height is reached. This can be used to batch spends, e.g., to reduce on-chain fees.
33918  *
33919  * Returns `Err` on persistence failure, in which case the call may be safely retried.
33920  *
33921  * [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs
33922  *
33923  * Note that channel_id (or a relevant inner pointer) may be NULL or all-0s to represent None
33924  */
33925 MUST_USE_RES struct LDKCResult_NoneNoneZ OutputSweeper_track_spendable_outputs(const struct LDKOutputSweeper *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ output_descriptors, struct LDKChannelId channel_id, bool exclude_static_outputs, struct LDKCOption_u32Z delay_until_height);
33926
33927 /**
33928  * Returns a list of the currently tracked spendable outputs.
33929  */
33930 MUST_USE_RES struct LDKCVec_TrackedSpendableOutputZ OutputSweeper_tracked_spendable_outputs(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33931
33932 /**
33933  * Gets the latest best block which was connected either via the [`Listen`] or
33934  * [`Confirm`] interfaces.
33935  */
33936 MUST_USE_RES struct LDKBestBlock OutputSweeper_current_best_block(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33937
33938 /**
33939  * Constructs a new Listen which calls the relevant methods on this_arg.
33940  * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
33941  */
33942 struct LDKListen OutputSweeper_as_Listen(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33943
33944 /**
33945  * Constructs a new Confirm which calls the relevant methods on this_arg.
33946  * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
33947  */
33948 struct LDKConfirm OutputSweeper_as_Confirm(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33949
33950 /**
33951  * Frees any resources used by the SpendingDelay
33952  */
33953 void SpendingDelay_free(struct LDKSpendingDelay this_ptr);
33954
33955 /**
33956  * Creates a copy of the SpendingDelay
33957  */
33958 struct LDKSpendingDelay SpendingDelay_clone(const struct LDKSpendingDelay *NONNULL_PTR orig);
33959
33960 /**
33961  * Utility method to constructs a new Relative-variant SpendingDelay
33962  */
33963 struct LDKSpendingDelay SpendingDelay_relative(uint32_t num_blocks);
33964
33965 /**
33966  * Utility method to constructs a new Absolute-variant SpendingDelay
33967  */
33968 struct LDKSpendingDelay SpendingDelay_absolute(uint32_t height);
33969
33970 /**
33971  * Read a OutputSweeper from a byte array, created by OutputSweeper_write
33972  */
33973 struct LDKCResult_OutputSweeperDecodeErrorZ OutputSweeper_read(struct LDKu8slice ser, struct LDKBroadcasterInterface arg_a, struct LDKFeeEstimator arg_b, struct LDKCOption_FilterZ arg_c, struct LDKOutputSpender arg_d, struct LDKChangeDestinationSource arg_e, struct LDKKVStore arg_f, struct LDKLogger arg_g);
33974
33975 /**
33976  * Read a C2Tuple_BestBlockOutputSweeperZ from a byte array, created by C2Tuple_BestBlockOutputSweeperZ_write
33977  */
33978 struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ C2Tuple_BestBlockOutputSweeperZ_read(struct LDKu8slice ser, struct LDKBroadcasterInterface arg_a, struct LDKFeeEstimator arg_b, struct LDKCOption_FilterZ arg_c, struct LDKOutputSpender arg_d, struct LDKChangeDestinationSource arg_e, struct LDKKVStore arg_f, struct LDKLogger arg_g);
33979
33980 /**
33981  * Calls the free function if one is set
33982  */
33983 void FutureCallback_free(struct LDKFutureCallback this_ptr);
33984
33985 /**
33986  * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
33987  */
33988 void Future_free(struct LDKFuture this_obj);
33989
33990 /**
33991  * Registers a callback to be called upon completion of this future. If the future has already
33992  * completed, the callback will be called immediately.
33993  */
33994 void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
33995
33996 /**
33997  * Waits until this [`Future`] completes.
33998  */
33999 void Future_wait(const struct LDKFuture *NONNULL_PTR this_arg);
34000
34001 /**
34002  * Waits until this [`Future`] completes or the given amount of time has elapsed.
34003  *
34004  * Returns true if the [`Future`] completed, false if the time elapsed.
34005  */
34006 MUST_USE_RES bool Future_wait_timeout(const struct LDKFuture *NONNULL_PTR this_arg, uint64_t max_wait);
34007
34008 /**
34009  * Frees any resources used by the Sleeper, if is_owned is set and inner is non-NULL.
34010  */
34011 void Sleeper_free(struct LDKSleeper this_obj);
34012
34013 /**
34014  * Constructs a new sleeper from one future, allowing blocking on it.
34015  */
34016 MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(const struct LDKFuture *NONNULL_PTR future);
34017
34018 /**
34019  * Constructs a new sleeper from two futures, allowing blocking on both at once.
34020  */
34021 MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(const struct LDKFuture *NONNULL_PTR fut_a, const struct LDKFuture *NONNULL_PTR fut_b);
34022
34023 /**
34024  * Constructs a new sleeper on many futures, allowing blocking on all at once.
34025  */
34026 MUST_USE_RES struct LDKSleeper Sleeper_new(struct LDKCVec_FutureZ futures);
34027
34028 /**
34029  * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed.
34030  */
34031 void Sleeper_wait(const struct LDKSleeper *NONNULL_PTR this_arg);
34032
34033 /**
34034  * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed or the
34035  * given amount of time has elapsed. Returns true if a [`Future`] completed, false if the time
34036  * elapsed.
34037  */
34038 MUST_USE_RES bool Sleeper_wait_timeout(const struct LDKSleeper *NONNULL_PTR this_arg, uint64_t max_wait);
34039
34040 /**
34041  * Creates a copy of the Level
34042  */
34043 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
34044
34045 /**
34046  * Utility method to constructs a new Gossip-variant Level
34047  */
34048 enum LDKLevel Level_gossip(void);
34049
34050 /**
34051  * Utility method to constructs a new Trace-variant Level
34052  */
34053 enum LDKLevel Level_trace(void);
34054
34055 /**
34056  * Utility method to constructs a new Debug-variant Level
34057  */
34058 enum LDKLevel Level_debug(void);
34059
34060 /**
34061  * Utility method to constructs a new Info-variant Level
34062  */
34063 enum LDKLevel Level_info(void);
34064
34065 /**
34066  * Utility method to constructs a new Warn-variant Level
34067  */
34068 enum LDKLevel Level_warn(void);
34069
34070 /**
34071  * Utility method to constructs a new Error-variant Level
34072  */
34073 enum LDKLevel Level_error(void);
34074
34075 /**
34076  * Checks if two Levels contain equal inner contents.
34077  * This ignores pointers and is_owned flags and looks at the values in fields.
34078  */
34079 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
34080
34081 /**
34082  * Generates a non-cryptographic 64-bit hash of the Level.
34083  */
34084 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
34085
34086 /**
34087  * Get the string representation of a Level object
34088  */
34089 struct LDKStr Level_to_str(const enum LDKLevel *NONNULL_PTR o);
34090
34091 /**
34092  * Returns the most verbose logging level.
34093  */
34094 MUST_USE_RES enum LDKLevel Level_max(void);
34095
34096 /**
34097  * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
34098  */
34099 void Record_free(struct LDKRecord this_obj);
34100
34101 /**
34102  * The verbosity level of the message.
34103  */
34104 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
34105
34106 /**
34107  * The verbosity level of the message.
34108  */
34109 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
34110
34111 /**
34112  * The node id of the peer pertaining to the logged record.
34113  *
34114  * Note that in some cases a [`Self::channel_id`] may be filled in but this may still be
34115  * `None`, depending on if the peer information is readily available in LDK when the log is
34116  * generated.
34117  *
34118  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
34119  */
34120 struct LDKPublicKey Record_get_peer_id(const struct LDKRecord *NONNULL_PTR this_ptr);
34121
34122 /**
34123  * The node id of the peer pertaining to the logged record.
34124  *
34125  * Note that in some cases a [`Self::channel_id`] may be filled in but this may still be
34126  * `None`, depending on if the peer information is readily available in LDK when the log is
34127  * generated.
34128  *
34129  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
34130  */
34131 void Record_set_peer_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34132
34133 /**
34134  * The channel id of the channel pertaining to the logged record. May be a temporary id before
34135  * the channel has been funded.
34136  *
34137  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
34138  */
34139 struct LDKChannelId Record_get_channel_id(const struct LDKRecord *NONNULL_PTR this_ptr);
34140
34141 /**
34142  * The channel id of the channel pertaining to the logged record. May be a temporary id before
34143  * the channel has been funded.
34144  *
34145  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
34146  */
34147 void Record_set_channel_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKChannelId val);
34148
34149 /**
34150  * The message body.
34151  */
34152 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
34153
34154 /**
34155  * The message body.
34156  */
34157 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
34158
34159 /**
34160  * The module path of the message.
34161  */
34162 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
34163
34164 /**
34165  * The module path of the message.
34166  */
34167 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
34168
34169 /**
34170  * The source file containing the message.
34171  */
34172 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
34173
34174 /**
34175  * The source file containing the message.
34176  */
34177 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
34178
34179 /**
34180  * The line containing the message.
34181  */
34182 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
34183
34184 /**
34185  * The line containing the message.
34186  */
34187 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
34188
34189 /**
34190  * Constructs a new Record given each field
34191  *
34192  * Note that peer_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
34193  * Note that channel_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
34194  */
34195 MUST_USE_RES struct LDKRecord Record_new(enum LDKLevel level_arg, struct LDKPublicKey peer_id_arg, struct LDKChannelId channel_id_arg, struct LDKStr args_arg, struct LDKStr module_path_arg, struct LDKStr file_arg, uint32_t line_arg);
34196
34197 /**
34198  * Creates a copy of the Record
34199  */
34200 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
34201
34202 /**
34203  * Calls the free function if one is set
34204  */
34205 void Logger_free(struct LDKLogger this_ptr);
34206
34207 /**
34208  * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
34209  */
34210 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
34211
34212 /**
34213  * Confirmations we will wait for before considering the channel locked in.
34214  * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
34215  * equivalent limit applied to outbound channels).
34216  *
34217  * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
34218  * transaction before operation. If you wish to accept channels with zero confirmations, see
34219  * [`UserConfig::manually_accept_inbound_channels`] and
34220  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
34221  *
34222  * Default value: 6.
34223  *
34224  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
34225  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
34226  */
34227 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34228
34229 /**
34230  * Confirmations we will wait for before considering the channel locked in.
34231  * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
34232  * equivalent limit applied to outbound channels).
34233  *
34234  * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
34235  * transaction before operation. If you wish to accept channels with zero confirmations, see
34236  * [`UserConfig::manually_accept_inbound_channels`] and
34237  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
34238  *
34239  * Default value: 6.
34240  *
34241  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
34242  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
34243  */
34244 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
34245
34246 /**
34247  * Set to the number of blocks we require our counterparty to wait to claim their money (ie
34248  * the number of blocks we have to punish our counterparty if they broadcast a revoked
34249  * transaction).
34250  *
34251  * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
34252  * be online to check for revoked transactions on-chain at least once every our_to_self_delay
34253  * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
34254  * possibly with time in between to RBF the spending transaction).
34255  *
34256  * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
34257  * case of an honest unilateral channel close, which implicitly decrease the economic value of
34258  * our channel.
34259  *
34260  * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
34261  * can tweak config to ask for more security, not less.
34262  */
34263 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34264
34265 /**
34266  * Set to the number of blocks we require our counterparty to wait to claim their money (ie
34267  * the number of blocks we have to punish our counterparty if they broadcast a revoked
34268  * transaction).
34269  *
34270  * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
34271  * be online to check for revoked transactions on-chain at least once every our_to_self_delay
34272  * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
34273  * possibly with time in between to RBF the spending transaction).
34274  *
34275  * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
34276  * case of an honest unilateral channel close, which implicitly decrease the economic value of
34277  * our channel.
34278  *
34279  * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
34280  * can tweak config to ask for more security, not less.
34281  */
34282 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
34283
34284 /**
34285  * Set to the smallest value HTLC we will accept to process.
34286  *
34287  * This value is sent to our counterparty on channel-open and we close the channel any time
34288  * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
34289  *
34290  * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
34291  * by the protocol.
34292  */
34293 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34294
34295 /**
34296  * Set to the smallest value HTLC we will accept to process.
34297  *
34298  * This value is sent to our counterparty on channel-open and we close the channel any time
34299  * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
34300  *
34301  * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
34302  * by the protocol.
34303  */
34304 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
34305
34306 /**
34307  * Sets the percentage of the channel value we will cap the total value of outstanding inbound
34308  * HTLCs to.
34309  *
34310  * This can be set to a value between 1-100, where the value corresponds to the percent of the
34311  * channel value in whole percentages.
34312  *
34313  * Note that:
34314  * * If configured to another value than the default value 10, any new channels created with
34315  * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
34316  * `ChannelManager`.
34317  *
34318  * * This caps the total value for inbound HTLCs in-flight only, and there's currently
34319  * no way to configure the cap for the total value of outbound HTLCs in-flight.
34320  *
34321  * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
34322  * are different from the non-HTLC-encumbered funds. This makes this an important knob to
34323  * restrict exposure to loss due to being offline for too long.
34324  * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
34325  * for more information.
34326  *
34327  * Default value: 10.
34328  * Minimum value: 1, any values less than 1 will be treated as 1 instead.
34329  * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
34330  */
34331 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34332
34333 /**
34334  * Sets the percentage of the channel value we will cap the total value of outstanding inbound
34335  * HTLCs to.
34336  *
34337  * This can be set to a value between 1-100, where the value corresponds to the percent of the
34338  * channel value in whole percentages.
34339  *
34340  * Note that:
34341  * * If configured to another value than the default value 10, any new channels created with
34342  * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
34343  * `ChannelManager`.
34344  *
34345  * * This caps the total value for inbound HTLCs in-flight only, and there's currently
34346  * no way to configure the cap for the total value of outbound HTLCs in-flight.
34347  *
34348  * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
34349  * are different from the non-HTLC-encumbered funds. This makes this an important knob to
34350  * restrict exposure to loss due to being offline for too long.
34351  * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
34352  * for more information.
34353  *
34354  * Default value: 10.
34355  * Minimum value: 1, any values less than 1 will be treated as 1 instead.
34356  * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
34357  */
34358 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
34359
34360 /**
34361  * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
34362  * BOLTs) option for outbound private channels. This provides better privacy by not including
34363  * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
34364  * relay HTLCs to us using the channel's SCID alias.
34365  *
34366  * If this option is set, channels may be created that will not be readable by LDK versions
34367  * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
34368  * [`DecodeError::InvalidValue`].
34369  *
34370  * Note that setting this to true does *not* prevent us from opening channels with
34371  * counterparties that do not support the `scid_alias` option; we will simply fall back to a
34372  * private channel without that option.
34373  *
34374  * Ignored if the channel is negotiated to be announced, see
34375  * [`ChannelHandshakeConfig::announced_channel`] and
34376  * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
34377  *
34378  * Default value: false. This value is likely to change to true in the future.
34379  *
34380  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
34381  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
34382  */
34383 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34384
34385 /**
34386  * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
34387  * BOLTs) option for outbound private channels. This provides better privacy by not including
34388  * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
34389  * relay HTLCs to us using the channel's SCID alias.
34390  *
34391  * If this option is set, channels may be created that will not be readable by LDK versions
34392  * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
34393  * [`DecodeError::InvalidValue`].
34394  *
34395  * Note that setting this to true does *not* prevent us from opening channels with
34396  * counterparties that do not support the `scid_alias` option; we will simply fall back to a
34397  * private channel without that option.
34398  *
34399  * Ignored if the channel is negotiated to be announced, see
34400  * [`ChannelHandshakeConfig::announced_channel`] and
34401  * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
34402  *
34403  * Default value: false. This value is likely to change to true in the future.
34404  *
34405  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
34406  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
34407  */
34408 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
34409
34410 /**
34411  * Set to announce the channel publicly and notify all nodes that they can route via this
34412  * channel.
34413  *
34414  * This should only be set to true for nodes which expect to be online reliably.
34415  *
34416  * As the node which funds a channel picks this value this will only apply for new outbound
34417  * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
34418  *
34419  * Default value: false.
34420  */
34421 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34422
34423 /**
34424  * Set to announce the channel publicly and notify all nodes that they can route via this
34425  * channel.
34426  *
34427  * This should only be set to true for nodes which expect to be online reliably.
34428  *
34429  * As the node which funds a channel picks this value this will only apply for new outbound
34430  * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
34431  *
34432  * Default value: false.
34433  */
34434 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
34435
34436 /**
34437  * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
34438  * supports it, they will then enforce the mutual-close output to us matches what we provided
34439  * at intialization, preventing us from closing to an alternate pubkey.
34440  *
34441  * This is set to true by default to provide a slight increase in security, though ultimately
34442  * any attacker who is able to take control of a channel can just as easily send the funds via
34443  * lightning payments, so we never require that our counterparties support this option.
34444  *
34445  * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
34446  *
34447  * Default value: true.
34448  *
34449  * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
34450  */
34451 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34452
34453 /**
34454  * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
34455  * supports it, they will then enforce the mutual-close output to us matches what we provided
34456  * at intialization, preventing us from closing to an alternate pubkey.
34457  *
34458  * This is set to true by default to provide a slight increase in security, though ultimately
34459  * any attacker who is able to take control of a channel can just as easily send the funds via
34460  * lightning payments, so we never require that our counterparties support this option.
34461  *
34462  * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
34463  *
34464  * Default value: true.
34465  *
34466  * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
34467  */
34468 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
34469
34470 /**
34471  * The Proportion of the channel value to configure as counterparty's channel reserve,
34472  * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
34473  *
34474  * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
34475  * on their side, at all times.
34476  * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
34477  * claiming at least this value on chain.
34478  *
34479  * Channel reserve values greater than 30% could be considered highly unreasonable, since that
34480  * amount can never be used for payments.
34481  * Also, if our selected channel reserve for counterparty and counterparty's selected
34482  * channel reserve for us sum up to equal or greater than channel value, channel negotiations
34483  * will fail.
34484  *
34485  * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
34486  * other than the default value.
34487  *
34488  * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
34489  * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
34490  *                as 1000 sats instead, which is a safe implementation-specific lower bound.
34491  * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
34492  *                instead, although channel negotiations will fail in that case.
34493  */
34494 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34495
34496 /**
34497  * The Proportion of the channel value to configure as counterparty's channel reserve,
34498  * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
34499  *
34500  * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
34501  * on their side, at all times.
34502  * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
34503  * claiming at least this value on chain.
34504  *
34505  * Channel reserve values greater than 30% could be considered highly unreasonable, since that
34506  * amount can never be used for payments.
34507  * Also, if our selected channel reserve for counterparty and counterparty's selected
34508  * channel reserve for us sum up to equal or greater than channel value, channel negotiations
34509  * will fail.
34510  *
34511  * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
34512  * other than the default value.
34513  *
34514  * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
34515  * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
34516  *                as 1000 sats instead, which is a safe implementation-specific lower bound.
34517  * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
34518  *                instead, although channel negotiations will fail in that case.
34519  */
34520 void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
34521
34522 /**
34523  * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
34524  * channels. This feature requires having a reserve of onchain funds readily available to bump
34525  * transactions in the event of a channel force close to avoid the possibility of losing funds.
34526  *
34527  * Note that if you wish accept inbound channels with anchor outputs, you must enable
34528  * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
34529  * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
34530  * whether your reserve of onchain funds is enough to cover the fees for all existing and new
34531  * channels featuring anchor outputs in the event of a force close.
34532  *
34533  * If this option is set, channels may be created that will not be readable by LDK versions
34534  * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
34535  * [`DecodeError::InvalidValue`].
34536  *
34537  * Note that setting this to true does *not* prevent us from opening channels with
34538  * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
34539  * fall back to a `static_remote_key` channel.
34540  *
34541  * LDK will not support the legacy `option_anchors` commitment version due to a discovered
34542  * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
34543  * Considered Harmful`] mailing list post.
34544  *
34545  * Default value: false. This value is likely to change to true in the future.
34546  *
34547  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
34548  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
34549  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
34550  * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
34551  */
34552 bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34553
34554 /**
34555  * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
34556  * channels. This feature requires having a reserve of onchain funds readily available to bump
34557  * transactions in the event of a channel force close to avoid the possibility of losing funds.
34558  *
34559  * Note that if you wish accept inbound channels with anchor outputs, you must enable
34560  * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
34561  * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
34562  * whether your reserve of onchain funds is enough to cover the fees for all existing and new
34563  * channels featuring anchor outputs in the event of a force close.
34564  *
34565  * If this option is set, channels may be created that will not be readable by LDK versions
34566  * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
34567  * [`DecodeError::InvalidValue`].
34568  *
34569  * Note that setting this to true does *not* prevent us from opening channels with
34570  * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
34571  * fall back to a `static_remote_key` channel.
34572  *
34573  * LDK will not support the legacy `option_anchors` commitment version due to a discovered
34574  * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
34575  * Considered Harmful`] mailing list post.
34576  *
34577  * Default value: false. This value is likely to change to true in the future.
34578  *
34579  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
34580  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
34581  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
34582  * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
34583  */
34584 void ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
34585
34586 /**
34587  * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
34588  *
34589  * Increasing the value can help improve liquidity and stability in
34590  * routing at the cost of higher long term disk / DB usage.
34591  *
34592  * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
34593  * other than the default value.
34594  *
34595  * Default value: 50
34596  * Maximum value: 483, any values larger will be treated as 483.
34597  *                     This is the BOLT #2 spec limit on `max_accepted_htlcs`.
34598  */
34599 uint16_t ChannelHandshakeConfig_get_our_max_accepted_htlcs(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34600
34601 /**
34602  * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
34603  *
34604  * Increasing the value can help improve liquidity and stability in
34605  * routing at the cost of higher long term disk / DB usage.
34606  *
34607  * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
34608  * other than the default value.
34609  *
34610  * Default value: 50
34611  * Maximum value: 483, any values larger will be treated as 483.
34612  *                     This is the BOLT #2 spec limit on `max_accepted_htlcs`.
34613  */
34614 void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
34615
34616 /**
34617  * Constructs a new ChannelHandshakeConfig given each field
34618  */
34619 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, uint8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool negotiate_scid_privacy_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg, uint32_t their_channel_reserve_proportional_millionths_arg, bool negotiate_anchors_zero_fee_htlc_tx_arg, uint16_t our_max_accepted_htlcs_arg);
34620
34621 /**
34622  * Creates a copy of the ChannelHandshakeConfig
34623  */
34624 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
34625
34626 /**
34627  * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
34628  */
34629 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
34630
34631 /**
34632  * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
34633  */
34634 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
34635
34636 /**
34637  * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
34638  * only applies to inbound channels.
34639  *
34640  * Default value: 0.
34641  */
34642 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34643
34644 /**
34645  * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
34646  * only applies to inbound channels.
34647  *
34648  * Default value: 0.
34649  */
34650 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
34651
34652 /**
34653  * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
34654  * only applies to inbound channels.
34655  *
34656  * Default value: 2^24 - 1.
34657  */
34658 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34659
34660 /**
34661  * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
34662  * only applies to inbound channels.
34663  *
34664  * Default value: 2^24 - 1.
34665  */
34666 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
34667
34668 /**
34669  * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
34670  * you to limit the maximum minimum-size they can require.
34671  *
34672  * Default value: u64::max_value.
34673  */
34674 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34675
34676 /**
34677  * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
34678  * you to limit the maximum minimum-size they can require.
34679  *
34680  * Default value: u64::max_value.
34681  */
34682 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
34683
34684 /**
34685  * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
34686  * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
34687  *
34688  * Default value: 0.
34689  */
34690 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34691
34692 /**
34693  * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
34694  * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
34695  *
34696  * Default value: 0.
34697  */
34698 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
34699
34700 /**
34701  * The remote node will require we keep a certain amount in direct payment to ourselves at all
34702  * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
34703  * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
34704  *
34705  * Default value: u64::max_value.
34706  */
34707 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34708
34709 /**
34710  * The remote node will require we keep a certain amount in direct payment to ourselves at all
34711  * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
34712  * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
34713  *
34714  * Default value: u64::max_value.
34715  */
34716 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
34717
34718 /**
34719  * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
34720  * time. This allows you to set a minimum such value.
34721  *
34722  * Default value: 0.
34723  */
34724 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34725
34726 /**
34727  * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
34728  * time. This allows you to set a minimum such value.
34729  *
34730  * Default value: 0.
34731  */
34732 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
34733
34734 /**
34735  * Before a channel is usable the funding transaction will need to be confirmed by at least a
34736  * certain number of blocks, specified by the node which is not the funder (as the funder can
34737  * assume they aren't going to double-spend themselves).
34738  * This config allows you to set a limit on the maximum amount of time to wait.
34739  *
34740  * Default value: 144, or roughly one day and only applies to outbound channels.
34741  */
34742 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34743
34744 /**
34745  * Before a channel is usable the funding transaction will need to be confirmed by at least a
34746  * certain number of blocks, specified by the node which is not the funder (as the funder can
34747  * assume they aren't going to double-spend themselves).
34748  * This config allows you to set a limit on the maximum amount of time to wait.
34749  *
34750  * Default value: 144, or roughly one day and only applies to outbound channels.
34751  */
34752 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
34753
34754 /**
34755  * Whether we implicitly trust funding transactions generated by us for our own outbound
34756  * channels to not be double-spent.
34757  *
34758  * If this is set, we assume that our own funding transactions are *never* double-spent, and
34759  * thus we can trust them without any confirmations. This is generally a reasonable
34760  * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
34761  * control of the signing keys).
34762  *
34763  * You may wish to un-set this if you allow the user to (or do in an automated fashion)
34764  * double-spend the funding transaction to RBF with an alternative channel open.
34765  *
34766  * This only applies if our counterparty set their confirmations-required value to 0, and we
34767  * always trust our own funding transaction at 1 confirmation irrespective of this value.
34768  * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
34769  * `true` (0) and `false` (1).
34770  *
34771  * Default value: true
34772  */
34773 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34774
34775 /**
34776  * Whether we implicitly trust funding transactions generated by us for our own outbound
34777  * channels to not be double-spent.
34778  *
34779  * If this is set, we assume that our own funding transactions are *never* double-spent, and
34780  * thus we can trust them without any confirmations. This is generally a reasonable
34781  * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
34782  * control of the signing keys).
34783  *
34784  * You may wish to un-set this if you allow the user to (or do in an automated fashion)
34785  * double-spend the funding transaction to RBF with an alternative channel open.
34786  *
34787  * This only applies if our counterparty set their confirmations-required value to 0, and we
34788  * always trust our own funding transaction at 1 confirmation irrespective of this value.
34789  * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
34790  * `true` (0) and `false` (1).
34791  *
34792  * Default value: true
34793  */
34794 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
34795
34796 /**
34797  * Set to force an incoming channel to match our announced channel preference in
34798  * [`ChannelHandshakeConfig::announced_channel`].
34799  *
34800  * For a node which is not online reliably, this should be set to true and
34801  * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
34802  * channels will ever be opened.
34803  *
34804  * Default value: true.
34805  */
34806 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34807
34808 /**
34809  * Set to force an incoming channel to match our announced channel preference in
34810  * [`ChannelHandshakeConfig::announced_channel`].
34811  *
34812  * For a node which is not online reliably, this should be set to true and
34813  * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
34814  * channels will ever be opened.
34815  *
34816  * Default value: true.
34817  */
34818 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
34819
34820 /**
34821  * Set to the amount of time we're willing to wait to claim money back to us.
34822  *
34823  * Not checking this value would be a security issue, as our peer would be able to set it to
34824  * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
34825  *
34826  * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
34827  * reduce the loss of having useless locked funds (if your peer accepts)
34828  */
34829 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34830
34831 /**
34832  * Set to the amount of time we're willing to wait to claim money back to us.
34833  *
34834  * Not checking this value would be a security issue, as our peer would be able to set it to
34835  * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
34836  *
34837  * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
34838  * reduce the loss of having useless locked funds (if your peer accepts)
34839  */
34840 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
34841
34842 /**
34843  * Constructs a new ChannelHandshakeLimits given each field
34844  */
34845 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_new(uint64_t min_funding_satoshis_arg, uint64_t max_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, uint32_t max_minimum_depth_arg, bool trust_own_funding_0conf_arg, bool force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg);
34846
34847 /**
34848  * Creates a copy of the ChannelHandshakeLimits
34849  */
34850 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
34851
34852 /**
34853  * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
34854  */
34855 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
34856
34857 /**
34858  * Frees any resources used by the MaxDustHTLCExposure
34859  */
34860 void MaxDustHTLCExposure_free(struct LDKMaxDustHTLCExposure this_ptr);
34861
34862 /**
34863  * Creates a copy of the MaxDustHTLCExposure
34864  */
34865 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_clone(const struct LDKMaxDustHTLCExposure *NONNULL_PTR orig);
34866
34867 /**
34868  * Utility method to constructs a new FixedLimitMsat-variant MaxDustHTLCExposure
34869  */
34870 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fixed_limit_msat(uint64_t a);
34871
34872 /**
34873  * Utility method to constructs a new FeeRateMultiplier-variant MaxDustHTLCExposure
34874  */
34875 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fee_rate_multiplier(uint64_t a);
34876
34877 /**
34878  * Checks if two MaxDustHTLCExposures contain equal inner contents.
34879  * This ignores pointers and is_owned flags and looks at the values in fields.
34880  */
34881 bool MaxDustHTLCExposure_eq(const struct LDKMaxDustHTLCExposure *NONNULL_PTR a, const struct LDKMaxDustHTLCExposure *NONNULL_PTR b);
34882
34883 /**
34884  * Serialize the MaxDustHTLCExposure object into a byte array which can be read by MaxDustHTLCExposure_read
34885  */
34886 struct LDKCVec_u8Z MaxDustHTLCExposure_write(const struct LDKMaxDustHTLCExposure *NONNULL_PTR obj);
34887
34888 /**
34889  * Read a MaxDustHTLCExposure from a byte array, created by MaxDustHTLCExposure_write
34890  */
34891 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ MaxDustHTLCExposure_read(struct LDKu8slice ser);
34892
34893 /**
34894  * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
34895  */
34896 void ChannelConfig_free(struct LDKChannelConfig this_obj);
34897
34898 /**
34899  * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
34900  * over the channel.
34901  * This may be allowed to change at runtime in a later update, however doing so must result in
34902  * update messages sent to notify all nodes of our updated relay fee.
34903  *
34904  * Default value: 0.
34905  */
34906 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34907
34908 /**
34909  * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
34910  * over the channel.
34911  * This may be allowed to change at runtime in a later update, however doing so must result in
34912  * update messages sent to notify all nodes of our updated relay fee.
34913  *
34914  * Default value: 0.
34915  */
34916 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
34917
34918 /**
34919  * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
34920  * excess of [`forwarding_fee_proportional_millionths`].
34921  * This may be allowed to change at runtime in a later update, however doing so must result in
34922  * update messages sent to notify all nodes of our updated relay fee.
34923  *
34924  * The default value of a single satoshi roughly matches the market rate on many routing nodes
34925  * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
34926  * this node.
34927  *
34928  * Default value: 1000.
34929  *
34930  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
34931  */
34932 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34933
34934 /**
34935  * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
34936  * excess of [`forwarding_fee_proportional_millionths`].
34937  * This may be allowed to change at runtime in a later update, however doing so must result in
34938  * update messages sent to notify all nodes of our updated relay fee.
34939  *
34940  * The default value of a single satoshi roughly matches the market rate on many routing nodes
34941  * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
34942  * this node.
34943  *
34944  * Default value: 1000.
34945  *
34946  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
34947  */
34948 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
34949
34950 /**
34951  * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
34952  * the channel this config applies to.
34953  *
34954  * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
34955  * HTLC balance when a channel appears on-chain whereas
34956  * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
34957  * (non-HTLC-encumbered) balance.
34958  *
34959  * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
34960  * we (or one of our watchtowers) MUST be online to check for broadcast of the current
34961  * commitment transaction at least once per this many blocks (minus some margin to allow us
34962  * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
34963  * the spending transaction).
34964  *
34965  * Default value: 72 (12 hours at an average of 6 blocks/hour).
34966  * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
34967  *                [`MIN_CLTV_EXPIRY_DELTA`] instead.
34968  *
34969  * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
34970  */
34971 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34972
34973 /**
34974  * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
34975  * the channel this config applies to.
34976  *
34977  * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
34978  * HTLC balance when a channel appears on-chain whereas
34979  * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
34980  * (non-HTLC-encumbered) balance.
34981  *
34982  * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
34983  * we (or one of our watchtowers) MUST be online to check for broadcast of the current
34984  * commitment transaction at least once per this many blocks (minus some margin to allow us
34985  * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
34986  * the spending transaction).
34987  *
34988  * Default value: 72 (12 hours at an average of 6 blocks/hour).
34989  * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
34990  *                [`MIN_CLTV_EXPIRY_DELTA`] instead.
34991  *
34992  * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
34993  */
34994 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
34995
34996 /**
34997  * Limit our total exposure to potential loss to on-chain fees on close, including in-flight
34998  * HTLCs which are burned to fees as they are too small to claim on-chain and fees on
34999  * commitment transaction(s) broadcasted by our counterparty in excess of our own fee estimate.
35000  *
35001  * # HTLC-based Dust Exposure
35002  *
35003  * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
35004  * not be claimable on-chain, instead being turned into additional miner fees if either
35005  * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
35006  * to such payments may be substantial if there are many dust HTLCs present when the
35007  * channel is force-closed.
35008  *
35009  * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
35010  * channel negotiated throughout the channel open process, along with the fees required to have
35011  * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
35012  * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
35013  * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
35014  * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
35015  * variant is primarily intended for use with pre-anchor channels.
35016  *
35017  * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
35018  * exposure across all three types per-channel.
35019  *
35020  * # Transaction Fee Dust Exposure
35021  *
35022  * Further, counterparties broadcasting a commitment transaction in a force-close may result
35023  * in other balance being burned to fees, and thus all fees on commitment and HTLC
35024  * transactions in excess of our local fee estimates are included in the dust calculation.
35025  *
35026  * Because of this, another way to look at this limit is to divide it by 43,000 (or 218,750
35027  * for non-anchor channels) and see it as the maximum feerate disagreement (in sats/vB) per
35028  * non-dust HTLC we're allowed to have with our peers before risking a force-closure for
35029  * inbound channels.
35030  *
35031  * Thus, for the default value of 10_000 * a current feerate estimate of 10 sat/vB (or 2,500
35032  * sat/KW), we risk force-closure if we disagree with our peer by:
35033  * * `10_000 * 2_500 / 43_000 / (483*2)` = 0.6 sat/vB for anchor channels with 483 HTLCs in
35034  *   both directions (the maximum),
35035  * * `10_000 * 2_500 / 43_000 / (50*2)` = 5.8 sat/vB for anchor channels with 50 HTLCs in both
35036  *   directions (the LDK default max from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
35037  * * `10_000 * 2_500 / 218_750 / (483*2)` = 0.1 sat/vB for non-anchor channels with 483 HTLCs
35038  *   in both directions (the maximum),
35039  * * `10_000 * 2_500 / 218_750 / (50*2)` = 1.1 sat/vB for non-anchor channels with 50 HTLCs
35040  *   in both (the LDK default maximum from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
35041  *
35042  * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement
35043  * will scale linearly with increases (or decreases) in the our feerate estimates. Further,
35044  * for anchor channels we expect our counterparty to use a relatively low feerate estimate
35045  * while we use [`ConfirmationTarget::OnChainSweep`] (which should be relatively high) and
35046  * feerate disagreement force-closures should only occur when theirs is higher than ours.
35047  *
35048  * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 10_000.
35049  *
35050  * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
35051  */
35052 struct LDKMaxDustHTLCExposure ChannelConfig_get_max_dust_htlc_exposure(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
35053
35054 /**
35055  * Limit our total exposure to potential loss to on-chain fees on close, including in-flight
35056  * HTLCs which are burned to fees as they are too small to claim on-chain and fees on
35057  * commitment transaction(s) broadcasted by our counterparty in excess of our own fee estimate.
35058  *
35059  * # HTLC-based Dust Exposure
35060  *
35061  * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
35062  * not be claimable on-chain, instead being turned into additional miner fees if either
35063  * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
35064  * to such payments may be substantial if there are many dust HTLCs present when the
35065  * channel is force-closed.
35066  *
35067  * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
35068  * channel negotiated throughout the channel open process, along with the fees required to have
35069  * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
35070  * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
35071  * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
35072  * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
35073  * variant is primarily intended for use with pre-anchor channels.
35074  *
35075  * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
35076  * exposure across all three types per-channel.
35077  *
35078  * # Transaction Fee Dust Exposure
35079  *
35080  * Further, counterparties broadcasting a commitment transaction in a force-close may result
35081  * in other balance being burned to fees, and thus all fees on commitment and HTLC
35082  * transactions in excess of our local fee estimates are included in the dust calculation.
35083  *
35084  * Because of this, another way to look at this limit is to divide it by 43,000 (or 218,750
35085  * for non-anchor channels) and see it as the maximum feerate disagreement (in sats/vB) per
35086  * non-dust HTLC we're allowed to have with our peers before risking a force-closure for
35087  * inbound channels.
35088  *
35089  * Thus, for the default value of 10_000 * a current feerate estimate of 10 sat/vB (or 2,500
35090  * sat/KW), we risk force-closure if we disagree with our peer by:
35091  * * `10_000 * 2_500 / 43_000 / (483*2)` = 0.6 sat/vB for anchor channels with 483 HTLCs in
35092  *   both directions (the maximum),
35093  * * `10_000 * 2_500 / 43_000 / (50*2)` = 5.8 sat/vB for anchor channels with 50 HTLCs in both
35094  *   directions (the LDK default max from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
35095  * * `10_000 * 2_500 / 218_750 / (483*2)` = 0.1 sat/vB for non-anchor channels with 483 HTLCs
35096  *   in both directions (the maximum),
35097  * * `10_000 * 2_500 / 218_750 / (50*2)` = 1.1 sat/vB for non-anchor channels with 50 HTLCs
35098  *   in both (the LDK default maximum from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
35099  *
35100  * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement
35101  * will scale linearly with increases (or decreases) in the our feerate estimates. Further,
35102  * for anchor channels we expect our counterparty to use a relatively low feerate estimate
35103  * while we use [`ConfirmationTarget::OnChainSweep`] (which should be relatively high) and
35104  * feerate disagreement force-closures should only occur when theirs is higher than ours.
35105  *
35106  * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 10_000.
35107  *
35108  * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
35109  */
35110 void ChannelConfig_set_max_dust_htlc_exposure(struct LDKChannelConfig *NONNULL_PTR this_ptr, struct LDKMaxDustHTLCExposure val);
35111
35112 /**
35113  * The additional fee we're willing to pay to avoid waiting for the counterparty's
35114  * `to_self_delay` to reclaim funds.
35115  *
35116  * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
35117  * closing transaction which both sides find acceptable, ultimately paid by the channel
35118  * funder/initiator.
35119  *
35120  * When we are the funder, because we have to pay the channel closing fee, we bound the
35121  * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
35122  * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
35123  * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
35124  * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
35125  * funds.
35126  *
35127  * When we are not the funder, we require the closing transaction fee pay at least our
35128  * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
35129  * Thus, this value is ignored when we are not the funder.
35130  *
35131  * Default value: 1000 satoshis.
35132  *
35133  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
35134  * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
35135  */
35136 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
35137
35138 /**
35139  * The additional fee we're willing to pay to avoid waiting for the counterparty's
35140  * `to_self_delay` to reclaim funds.
35141  *
35142  * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
35143  * closing transaction which both sides find acceptable, ultimately paid by the channel
35144  * funder/initiator.
35145  *
35146  * When we are the funder, because we have to pay the channel closing fee, we bound the
35147  * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
35148  * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
35149  * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
35150  * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
35151  * funds.
35152  *
35153  * When we are not the funder, we require the closing transaction fee pay at least our
35154  * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
35155  * Thus, this value is ignored when we are not the funder.
35156  *
35157  * Default value: 1000 satoshis.
35158  *
35159  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
35160  * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
35161  */
35162 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
35163
35164 /**
35165  * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
35166  * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
35167  *
35168  * Usage:
35169  * - The payee will set this option and set its invoice route hints to use [intercept scids]
35170  *   generated by this channel's counterparty.
35171  * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
35172  *   [`forward_intercepted_htlc`] with less than the amount provided in
35173  *   [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
35174  *   actual forward amounts is their fee. See
35175  *   <https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2#flow-lsp-trusts-client-model>
35176  *   for how this feature may be used in the LSP use case.
35177  *
35178  * # Note
35179  * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
35180  * as-expected if this feature is activated, otherwise they may lose money!
35181  * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
35182  * counterparty.
35183  *
35184  * # Note
35185  * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
35186  * Unsetting this flag between restarts may lead to payment receive failures.
35187  *
35188  * Default value: false.
35189  *
35190  * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
35191  * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
35192  * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
35193  * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
35194  * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
35195  * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
35196  */
35197 bool ChannelConfig_get_accept_underpaying_htlcs(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
35198
35199 /**
35200  * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
35201  * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
35202  *
35203  * Usage:
35204  * - The payee will set this option and set its invoice route hints to use [intercept scids]
35205  *   generated by this channel's counterparty.
35206  * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
35207  *   [`forward_intercepted_htlc`] with less than the amount provided in
35208  *   [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
35209  *   actual forward amounts is their fee. See
35210  *   <https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2#flow-lsp-trusts-client-model>
35211  *   for how this feature may be used in the LSP use case.
35212  *
35213  * # Note
35214  * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
35215  * as-expected if this feature is activated, otherwise they may lose money!
35216  * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
35217  * counterparty.
35218  *
35219  * # Note
35220  * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
35221  * Unsetting this flag between restarts may lead to payment receive failures.
35222  *
35223  * Default value: false.
35224  *
35225  * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
35226  * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
35227  * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
35228  * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
35229  * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
35230  * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
35231  */
35232 void ChannelConfig_set_accept_underpaying_htlcs(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
35233
35234 /**
35235  * Constructs a new ChannelConfig given each field
35236  */
35237 MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t forwarding_fee_proportional_millionths_arg, uint32_t forwarding_fee_base_msat_arg, uint16_t cltv_expiry_delta_arg, struct LDKMaxDustHTLCExposure max_dust_htlc_exposure_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg, bool accept_underpaying_htlcs_arg);
35238
35239 /**
35240  * Creates a copy of the ChannelConfig
35241  */
35242 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
35243
35244 /**
35245  * Checks if two ChannelConfigs contain equal inner contents.
35246  * This ignores pointers and is_owned flags and looks at the values in fields.
35247  * Two objects with NULL inner values will be considered "equal" here.
35248  */
35249 bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
35250
35251 /**
35252  * Applies the given [`ChannelConfigUpdate`] as a partial update to the [`ChannelConfig`].
35253  */
35254 void ChannelConfig_apply(struct LDKChannelConfig *NONNULL_PTR this_arg, const struct LDKChannelConfigUpdate *NONNULL_PTR update);
35255
35256 /**
35257  * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
35258  */
35259 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
35260
35261 /**
35262  * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
35263  */
35264 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
35265
35266 /**
35267  * Read a ChannelConfig from a byte array, created by ChannelConfig_write
35268  */
35269 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
35270
35271 /**
35272  * Frees any resources used by the ChannelConfigUpdate, if is_owned is set and inner is non-NULL.
35273  */
35274 void ChannelConfigUpdate_free(struct LDKChannelConfigUpdate this_obj);
35275
35276 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
35277
35278 void ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
35279
35280 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_base_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
35281
35282 void ChannelConfigUpdate_set_forwarding_fee_base_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
35283
35284 struct LDKCOption_u16Z ChannelConfigUpdate_get_cltv_expiry_delta(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
35285
35286 void ChannelConfigUpdate_set_cltv_expiry_delta(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
35287
35288 /**
35289  *
35290  * Returns a copy of the field.
35291  */
35292 struct LDKCOption_MaxDustHTLCExposureZ ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
35293
35294 void ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_MaxDustHTLCExposureZ val);
35295
35296 struct LDKCOption_u64Z ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
35297
35298 void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
35299
35300 /**
35301  * Constructs a new ChannelConfigUpdate given each field
35302  */
35303 MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_new(struct LDKCOption_u32Z forwarding_fee_proportional_millionths_arg, struct LDKCOption_u32Z forwarding_fee_base_msat_arg, struct LDKCOption_u16Z cltv_expiry_delta_arg, struct LDKCOption_MaxDustHTLCExposureZ max_dust_htlc_exposure_msat_arg, struct LDKCOption_u64Z force_close_avoidance_max_fee_satoshis_arg);
35304
35305 /**
35306  * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used.
35307  */
35308 MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_default(void);
35309
35310 /**
35311  * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
35312  */
35313 void UserConfig_free(struct LDKUserConfig this_obj);
35314
35315 /**
35316  * Channel handshake config that we propose to our counterparty.
35317  */
35318 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
35319
35320 /**
35321  * Channel handshake config that we propose to our counterparty.
35322  */
35323 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
35324
35325 /**
35326  * Limits applied to our counterparty's proposed channel handshake config settings.
35327  */
35328 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
35329
35330 /**
35331  * Limits applied to our counterparty's proposed channel handshake config settings.
35332  */
35333 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
35334
35335 /**
35336  * Channel config which affects behavior during channel lifetime.
35337  */
35338 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
35339
35340 /**
35341  * Channel config which affects behavior during channel lifetime.
35342  */
35343 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
35344
35345 /**
35346  * If this is set to false, we will reject any HTLCs which were to be forwarded over private
35347  * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
35348  * node which is not online reliably.
35349  *
35350  * For nodes which are not online reliably, you should set all channels to *not* be announced
35351  * (using [`ChannelHandshakeConfig::announced_channel`] and
35352  * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
35353  * ensure you are not exposed to any forwarding risk.
35354  *
35355  * Note that because you cannot change a channel's announced state after creation, there is no
35356  * way to disable forwarding on public channels retroactively. Thus, in order to change a node
35357  * from a publicly-announced forwarding node to a private non-forwarding node you must close
35358  * all your channels and open new ones. For privacy, you should also change your node_id
35359  * (swapping all private and public key material for new ones) at that time.
35360  *
35361  * Default value: false.
35362  */
35363 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
35364
35365 /**
35366  * If this is set to false, we will reject any HTLCs which were to be forwarded over private
35367  * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
35368  * node which is not online reliably.
35369  *
35370  * For nodes which are not online reliably, you should set all channels to *not* be announced
35371  * (using [`ChannelHandshakeConfig::announced_channel`] and
35372  * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
35373  * ensure you are not exposed to any forwarding risk.
35374  *
35375  * Note that because you cannot change a channel's announced state after creation, there is no
35376  * way to disable forwarding on public channels retroactively. Thus, in order to change a node
35377  * from a publicly-announced forwarding node to a private non-forwarding node you must close
35378  * all your channels and open new ones. For privacy, you should also change your node_id
35379  * (swapping all private and public key material for new ones) at that time.
35380  *
35381  * Default value: false.
35382  */
35383 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
35384
35385 /**
35386  * If this is set to false, we do not accept inbound requests to open a new channel.
35387  * Default value: true.
35388  */
35389 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
35390
35391 /**
35392  * If this is set to false, we do not accept inbound requests to open a new channel.
35393  * Default value: true.
35394  */
35395 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
35396
35397 /**
35398  * If this is set to true, the user needs to manually accept inbound requests to open a new
35399  * channel.
35400  *
35401  * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
35402  * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
35403  * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
35404  * user explicitly chooses to accept the request.
35405  *
35406  * Default value: false.
35407  *
35408  * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
35409  * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
35410  * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
35411  */
35412 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
35413
35414 /**
35415  * If this is set to true, the user needs to manually accept inbound requests to open a new
35416  * channel.
35417  *
35418  * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
35419  * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
35420  * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
35421  * user explicitly chooses to accept the request.
35422  *
35423  * Default value: false.
35424  *
35425  * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
35426  * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
35427  * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
35428  */
35429 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
35430
35431 /**
35432  *  If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
35433  *  fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
35434  *  intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
35435  *
35436  *  Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
35437  *
35438  *  Default value: false.
35439  *
35440  * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
35441  * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
35442  */
35443 bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr);
35444
35445 /**
35446  *  If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
35447  *  fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
35448  *  intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
35449  *
35450  *  Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
35451  *
35452  *  Default value: false.
35453  *
35454  * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
35455  * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
35456  */
35457 void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
35458
35459 /**
35460  * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
35461  * parts. If this is set to true, we'll accept the payment.
35462  *
35463  * Setting this to true will break backwards compatibility upon downgrading to an LDK
35464  * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
35465  * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
35466  *
35467  * Default value: false.
35468  *
35469  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
35470  */
35471 bool UserConfig_get_accept_mpp_keysend(const struct LDKUserConfig *NONNULL_PTR this_ptr);
35472
35473 /**
35474  * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
35475  * parts. If this is set to true, we'll accept the payment.
35476  *
35477  * Setting this to true will break backwards compatibility upon downgrading to an LDK
35478  * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
35479  * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
35480  *
35481  * Default value: false.
35482  *
35483  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
35484  */
35485 void UserConfig_set_accept_mpp_keysend(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
35486
35487 /**
35488  * Constructs a new UserConfig given each field
35489  */
35490 MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig channel_handshake_config_arg, struct LDKChannelHandshakeLimits channel_handshake_limits_arg, struct LDKChannelConfig channel_config_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg, bool manually_accept_inbound_channels_arg, bool accept_intercept_htlcs_arg, bool accept_mpp_keysend_arg);
35491
35492 /**
35493  * Creates a copy of the UserConfig
35494  */
35495 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
35496
35497 /**
35498  * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
35499  */
35500 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
35501
35502 /**
35503  * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
35504  */
35505 void BestBlock_free(struct LDKBestBlock this_obj);
35506
35507 /**
35508  * The block's hash
35509  */
35510 const uint8_t (*BestBlock_get_block_hash(const struct LDKBestBlock *NONNULL_PTR this_ptr))[32];
35511
35512 /**
35513  * The block's hash
35514  */
35515 void BestBlock_set_block_hash(struct LDKBestBlock *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35516
35517 /**
35518  * The height at which the block was confirmed.
35519  */
35520 uint32_t BestBlock_get_height(const struct LDKBestBlock *NONNULL_PTR this_ptr);
35521
35522 /**
35523  * The height at which the block was confirmed.
35524  */
35525 void BestBlock_set_height(struct LDKBestBlock *NONNULL_PTR this_ptr, uint32_t val);
35526
35527 /**
35528  * Constructs a new BestBlock given each field
35529  */
35530 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash_arg, uint32_t height_arg);
35531
35532 /**
35533  * Creates a copy of the BestBlock
35534  */
35535 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
35536
35537 /**
35538  * Generates a non-cryptographic 64-bit hash of the BestBlock.
35539  */
35540 uint64_t BestBlock_hash(const struct LDKBestBlock *NONNULL_PTR o);
35541
35542 /**
35543  * Checks if two BestBlocks contain equal inner contents.
35544  * This ignores pointers and is_owned flags and looks at the values in fields.
35545  * Two objects with NULL inner values will be considered "equal" here.
35546  */
35547 bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
35548
35549 /**
35550  * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
35551  * network.
35552  */
35553 MUST_USE_RES struct LDKBestBlock BestBlock_from_network(enum LDKNetwork network);
35554
35555 /**
35556  * Serialize the BestBlock object into a byte array which can be read by BestBlock_read
35557  */
35558 struct LDKCVec_u8Z BestBlock_write(const struct LDKBestBlock *NONNULL_PTR obj);
35559
35560 /**
35561  * Read a BestBlock from a byte array, created by BestBlock_write
35562  */
35563 struct LDKCResult_BestBlockDecodeErrorZ BestBlock_read(struct LDKu8slice ser);
35564
35565 /**
35566  * Calls the free function if one is set
35567  */
35568 void Listen_free(struct LDKListen this_ptr);
35569
35570 /**
35571  * Calls the free function if one is set
35572  */
35573 void Confirm_free(struct LDKConfirm this_ptr);
35574
35575 /**
35576  * Creates a copy of the ChannelMonitorUpdateStatus
35577  */
35578 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
35579
35580 /**
35581  * Utility method to constructs a new Completed-variant ChannelMonitorUpdateStatus
35582  */
35583 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
35584
35585 /**
35586  * Utility method to constructs a new InProgress-variant ChannelMonitorUpdateStatus
35587  */
35588 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
35589
35590 /**
35591  * Utility method to constructs a new UnrecoverableError-variant ChannelMonitorUpdateStatus
35592  */
35593 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_unrecoverable_error(void);
35594
35595 /**
35596  * Checks if two ChannelMonitorUpdateStatuss contain equal inner contents.
35597  * This ignores pointers and is_owned flags and looks at the values in fields.
35598  */
35599 bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
35600
35601 /**
35602  * Calls the free function if one is set
35603  */
35604 void Watch_free(struct LDKWatch this_ptr);
35605
35606 /**
35607  * Calls the free function if one is set
35608  */
35609 void Filter_free(struct LDKFilter this_ptr);
35610
35611 /**
35612  * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
35613  */
35614 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
35615
35616 /**
35617  * First block where the transaction output may have been spent.
35618  */
35619 struct LDKCOption_ThirtyTwoBytesZ WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
35620
35621 /**
35622  * First block where the transaction output may have been spent.
35623  */
35624 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
35625
35626 /**
35627  * Outpoint identifying the transaction output.
35628  */
35629 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
35630
35631 /**
35632  * Outpoint identifying the transaction output.
35633  */
35634 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
35635
35636 /**
35637  * Spending condition of the transaction output.
35638  */
35639 struct LDKCVec_u8Z WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
35640
35641 /**
35642  * Spending condition of the transaction output.
35643  */
35644 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
35645
35646 /**
35647  * Constructs a new WatchedOutput given each field
35648  */
35649 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKCOption_ThirtyTwoBytesZ block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
35650
35651 /**
35652  * Creates a copy of the WatchedOutput
35653  */
35654 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
35655
35656 /**
35657  * Checks if two WatchedOutputs contain equal inner contents.
35658  * This ignores pointers and is_owned flags and looks at the values in fields.
35659  * Two objects with NULL inner values will be considered "equal" here.
35660  */
35661 bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
35662
35663 /**
35664  * Generates a non-cryptographic 64-bit hash of the WatchedOutput.
35665  */
35666 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
35667
35668 /**
35669  * Calls the free function if one is set
35670  */
35671 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
35672
35673 /**
35674  * Creates a copy of the ConfirmationTarget
35675  */
35676 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
35677
35678 /**
35679  * Utility method to constructs a new OnChainSweep-variant ConfirmationTarget
35680  */
35681 enum LDKConfirmationTarget ConfirmationTarget_on_chain_sweep(void);
35682
35683 /**
35684  * Utility method to constructs a new MinAllowedAnchorChannelRemoteFee-variant ConfirmationTarget
35685  */
35686 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_anchor_channel_remote_fee(void);
35687
35688 /**
35689  * Utility method to constructs a new MinAllowedNonAnchorChannelRemoteFee-variant ConfirmationTarget
35690  */
35691 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee(void);
35692
35693 /**
35694  * Utility method to constructs a new AnchorChannelFee-variant ConfirmationTarget
35695  */
35696 enum LDKConfirmationTarget ConfirmationTarget_anchor_channel_fee(void);
35697
35698 /**
35699  * Utility method to constructs a new NonAnchorChannelFee-variant ConfirmationTarget
35700  */
35701 enum LDKConfirmationTarget ConfirmationTarget_non_anchor_channel_fee(void);
35702
35703 /**
35704  * Utility method to constructs a new ChannelCloseMinimum-variant ConfirmationTarget
35705  */
35706 enum LDKConfirmationTarget ConfirmationTarget_channel_close_minimum(void);
35707
35708 /**
35709  * Utility method to constructs a new OutputSpendingFee-variant ConfirmationTarget
35710  */
35711 enum LDKConfirmationTarget ConfirmationTarget_output_spending_fee(void);
35712
35713 /**
35714  * Generates a non-cryptographic 64-bit hash of the ConfirmationTarget.
35715  */
35716 uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o);
35717
35718 /**
35719  * Checks if two ConfirmationTargets contain equal inner contents.
35720  * This ignores pointers and is_owned flags and looks at the values in fields.
35721  */
35722 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
35723
35724 /**
35725  * Calls the free function if one is set
35726  */
35727 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
35728
35729 /**
35730  * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
35731  */
35732 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
35733
35734 /**
35735  * Creates a copy of the MonitorUpdateId
35736  */
35737 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
35738
35739 /**
35740  * Generates a non-cryptographic 64-bit hash of the MonitorUpdateId.
35741  */
35742 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
35743
35744 /**
35745  * Checks if two MonitorUpdateIds contain equal inner contents.
35746  * This ignores pointers and is_owned flags and looks at the values in fields.
35747  * Two objects with NULL inner values will be considered "equal" here.
35748  */
35749 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
35750
35751 /**
35752  * Calls the free function if one is set
35753  */
35754 void Persist_free(struct LDKPersist this_ptr);
35755
35756 /**
35757  * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
35758  */
35759 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
35760
35761 /**
35762  * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
35763  */
35764 void ChainMonitor_free(struct LDKChainMonitor this_obj);
35765
35766 /**
35767  * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
35768  *
35769  * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
35770  * will call back to it indicating transactions and outputs of interest. This allows clients to
35771  * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
35772  * always need to fetch full blocks absent another means for determining which blocks contain
35773  * transactions relevant to the watched channels.
35774  */
35775 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
35776
35777 /**
35778  * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
35779  * claims which are awaiting confirmation.
35780  *
35781  * Includes the balances from each [`ChannelMonitor`] *except* those included in
35782  * `ignored_channels`, allowing you to filter out balances from channels which are still open
35783  * (and whose balance should likely be pulled from the [`ChannelDetails`]).
35784  *
35785  * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
35786  * inclusion in the return value.
35787  */
35788 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
35789
35790 /**
35791  * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
35792  * such [`ChannelMonitor`] is currently being monitored for.
35793  *
35794  * Note that the result holds a mutex over our monitor set, and should not be held
35795  * indefinitely.
35796  */
35797 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
35798
35799 /**
35800  * Lists the funding outpoint and channel ID of each [`ChannelMonitor`] being monitored.
35801  *
35802  * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
35803  * monitoring for on-chain state resolutions.
35804  */
35805 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointChannelIdZZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35806
35807 /**
35808  * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored).
35809  */
35810 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35811
35812 /**
35813  * Indicates the persistence of a [`ChannelMonitor`] has completed after
35814  * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
35815  *
35816  * Thus, the anticipated use is, at a high level:
35817  *  1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
35818  *     update to disk and begins updating any remote (e.g. watchtower/backup) copies,
35819  *     returning [`ChannelMonitorUpdateStatus::InProgress`],
35820  *  2) once all remote copies are updated, you call this function with the
35821  *     `completed_update_id` that completed, and once all pending updates have completed the
35822  *     channel will be re-enabled.
35823  *
35824  * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
35825  * registered [`ChannelMonitor`]s.
35826  */
35827 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChainMonitor_channel_monitor_updated(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKMonitorUpdateId completed_update_id);
35828
35829 /**
35830  * Gets a [`Future`] that completes when an event is available either via
35831  * [`chain::Watch::release_pending_monitor_events`] or
35832  * [`EventsProvider::process_pending_events`].
35833  *
35834  * Note that callbacks registered on the [`Future`] MUST NOT call back into this
35835  * [`ChainMonitor`] and should instead register actions to be taken later.
35836  *
35837  * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events
35838  */
35839 MUST_USE_RES struct LDKFuture ChainMonitor_get_update_future(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35840
35841 /**
35842  * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
35843  * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
35844  * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
35845  * invoking this every 30 seconds, or lower if running in an environment with spotty
35846  * connections, like on mobile.
35847  */
35848 void ChainMonitor_rebroadcast_pending_claims(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35849
35850 /**
35851  * Triggers rebroadcasts of pending claims from force-closed channels after a transaction
35852  * signature generation failure.
35853  *
35854  * `monitor_opt` can be used as a filter to only trigger them for a specific channel monitor.
35855  *
35856  * Note that monitor_opt (or a relevant inner pointer) may be NULL or all-0s to represent None
35857  */
35858 void ChainMonitor_signer_unblocked(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint monitor_opt);
35859
35860 /**
35861  * Archives fully resolved channel monitors by calling [`Persist::archive_persisted_channel`].
35862  *
35863  * This is useful for pruning fully resolved monitors from the monitor set and primary
35864  * storage so they are not kept in memory and reloaded on restart.
35865  *
35866  * Should be called occasionally (once every handful of blocks or on startup).
35867  *
35868  * Depending on the implementation of [`Persist::archive_persisted_channel`] the monitor
35869  * data could be moved to an archive location or removed entirely.
35870  */
35871 void ChainMonitor_archive_fully_resolved_channel_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35872
35873 /**
35874  * Constructs a new Listen which calls the relevant methods on this_arg.
35875  * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
35876  */
35877 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35878
35879 /**
35880  * Constructs a new Confirm which calls the relevant methods on this_arg.
35881  * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
35882  */
35883 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35884
35885 /**
35886  * Constructs a new Watch which calls the relevant methods on this_arg.
35887  * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
35888  */
35889 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35890
35891 /**
35892  * Constructs a new EventsProvider which calls the relevant methods on this_arg.
35893  * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
35894  */
35895 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35896
35897 /**
35898  * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
35899  */
35900 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
35901
35902 /**
35903  * The sequence number of this update. Updates *must* be replayed in-order according to this
35904  * sequence number (and updates may panic if they are not). The update_id values are strictly
35905  * increasing and increase by one for each new update, with two exceptions specified below.
35906  *
35907  * This sequence number is also used to track up to which points updates which returned
35908  * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
35909  * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
35910  *
35911  * The only instances we allow where update_id values are not strictly increasing have a
35912  * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
35913  * will force close the channel by broadcasting the latest commitment transaction or
35914  * special post-force-close updates, like providing preimages necessary to claim outputs on the
35915  * broadcast commitment transaction. See its docs for more details.
35916  *
35917  * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
35918  */
35919 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
35920
35921 /**
35922  * The sequence number of this update. Updates *must* be replayed in-order according to this
35923  * sequence number (and updates may panic if they are not). The update_id values are strictly
35924  * increasing and increase by one for each new update, with two exceptions specified below.
35925  *
35926  * This sequence number is also used to track up to which points updates which returned
35927  * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
35928  * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
35929  *
35930  * The only instances we allow where update_id values are not strictly increasing have a
35931  * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
35932  * will force close the channel by broadcasting the latest commitment transaction or
35933  * special post-force-close updates, like providing preimages necessary to claim outputs on the
35934  * broadcast commitment transaction. See its docs for more details.
35935  *
35936  * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
35937  */
35938 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
35939
35940 /**
35941  * The channel ID associated with these updates.
35942  *
35943  * Will be `None` for `ChannelMonitorUpdate`s constructed on LDK versions prior to 0.0.121 and
35944  * always `Some` otherwise.
35945  *
35946  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35947  */
35948 struct LDKChannelId ChannelMonitorUpdate_get_channel_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
35949
35950 /**
35951  * The channel ID associated with these updates.
35952  *
35953  * Will be `None` for `ChannelMonitorUpdate`s constructed on LDK versions prior to 0.0.121 and
35954  * always `Some` otherwise.
35955  *
35956  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
35957  */
35958 void ChannelMonitorUpdate_set_channel_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, struct LDKChannelId val);
35959
35960 /**
35961  * Creates a copy of the ChannelMonitorUpdate
35962  */
35963 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
35964
35965 /**
35966  * Checks if two ChannelMonitorUpdates contain equal inner contents.
35967  * This ignores pointers and is_owned flags and looks at the values in fields.
35968  * Two objects with NULL inner values will be considered "equal" here.
35969  */
35970 bool ChannelMonitorUpdate_eq(const struct LDKChannelMonitorUpdate *NONNULL_PTR a, const struct LDKChannelMonitorUpdate *NONNULL_PTR b);
35971
35972 /**
35973  * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
35974  */
35975 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
35976
35977 /**
35978  * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
35979  */
35980 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
35981
35982 /**
35983  * Frees any resources used by the MonitorEvent
35984  */
35985 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
35986
35987 /**
35988  * Creates a copy of the MonitorEvent
35989  */
35990 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
35991
35992 /**
35993  * Utility method to constructs a new HTLCEvent-variant MonitorEvent
35994  */
35995 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
35996
35997 /**
35998  * Utility method to constructs a new HolderForceClosedWithInfo-variant MonitorEvent
35999  */
36000 struct LDKMonitorEvent MonitorEvent_holder_force_closed_with_info(struct LDKClosureReason reason, struct LDKOutPoint outpoint, struct LDKChannelId channel_id);
36001
36002 /**
36003  * Utility method to constructs a new HolderForceClosed-variant MonitorEvent
36004  */
36005 struct LDKMonitorEvent MonitorEvent_holder_force_closed(struct LDKOutPoint a);
36006
36007 /**
36008  * Utility method to constructs a new Completed-variant MonitorEvent
36009  */
36010 struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, struct LDKChannelId channel_id, uint64_t monitor_update_id);
36011
36012 /**
36013  * Checks if two MonitorEvents contain equal inner contents.
36014  * This ignores pointers and is_owned flags and looks at the values in fields.
36015  */
36016 bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
36017
36018 /**
36019  * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
36020  */
36021 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
36022
36023 /**
36024  * Read a MonitorEvent from a byte array, created by MonitorEvent_write
36025  */
36026 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
36027
36028 /**
36029  * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
36030  */
36031 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
36032
36033 /**
36034  * Creates a copy of the HTLCUpdate
36035  */
36036 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
36037
36038 /**
36039  * Checks if two HTLCUpdates contain equal inner contents.
36040  * This ignores pointers and is_owned flags and looks at the values in fields.
36041  * Two objects with NULL inner values will be considered "equal" here.
36042  */
36043 bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
36044
36045 /**
36046  * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
36047  */
36048 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
36049
36050 /**
36051  * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
36052  */
36053 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
36054
36055 /**
36056  * Frees any resources used by the Balance
36057  */
36058 void Balance_free(struct LDKBalance this_ptr);
36059
36060 /**
36061  * Creates a copy of the Balance
36062  */
36063 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
36064
36065 /**
36066  * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
36067  */
36068 struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis);
36069
36070 /**
36071  * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
36072  */
36073 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height);
36074
36075 /**
36076  * Utility method to constructs a new ContentiousClaimable-variant Balance
36077  */
36078 struct LDKBalance Balance_contentious_claimable(uint64_t amount_satoshis, uint32_t timeout_height, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage);
36079
36080 /**
36081  * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
36082  */
36083 struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash);
36084
36085 /**
36086  * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
36087  */
36088 struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t amount_satoshis, uint32_t expiry_height, struct LDKThirtyTwoBytes payment_hash);
36089
36090 /**
36091  * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
36092  */
36093 struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t amount_satoshis);
36094
36095 /**
36096  * Checks if two Balances contain equal inner contents.
36097  * This ignores pointers and is_owned flags and looks at the values in fields.
36098  */
36099 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
36100
36101 /**
36102  * The amount claimable, in satoshis. This excludes balances that we are unsure if we are able
36103  * to claim, this is because we are waiting for a preimage or for a timeout to expire. For more
36104  * information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and
36105  * [`Balance::MaybePreimageClaimableHTLC`].
36106  *
36107  * On-chain fees required to claim the balance are not included in this amount.
36108  */
36109 MUST_USE_RES uint64_t Balance_claimable_amount_satoshis(const struct LDKBalance *NONNULL_PTR this_arg);
36110
36111 /**
36112  * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
36113  */
36114 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
36115
36116 /**
36117  * Creates a copy of the ChannelMonitor
36118  */
36119 struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig);
36120
36121 /**
36122  * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
36123  */
36124 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
36125
36126 /**
36127  * Updates a ChannelMonitor on the basis of some new information provided by the Channel
36128  * itself.
36129  *
36130  * panics if the given update is not the next update by update_id.
36131  */
36132 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelMonitor_update_monitor(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR updates, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
36133
36134 /**
36135  * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
36136  * ChannelMonitor.
36137  */
36138 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36139
36140 /**
36141  * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
36142  */
36143 MUST_USE_RES struct LDKC2Tuple_OutPointCVec_u8ZZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36144
36145 /**
36146  * Gets the channel_id of the channel this ChannelMonitor is monitoring for.
36147  */
36148 MUST_USE_RES struct LDKChannelId ChannelMonitor_channel_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36149
36150 /**
36151  * Gets a list of txids, with their output scripts (in the order they appear in the
36152  * transaction), which we must learn about spends of via block_connected().
36153  */
36154 MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36155
36156 /**
36157  * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
36158  * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
36159  * have been registered.
36160  */
36161 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter, const struct LDKLogger *NONNULL_PTR logger);
36162
36163 /**
36164  * Get the list of HTLCs who's status has been updated on chain. This should be called by
36165  * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
36166  */
36167 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36168
36169 /**
36170  * Processes [`SpendableOutputs`] events produced from each [`ChannelMonitor`] upon maturity.
36171  *
36172  * For channels featuring anchor outputs, this method will also process [`BumpTransaction`]
36173  * events produced from each [`ChannelMonitor`] while there is a balance to claim onchain
36174  * within each channel. As the confirmation of a commitment transaction may be critical to the
36175  * safety of funds, we recommend invoking this every 30 seconds, or lower if running in an
36176  * environment with spotty connections, like on mobile.
36177  *
36178  * An [`EventHandler`] may safely call back to the provider, though this shouldn't be needed in
36179  * order to handle these events.
36180  *
36181  * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
36182  * [`BumpTransaction`]: crate::events::Event::BumpTransaction
36183  */
36184 void ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler);
36185
36186 /**
36187  * Gets the counterparty's initial commitment transaction. The returned commitment
36188  * transaction is unsigned. This is intended to be called during the initial persistence of
36189  * the monitor (inside an implementation of [`Persist::persist_new_channel`]), to allow for
36190  * watchtowers in the persistence pipeline to have enough data to form justice transactions.
36191  *
36192  * This is similar to [`Self::counterparty_commitment_txs_from_update`], except
36193  * that for the initial commitment transaction, we don't have a corresponding update.
36194  *
36195  * This will only return `Some` for channel monitors that have been created after upgrading
36196  * to LDK 0.0.117+.
36197  *
36198  * [`Persist::persist_new_channel`]: crate::chain::chainmonitor::Persist::persist_new_channel
36199  *
36200  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36201  */
36202 MUST_USE_RES struct LDKCommitmentTransaction ChannelMonitor_initial_counterparty_commitment_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36203
36204 /**
36205  * Gets all of the counterparty commitment transactions provided by the given update. This
36206  * may be empty if the update doesn't include any new counterparty commitments. Returned
36207  * commitment transactions are unsigned.
36208  *
36209  * This is provided so that watchtower clients in the persistence pipeline are able to build
36210  * justice transactions for each counterparty commitment upon each update. It's intended to be
36211  * used within an implementation of [`Persist::update_persisted_channel`], which is provided
36212  * with a monitor and an update. Once revoked, signing a justice transaction can be done using
36213  * [`Self::sign_to_local_justice_tx`].
36214  *
36215  * It is expected that a watchtower client may use this method to retrieve the latest counterparty
36216  * commitment transaction(s), and then hold the necessary data until a later update in which
36217  * the monitor has been updated with the corresponding revocation data, at which point the
36218  * monitor can sign the justice transaction.
36219  *
36220  * This will only return a non-empty list for monitor updates that have been created after
36221  * upgrading to LDK 0.0.117+. Note that no restriction lies on the monitors themselves, which
36222  * may have been created prior to upgrading.
36223  *
36224  * [`Persist::update_persisted_channel`]: crate::chain::chainmonitor::Persist::update_persisted_channel
36225  */
36226 MUST_USE_RES struct LDKCVec_CommitmentTransactionZ ChannelMonitor_counterparty_commitment_txs_from_update(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
36227
36228 /**
36229  * Wrapper around [`EcdsaChannelSigner::sign_justice_revoked_output`] to make
36230  * signing the justice transaction easier for implementors of
36231  * [`chain::chainmonitor::Persist`]. On success this method returns the provided transaction
36232  * signing the input at `input_idx`. This method will only produce a valid signature for
36233  * a transaction spending the `to_local` output of a commitment transaction, i.e. this cannot
36234  * be used for revoked HTLC outputs.
36235  *
36236  * `Value` is the value of the output being spent by the input at `input_idx`, committed
36237  * in the BIP 143 signature.
36238  *
36239  * This method will only succeed if this monitor has received the revocation secret for the
36240  * provided `commitment_number`. If a commitment number is provided that does not correspond
36241  * to the commitment transaction being revoked, this will return a signed transaction, but
36242  * the signature will not be valid.
36243  *
36244  * [`EcdsaChannelSigner::sign_justice_revoked_output`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_justice_revoked_output
36245  * [`Persist`]: crate::chain::chainmonitor::Persist
36246  */
36247 MUST_USE_RES struct LDKCResult_TransactionNoneZ ChannelMonitor_sign_to_local_justice_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction justice_tx, uintptr_t input_idx, uint64_t value, uint64_t commitment_number);
36248
36249 /**
36250  * Gets the `node_id` of the counterparty for this channel.
36251  *
36252  * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
36253  * otherwise.
36254  *
36255  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36256  */
36257 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36258
36259 /**
36260  * You may use this to broadcast the latest local commitment transaction, either because
36261  * a monitor update failed or because we've fallen behind (i.e. we've received proof that our
36262  * counterparty side knows a revocation secret we gave them that they shouldn't know).
36263  *
36264  * Broadcasting these transactions in this manner is UNSAFE, as they allow counterparty
36265  * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
36266  * close channel with their commitment transaction after a substantial amount of time. Best
36267  * may be to contact the other node operator out-of-band to coordinate other options available
36268  * to you.
36269  */
36270 void ChannelMonitor_broadcast_latest_holder_commitment_txn(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
36271
36272 /**
36273  * Processes transactions in a newly connected block, which may result in any of the following:
36274  * - update the monitor's state against resolved HTLCs
36275  * - punish the counterparty in the case of seeing a revoked commitment transaction
36276  * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
36277  * - detect settled outputs for later spending
36278  * - schedule and bump any in-flight claims
36279  *
36280  * Returns any new outputs to watch from `txdata`; after called, these are also included in
36281  * [`get_outputs_to_watch`].
36282  *
36283  * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
36284  */
36285 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_block_connected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
36286
36287 /**
36288  * Determines if the disconnected block contained any transactions of interest and updates
36289  * appropriately.
36290  */
36291 void ChannelMonitor_block_disconnected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
36292
36293 /**
36294  * Processes transactions confirmed in a block with the given header and height, returning new
36295  * outputs to watch. See [`block_connected`] for details.
36296  *
36297  * Used instead of [`block_connected`] by clients that are notified of transactions rather than
36298  * blocks. See [`chain::Confirm`] for calling expectations.
36299  *
36300  * [`block_connected`]: Self::block_connected
36301  */
36302 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_transactions_confirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
36303
36304 /**
36305  * Processes a transaction that was reorganized out of the chain.
36306  *
36307  * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
36308  * than blocks. See [`chain::Confirm`] for calling expectations.
36309  *
36310  * [`block_disconnected`]: Self::block_disconnected
36311  */
36312 void ChannelMonitor_transaction_unconfirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
36313
36314 /**
36315  * Updates the monitor with the current best chain tip, returning new outputs to watch. See
36316  * [`block_connected`] for details.
36317  *
36318  * Used instead of [`block_connected`] by clients that are notified of transactions rather than
36319  * blocks. See [`chain::Confirm`] for calling expectations.
36320  *
36321  * [`block_connected`]: Self::block_connected
36322  */
36323 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_best_block_updated(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
36324
36325 /**
36326  * Returns the set of txids that should be monitored for re-organization out of the chain.
36327  */
36328 MUST_USE_RES struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36329
36330 /**
36331  * Gets the latest best block which was connected either via the [`chain::Listen`] or
36332  * [`chain::Confirm`] interfaces.
36333  */
36334 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36335
36336 /**
36337  * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
36338  * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
36339  * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
36340  * invoking this every 30 seconds, or lower if running in an environment with spotty
36341  * connections, like on mobile.
36342  */
36343 void ChannelMonitor_rebroadcast_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
36344
36345 /**
36346  * Triggers rebroadcasts of pending claims from a force-closed channel after a transaction
36347  * signature generation failure.
36348  */
36349 void ChannelMonitor_signer_unblocked(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
36350
36351 /**
36352  * Returns the descriptors for relevant outputs (i.e., those that we can spend) within the
36353  * transaction if they exist and the transaction has at least [`ANTI_REORG_DELAY`]
36354  * confirmations. For [`SpendableOutputDescriptor::DelayedPaymentOutput`] descriptors to be
36355  * returned, the transaction must have at least `max(ANTI_REORG_DELAY, to_self_delay)`
36356  * confirmations.
36357  *
36358  * Descriptors returned by this method are primarily exposed via [`Event::SpendableOutputs`]
36359  * once they are no longer under reorg risk. This method serves as a way to retrieve these
36360  * descriptors at a later time, either for historical purposes, or to replay any
36361  * missed/unhandled descriptors. For the purpose of gathering historical records, if the
36362  * channel close has fully resolved (i.e., [`ChannelMonitor::get_claimable_balances`] returns
36363  * an empty set), you can retrieve all spendable outputs by providing all descendant spending
36364  * transactions starting from the channel's funding transaction and going down three levels.
36365  *
36366  * `tx` is a transaction we'll scan the outputs of. Any transaction can be provided. If any
36367  * outputs which can be spent by us are found, at least one descriptor is returned.
36368  *
36369  * `confirmation_height` must be the height of the block in which `tx` was included in.
36370  */
36371 MUST_USE_RES struct LDKCVec_SpendableOutputDescriptorZ ChannelMonitor_get_spendable_outputs(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction tx, uint32_t confirmation_height);
36372
36373 /**
36374  * Checks if the monitor is fully resolved. Resolved monitor is one that has claimed all of
36375  * its outputs and balances (i.e. [`Self::get_claimable_balances`] returns an empty set).
36376  *
36377  * This function returns true only if [`Self::get_claimable_balances`] has been empty for at least
36378  * 4032 blocks as an additional protection against any bugs resulting in spuriously empty balance sets.
36379  */
36380 MUST_USE_RES bool ChannelMonitor_is_fully_resolved(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger);
36381
36382 /**
36383  * Gets the balances in this channel which are either claimable by us if we were to
36384  * force-close the channel now or which are claimable on-chain (possibly awaiting
36385  * confirmation).
36386  *
36387  * Any balances in the channel which are available on-chain (excluding on-chain fees) are
36388  * included here until an [`Event::SpendableOutputs`] event has been generated for the
36389  * balance, or until our counterparty has claimed the balance and accrued several
36390  * confirmations on the claim transaction.
36391  *
36392  * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
36393  * LDK prior to 0.0.111, not all or excess balances may be included.
36394  *
36395  * See [`Balance`] for additional details on the types of claimable balances which
36396  * may be returned here and their meanings.
36397  */
36398 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
36399
36400 /**
36401  * Read a C2Tuple_ThirtyTwoBytesChannelMonitorZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelMonitorZ_write
36402  */
36403 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b);
36404
36405 /**
36406  * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
36407  */
36408 void OutPoint_free(struct LDKOutPoint this_obj);
36409
36410 /**
36411  * The referenced transaction's txid.
36412  */
36413 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
36414
36415 /**
36416  * The referenced transaction's txid.
36417  */
36418 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36419
36420 /**
36421  * The index of the referenced output in its transaction's vout.
36422  */
36423 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
36424
36425 /**
36426  * The index of the referenced output in its transaction's vout.
36427  */
36428 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
36429
36430 /**
36431  * Constructs a new OutPoint given each field
36432  */
36433 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
36434
36435 /**
36436  * Creates a copy of the OutPoint
36437  */
36438 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
36439
36440 /**
36441  * Checks if two OutPoints contain equal inner contents.
36442  * This ignores pointers and is_owned flags and looks at the values in fields.
36443  * Two objects with NULL inner values will be considered "equal" here.
36444  */
36445 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
36446
36447 /**
36448  * Generates a non-cryptographic 64-bit hash of the OutPoint.
36449  */
36450 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
36451
36452 /**
36453  * Get the string representation of a OutPoint object
36454  */
36455 struct LDKStr OutPoint_to_str(const struct LDKOutPoint *NONNULL_PTR o);
36456
36457 /**
36458  * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
36459  */
36460 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
36461
36462 /**
36463  * Read a OutPoint from a byte array, created by OutPoint_write
36464  */
36465 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
36466
36467 /**
36468  * Frees any resources used by the InboundHTLCErr, if is_owned is set and inner is non-NULL.
36469  */
36470 void InboundHTLCErr_free(struct LDKInboundHTLCErr this_obj);
36471
36472 /**
36473  * BOLT 4 error code.
36474  */
36475 uint16_t InboundHTLCErr_get_err_code(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
36476
36477 /**
36478  * BOLT 4 error code.
36479  */
36480 void InboundHTLCErr_set_err_code(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, uint16_t val);
36481
36482 /**
36483  * Data attached to this error.
36484  *
36485  * Returns a copy of the field.
36486  */
36487 struct LDKCVec_u8Z InboundHTLCErr_get_err_data(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
36488
36489 /**
36490  * Data attached to this error.
36491  */
36492 void InboundHTLCErr_set_err_data(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
36493
36494 /**
36495  * Error message text.
36496  */
36497 struct LDKStr InboundHTLCErr_get_msg(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
36498
36499 /**
36500  * Error message text.
36501  */
36502 void InboundHTLCErr_set_msg(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, struct LDKStr val);
36503
36504 /**
36505  * Constructs a new InboundHTLCErr given each field
36506  */
36507 MUST_USE_RES struct LDKInboundHTLCErr InboundHTLCErr_new(uint16_t err_code_arg, struct LDKCVec_u8Z err_data_arg, struct LDKStr msg_arg);
36508
36509 /**
36510  * Creates a copy of the InboundHTLCErr
36511  */
36512 struct LDKInboundHTLCErr InboundHTLCErr_clone(const struct LDKInboundHTLCErr *NONNULL_PTR orig);
36513
36514 /**
36515  * Generates a non-cryptographic 64-bit hash of the InboundHTLCErr.
36516  */
36517 uint64_t InboundHTLCErr_hash(const struct LDKInboundHTLCErr *NONNULL_PTR o);
36518
36519 /**
36520  * Checks if two InboundHTLCErrs contain equal inner contents.
36521  * This ignores pointers and is_owned flags and looks at the values in fields.
36522  * Two objects with NULL inner values will be considered "equal" here.
36523  */
36524 bool InboundHTLCErr_eq(const struct LDKInboundHTLCErr *NONNULL_PTR a, const struct LDKInboundHTLCErr *NONNULL_PTR b);
36525
36526 /**
36527  * Peel one layer off an incoming onion, returning a [`PendingHTLCInfo`] that contains information
36528  * about the intended next-hop for the HTLC.
36529  *
36530  * This does all the relevant context-free checks that LDK requires for payment relay or
36531  * acceptance. If the payment is to be received, and the amount matches the expected amount for
36532  * a given invoice, this indicates the [`msgs::UpdateAddHTLC`], once fully committed in the
36533  * channel, will generate an [`Event::PaymentClaimable`].
36534  *
36535  * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
36536  */
36537 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ peel_payment_onion(const struct LDKUpdateAddHTLC *NONNULL_PTR msg, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKLogger *NONNULL_PTR logger, uint32_t cur_height, bool accept_mpp_keysend, bool allow_skimmed_fees);
36538
36539 /**
36540  * Frees any resources used by the PendingHTLCRouting
36541  */
36542 void PendingHTLCRouting_free(struct LDKPendingHTLCRouting this_ptr);
36543
36544 /**
36545  * Creates a copy of the PendingHTLCRouting
36546  */
36547 struct LDKPendingHTLCRouting PendingHTLCRouting_clone(const struct LDKPendingHTLCRouting *NONNULL_PTR orig);
36548
36549 /**
36550  * Utility method to constructs a new Forward-variant PendingHTLCRouting
36551  */
36552 struct LDKPendingHTLCRouting PendingHTLCRouting_forward(struct LDKOnionPacket onion_packet, uint64_t short_channel_id, struct LDKBlindedForward blinded);
36553
36554 /**
36555  * Utility method to constructs a new Receive-variant PendingHTLCRouting
36556  */
36557 struct LDKPendingHTLCRouting PendingHTLCRouting_receive(struct LDKFinalOnionHopData payment_data, struct LDKCOption_CVec_u8ZZ payment_metadata, struct LDKCOption_PaymentContextZ payment_context, uint32_t incoming_cltv_expiry, struct LDKThirtyTwoBytes phantom_shared_secret, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs, bool requires_blinded_error);
36558
36559 /**
36560  * Utility method to constructs a new ReceiveKeysend-variant PendingHTLCRouting
36561  */
36562 struct LDKPendingHTLCRouting PendingHTLCRouting_receive_keysend(struct LDKFinalOnionHopData payment_data, struct LDKThirtyTwoBytes payment_preimage, struct LDKCOption_CVec_u8ZZ payment_metadata, uint32_t incoming_cltv_expiry, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs, bool requires_blinded_error);
36563
36564 /**
36565  * Frees any resources used by the BlindedForward, if is_owned is set and inner is non-NULL.
36566  */
36567 void BlindedForward_free(struct LDKBlindedForward this_obj);
36568
36569 /**
36570  * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
36571  * onion payload if we're the introduction node. Useful for calculating the next hop's
36572  * [`msgs::UpdateAddHTLC::blinding_point`].
36573  */
36574 struct LDKPublicKey BlindedForward_get_inbound_blinding_point(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
36575
36576 /**
36577  * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
36578  * onion payload if we're the introduction node. Useful for calculating the next hop's
36579  * [`msgs::UpdateAddHTLC::blinding_point`].
36580  */
36581 void BlindedForward_set_inbound_blinding_point(struct LDKBlindedForward *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36582
36583 /**
36584  * If needed, this determines how this HTLC should be failed backwards, based on whether we are
36585  * the introduction node.
36586  */
36587 enum LDKBlindedFailure BlindedForward_get_failure(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
36588
36589 /**
36590  * If needed, this determines how this HTLC should be failed backwards, based on whether we are
36591  * the introduction node.
36592  */
36593 void BlindedForward_set_failure(struct LDKBlindedForward *NONNULL_PTR this_ptr, enum LDKBlindedFailure val);
36594
36595 /**
36596  * Constructs a new BlindedForward given each field
36597  */
36598 MUST_USE_RES struct LDKBlindedForward BlindedForward_new(struct LDKPublicKey inbound_blinding_point_arg, enum LDKBlindedFailure failure_arg);
36599
36600 /**
36601  * Creates a copy of the BlindedForward
36602  */
36603 struct LDKBlindedForward BlindedForward_clone(const struct LDKBlindedForward *NONNULL_PTR orig);
36604
36605 /**
36606  * Generates a non-cryptographic 64-bit hash of the BlindedForward.
36607  */
36608 uint64_t BlindedForward_hash(const struct LDKBlindedForward *NONNULL_PTR o);
36609
36610 /**
36611  * Checks if two BlindedForwards contain equal inner contents.
36612  * This ignores pointers and is_owned flags and looks at the values in fields.
36613  * Two objects with NULL inner values will be considered "equal" here.
36614  */
36615 bool BlindedForward_eq(const struct LDKBlindedForward *NONNULL_PTR a, const struct LDKBlindedForward *NONNULL_PTR b);
36616
36617 /**
36618  * Frees any resources used by the PendingHTLCInfo, if is_owned is set and inner is non-NULL.
36619  */
36620 void PendingHTLCInfo_free(struct LDKPendingHTLCInfo this_obj);
36621
36622 /**
36623  * Further routing details based on whether the HTLC is being forwarded or received.
36624  */
36625 struct LDKPendingHTLCRouting PendingHTLCInfo_get_routing(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
36626
36627 /**
36628  * Further routing details based on whether the HTLC is being forwarded or received.
36629  */
36630 void PendingHTLCInfo_set_routing(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKPendingHTLCRouting val);
36631
36632 /**
36633  * The onion shared secret we build with the sender used to decrypt the onion.
36634  *
36635  * This is later used to encrypt failure packets in the event that the HTLC is failed.
36636  */
36637 const uint8_t (*PendingHTLCInfo_get_incoming_shared_secret(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr))[32];
36638
36639 /**
36640  * The onion shared secret we build with the sender used to decrypt the onion.
36641  *
36642  * This is later used to encrypt failure packets in the event that the HTLC is failed.
36643  */
36644 void PendingHTLCInfo_set_incoming_shared_secret(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36645
36646 /**
36647  * Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
36648  */
36649 const uint8_t (*PendingHTLCInfo_get_payment_hash(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr))[32];
36650
36651 /**
36652  * Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
36653  */
36654 void PendingHTLCInfo_set_payment_hash(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36655
36656 /**
36657  * Amount received in the incoming HTLC.
36658  *
36659  * This field was added in LDK 0.0.113 and will be `None` for objects written by prior
36660  * versions.
36661  */
36662 struct LDKCOption_u64Z PendingHTLCInfo_get_incoming_amt_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
36663
36664 /**
36665  * Amount received in the incoming HTLC.
36666  *
36667  * This field was added in LDK 0.0.113 and will be `None` for objects written by prior
36668  * versions.
36669  */
36670 void PendingHTLCInfo_set_incoming_amt_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36671
36672 /**
36673  * The amount the sender indicated should be forwarded on to the next hop or amount the sender
36674  * intended for us to receive for received payments.
36675  *
36676  * If the received amount is less than this for received payments, an intermediary hop has
36677  * attempted to steal some of our funds and we should fail the HTLC (the sender should retry
36678  * it along another path).
36679  *
36680  * Because nodes can take less than their required fees, and because senders may wish to
36681  * improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
36682  * received payments. In such cases, recipients must handle this HTLC as if it had received
36683  * [`Self::outgoing_amt_msat`].
36684  */
36685 uint64_t PendingHTLCInfo_get_outgoing_amt_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
36686
36687 /**
36688  * The amount the sender indicated should be forwarded on to the next hop or amount the sender
36689  * intended for us to receive for received payments.
36690  *
36691  * If the received amount is less than this for received payments, an intermediary hop has
36692  * attempted to steal some of our funds and we should fail the HTLC (the sender should retry
36693  * it along another path).
36694  *
36695  * Because nodes can take less than their required fees, and because senders may wish to
36696  * improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
36697  * received payments. In such cases, recipients must handle this HTLC as if it had received
36698  * [`Self::outgoing_amt_msat`].
36699  */
36700 void PendingHTLCInfo_set_outgoing_amt_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, uint64_t val);
36701
36702 /**
36703  * The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
36704  * should have been set on the received HTLC for received payments).
36705  */
36706 uint32_t PendingHTLCInfo_get_outgoing_cltv_value(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
36707
36708 /**
36709  * The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
36710  * should have been set on the received HTLC for received payments).
36711  */
36712 void PendingHTLCInfo_set_outgoing_cltv_value(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, uint32_t val);
36713
36714 /**
36715  * The fee taken for this HTLC in addition to the standard protocol HTLC fees.
36716  *
36717  * If this is a payment for forwarding, this is the fee we are taking before forwarding the
36718  * HTLC.
36719  *
36720  * If this is a received payment, this is the fee that our counterparty took.
36721  *
36722  * This is used to allow LSPs to take fees as a part of payments, without the sender having to
36723  * shoulder them.
36724  */
36725 struct LDKCOption_u64Z PendingHTLCInfo_get_skimmed_fee_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
36726
36727 /**
36728  * The fee taken for this HTLC in addition to the standard protocol HTLC fees.
36729  *
36730  * If this is a payment for forwarding, this is the fee we are taking before forwarding the
36731  * HTLC.
36732  *
36733  * If this is a received payment, this is the fee that our counterparty took.
36734  *
36735  * This is used to allow LSPs to take fees as a part of payments, without the sender having to
36736  * shoulder them.
36737  */
36738 void PendingHTLCInfo_set_skimmed_fee_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36739
36740 /**
36741  * Constructs a new PendingHTLCInfo given each field
36742  */
36743 MUST_USE_RES struct LDKPendingHTLCInfo PendingHTLCInfo_new(struct LDKPendingHTLCRouting routing_arg, struct LDKThirtyTwoBytes incoming_shared_secret_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_u64Z incoming_amt_msat_arg, uint64_t outgoing_amt_msat_arg, uint32_t outgoing_cltv_value_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg);
36744
36745 /**
36746  * Creates a copy of the PendingHTLCInfo
36747  */
36748 struct LDKPendingHTLCInfo PendingHTLCInfo_clone(const struct LDKPendingHTLCInfo *NONNULL_PTR orig);
36749
36750 /**
36751  * Creates a copy of the BlindedFailure
36752  */
36753 enum LDKBlindedFailure BlindedFailure_clone(const enum LDKBlindedFailure *NONNULL_PTR orig);
36754
36755 /**
36756  * Utility method to constructs a new FromIntroductionNode-variant BlindedFailure
36757  */
36758 enum LDKBlindedFailure BlindedFailure_from_introduction_node(void);
36759
36760 /**
36761  * Utility method to constructs a new FromBlindedNode-variant BlindedFailure
36762  */
36763 enum LDKBlindedFailure BlindedFailure_from_blinded_node(void);
36764
36765 /**
36766  * Generates a non-cryptographic 64-bit hash of the BlindedFailure.
36767  */
36768 uint64_t BlindedFailure_hash(const enum LDKBlindedFailure *NONNULL_PTR o);
36769
36770 /**
36771  * Checks if two BlindedFailures contain equal inner contents.
36772  * This ignores pointers and is_owned flags and looks at the values in fields.
36773  */
36774 bool BlindedFailure_eq(const enum LDKBlindedFailure *NONNULL_PTR a, const enum LDKBlindedFailure *NONNULL_PTR b);
36775
36776 /**
36777  * Frees any resources used by the FailureCode
36778  */
36779 void FailureCode_free(struct LDKFailureCode this_ptr);
36780
36781 /**
36782  * Creates a copy of the FailureCode
36783  */
36784 struct LDKFailureCode FailureCode_clone(const struct LDKFailureCode *NONNULL_PTR orig);
36785
36786 /**
36787  * Utility method to constructs a new TemporaryNodeFailure-variant FailureCode
36788  */
36789 struct LDKFailureCode FailureCode_temporary_node_failure(void);
36790
36791 /**
36792  * Utility method to constructs a new RequiredNodeFeatureMissing-variant FailureCode
36793  */
36794 struct LDKFailureCode FailureCode_required_node_feature_missing(void);
36795
36796 /**
36797  * Utility method to constructs a new IncorrectOrUnknownPaymentDetails-variant FailureCode
36798  */
36799 struct LDKFailureCode FailureCode_incorrect_or_unknown_payment_details(void);
36800
36801 /**
36802  * Utility method to constructs a new InvalidOnionPayload-variant FailureCode
36803  */
36804 struct LDKFailureCode FailureCode_invalid_onion_payload(struct LDKCOption_C2Tuple_u64u16ZZ a);
36805
36806 /**
36807  * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
36808  */
36809 void ChannelManager_free(struct LDKChannelManager this_obj);
36810
36811 /**
36812  * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
36813  */
36814 void ChainParameters_free(struct LDKChainParameters this_obj);
36815
36816 /**
36817  * The network for determining the `chain_hash` in Lightning messages.
36818  */
36819 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
36820
36821 /**
36822  * The network for determining the `chain_hash` in Lightning messages.
36823  */
36824 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
36825
36826 /**
36827  * The hash and height of the latest block successfully connected.
36828  *
36829  * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
36830  */
36831 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
36832
36833 /**
36834  * The hash and height of the latest block successfully connected.
36835  *
36836  * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
36837  */
36838 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
36839
36840 /**
36841  * Constructs a new ChainParameters given each field
36842  */
36843 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
36844
36845 /**
36846  * Creates a copy of the ChainParameters
36847  */
36848 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
36849
36850 /**
36851  * Frees any resources used by the RecentPaymentDetails
36852  */
36853 void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr);
36854
36855 /**
36856  * Creates a copy of the RecentPaymentDetails
36857  */
36858 struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig);
36859
36860 /**
36861  * Utility method to constructs a new AwaitingInvoice-variant RecentPaymentDetails
36862  */
36863 struct LDKRecentPaymentDetails RecentPaymentDetails_awaiting_invoice(struct LDKThirtyTwoBytes payment_id);
36864
36865 /**
36866  * Utility method to constructs a new Pending-variant RecentPaymentDetails
36867  */
36868 struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat);
36869
36870 /**
36871  * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails
36872  */
36873 struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash);
36874
36875 /**
36876  * Utility method to constructs a new Abandoned-variant RecentPaymentDetails
36877  */
36878 struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
36879
36880 /**
36881  * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
36882  */
36883 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
36884
36885 /**
36886  * The list of channels to be included in the invoice route hints.
36887  */
36888 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
36889
36890 /**
36891  * The list of channels to be included in the invoice route hints.
36892  */
36893 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
36894
36895 /**
36896  * A fake scid used for representing the phantom node's fake channel in generating the invoice
36897  * route hints.
36898  */
36899 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
36900
36901 /**
36902  * A fake scid used for representing the phantom node's fake channel in generating the invoice
36903  * route hints.
36904  */
36905 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
36906
36907 /**
36908  * The pubkey of the real backing node that would ultimately receive the payment.
36909  */
36910 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
36911
36912 /**
36913  * The pubkey of the real backing node that would ultimately receive the payment.
36914  */
36915 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36916
36917 /**
36918  * Constructs a new PhantomRouteHints given each field
36919  */
36920 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
36921
36922 /**
36923  * Creates a copy of the PhantomRouteHints
36924  */
36925 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
36926
36927 /**
36928  * Constructs a new `ChannelManager` to hold several channels and route between them.
36929  *
36930  * The current time or latest block header time can be provided as the `current_timestamp`.
36931  *
36932  * This is the main \"logic hub\" for all channel-related actions, and implements
36933  * [`ChannelMessageHandler`].
36934  *
36935  * Non-proportional fees are fixed according to our risk using the provided fee estimator.
36936  *
36937  * Users need to notify the new `ChannelManager` when a new block is connected or
36938  * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting
36939  * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for
36940  * more details.
36941  *
36942  * [`block_connected`]: chain::Listen::block_connected
36943  * [`block_disconnected`]: chain::Listen::block_disconnected
36944  * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
36945  */
36946 MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKLogger logger, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKUserConfig config, struct LDKChainParameters params, uint32_t current_timestamp);
36947
36948 /**
36949  * Gets the current configuration applied to all new channels.
36950  */
36951 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
36952
36953 /**
36954  * Creates a new outbound channel to the given remote node and with the given value.
36955  *
36956  * `user_channel_id` will be provided back as in
36957  * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
36958  * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
36959  * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
36960  * is simply copied to events and otherwise ignored.
36961  *
36962  * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
36963  * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
36964  *
36965  * Raises [`APIError::ChannelUnavailable`] if the channel cannot be opened due to failing to
36966  * generate a shutdown scriptpubkey or destination script set by
36967  * [`SignerProvider::get_shutdown_scriptpubkey`] or [`SignerProvider::get_destination_script`].
36968  *
36969  * Note that we do not check if you are currently connected to the given peer. If no
36970  * connection is available, the outbound `open_channel` message may fail to send, resulting in
36971  * the channel eventually being silently forgotten (dropped on reload).
36972  *
36973  * If `temporary_channel_id` is specified, it will be used as the temporary channel ID of the
36974  * channel. Otherwise, a random one will be generated for you.
36975  *
36976  * Returns the new Channel's temporary `channel_id`. This ID will appear as
36977  * [`Event::FundingGenerationReady::temporary_channel_id`] and in
36978  * [`ChannelDetails::channel_id`] until after
36979  * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
36980  * one derived from the funding transaction's TXID. If the counterparty rejects the channel
36981  * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
36982  *
36983  * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
36984  * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
36985  * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
36986  *
36987  * Note that temporary_channel_id (or a relevant inner pointer) may be NULL or all-0s to represent None
36988  * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
36989  */
36990 MUST_USE_RES struct LDKCResult_ChannelIdAPIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, struct LDKU128 user_channel_id, struct LDKChannelId temporary_channel_id, struct LDKUserConfig override_config);
36991
36992 /**
36993  * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for
36994  * more information.
36995  */
36996 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
36997
36998 /**
36999  * Gets the list of usable channels, in random order. Useful as an argument to
37000  * [`Router::find_route`] to ensure non-announced channels are used.
37001  *
37002  * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
37003  * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
37004  * are.
37005  */
37006 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
37007
37008 /**
37009  * Gets the list of channels we have with a given counterparty, in random order.
37010  */
37011 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels_with_counterparty(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id);
37012
37013 /**
37014  * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
37015  * successful path, or have unresolved HTLCs.
37016  *
37017  * This can be useful for payments that may have been prepared, but ultimately not sent, as a
37018  * result of a crash. If such a payment exists, is not listed here, and an
37019  * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
37020  *
37021  * [`Event::PaymentSent`]: events::Event::PaymentSent
37022  */
37023 MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg);
37024
37025 /**
37026  * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
37027  * will be accepted on the given channel, and after additional timeout/the closing of all
37028  * pending HTLCs, the channel will be closed on chain.
37029  *
37030  *  * If we are the channel initiator, we will pay between our [`ChannelCloseMinimum`] and
37031  *    [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
37032  *    fee estimate.
37033  *  * If our counterparty is the channel initiator, we will require a channel closing
37034  *    transaction feerate of at least our [`ChannelCloseMinimum`] feerate or the feerate which
37035  *    would appear on a force-closure transaction, whichever is lower. We will allow our
37036  *    counterparty to pay as much fee as they'd like, however.
37037  *
37038  * May generate a [`SendShutdown`] message event on success, which should be relayed.
37039  *
37040  * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
37041  * generate a shutdown scriptpubkey or destination script set by
37042  * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
37043  * channel.
37044  *
37045  * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
37046  * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
37047  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
37048  * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
37049  */
37050 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id);
37051
37052 /**
37053  * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
37054  * will be accepted on the given channel, and after additional timeout/the closing of all
37055  * pending HTLCs, the channel will be closed on chain.
37056  *
37057  * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
37058  * the channel being closed or not:
37059  *  * If we are the channel initiator, we will pay at least this feerate on the closing
37060  *    transaction. The upper-bound is set by
37061  *    [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
37062  *    fee estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
37063  *  * If our counterparty is the channel initiator, we will refuse to accept a channel closure
37064  *    transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
37065  *    will appear on a force-closure transaction, whichever is lower).
37066  *
37067  * The `shutdown_script` provided  will be used as the `scriptPubKey` for the closing transaction.
37068  * Will fail if a shutdown script has already been set for this channel by
37069  * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
37070  * also be compatible with our and the counterparty's features.
37071  *
37072  * May generate a [`SendShutdown`] message event on success, which should be relayed.
37073  *
37074  * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
37075  * generate a shutdown scriptpubkey or destination script set by
37076  * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
37077  * channel.
37078  *
37079  * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
37080  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
37081  * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
37082  *
37083  * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
37084  */
37085 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_feerate_and_script(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id, struct LDKCOption_u32Z target_feerate_sats_per_1000_weight, struct LDKShutdownScript shutdown_script);
37086
37087 /**
37088  * Force closes a channel, immediately broadcasting the latest local transaction(s) and
37089  * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
37090  * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
37091  * channel.
37092  */
37093 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id);
37094
37095 /**
37096  * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
37097  * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
37098  * `counterparty_node_id` isn't the counterparty of the corresponding channel.
37099  *
37100  * You can always broadcast the latest local transaction(s) via
37101  * [`ChannelMonitor::broadcast_latest_holder_commitment_txn`].
37102  */
37103 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id);
37104
37105 /**
37106  * Force close all channels, immediately broadcasting the latest local commitment transaction
37107  * for each to the chain and rejecting new HTLCs on each.
37108  */
37109 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
37110
37111 /**
37112  * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
37113  * local transaction(s).
37114  */
37115 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
37116
37117 /**
37118  * Sends a payment along a given route.
37119  *
37120  * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
37121  * fields for more info.
37122  *
37123  * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via
37124  * [`PeerManager::process_events`]).
37125  *
37126  * # Avoiding Duplicate Payments
37127  *
37128  * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
37129  * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
37130  * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
37131  * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
37132  * second payment with the same [`PaymentId`].
37133  *
37134  * Thus, in order to ensure duplicate payments are not sent, you should implement your own
37135  * tracking of payments, including state to indicate once a payment has completed. Because you
37136  * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
37137  * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
37138  * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
37139  *
37140  * Additionally, in the scenario where we begin the process of sending a payment, but crash
37141  * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
37142  * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
37143  * [`ChannelManager::list_recent_payments`] for more information.
37144  *
37145  * # Possible Error States on [`PaymentSendFailure`]
37146  *
37147  * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with
37148  * each entry matching the corresponding-index entry in the route paths, see
37149  * [`PaymentSendFailure`] for more info.
37150  *
37151  * In general, a path may raise:
37152  *  * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
37153  *    node public key) is specified.
37154  *  * [`APIError::ChannelUnavailable`] if the next-hop channel is not available as it has been
37155  *    closed, doesn't exist, or the peer is currently disconnected.
37156  *  * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
37157  *    relevant updates.
37158  *
37159  * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been
37160  * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
37161  * different route unless you intend to pay twice!
37162  *
37163  * [`RouteHop`]: crate::routing::router::RouteHop
37164  * [`Event::PaymentSent`]: events::Event::PaymentSent
37165  * [`Event::PaymentFailed`]: events::Event::PaymentFailed
37166  * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
37167  * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
37168  * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
37169  */
37170 MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment_with_route(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id);
37171
37172 /**
37173  * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on
37174  * `route_params` and retry failed payment paths based on `retry_strategy`.
37175  */
37176 MUST_USE_RES struct LDKCResult_NoneRetryableSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
37177
37178 /**
37179  * Signals that no further attempts for the given payment should occur. Useful if you have a
37180  * pending outbound payment with retries remaining, but wish to stop retrying the payment before
37181  * retries are exhausted.
37182  *
37183  * # Event Generation
37184  *
37185  * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
37186  * as there are no remaining pending HTLCs for this payment.
37187  *
37188  * Note that calling this method does *not* prevent a payment from succeeding. You must still
37189  * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
37190  * determine the ultimate status of a payment.
37191  *
37192  * # Requested Invoices
37193  *
37194  * In the case of paying a [`Bolt12Invoice`] via [`ChannelManager::pay_for_offer`], abandoning
37195  * the payment prior to receiving the invoice will result in an [`Event::InvoiceRequestFailed`]
37196  * and prevent any attempts at paying it once received. The other events may only be generated
37197  * once the invoice has been received.
37198  *
37199  * # Restart Behavior
37200  *
37201  * If an [`Event::PaymentFailed`] is generated and we restart without first persisting the
37202  * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated; likewise for
37203  * [`Event::InvoiceRequestFailed`].
37204  *
37205  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37206  */
37207 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
37208
37209 /**
37210  * Send a spontaneous payment, which is a payment that does not require the recipient to have
37211  * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
37212  * the preimage, it must be a cryptographically secure random value that no intermediate node
37213  * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
37214  * never reach the recipient.
37215  *
37216  * See [`send_payment`] documentation for more details on the return value of this function
37217  * and idempotency guarantees provided by the [`PaymentId`] key.
37218  *
37219  * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
37220  * [`send_payment`] for more information about the risks of duplicate preimage usage.
37221  *
37222  * [`send_payment`]: Self::send_payment
37223  */
37224 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id);
37225
37226 /**
37227  * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
37228  * based on `route_params` and retry failed payment paths based on `retry_strategy`.
37229  *
37230  * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
37231  * payments.
37232  *
37233  * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
37234  */
37235 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ ChannelManager_send_spontaneous_payment_with_retry(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
37236
37237 /**
37238  * Send a payment that is probing the given route for liquidity. We calculate the
37239  * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
37240  * us to easily discern them from real payments.
37241  */
37242 MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path);
37243
37244 /**
37245  * Sends payment probes over all paths of a route that would be used to pay the given
37246  * amount to the given `node_id`.
37247  *
37248  * See [`ChannelManager::send_preflight_probes`] for more information.
37249  */
37250 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ChannelManager_send_spontaneous_preflight_probes(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, uint64_t amount_msat, uint32_t final_cltv_expiry_delta, struct LDKCOption_u64Z liquidity_limit_multiplier);
37251
37252 /**
37253  * Sends payment probes over all paths of a route that would be used to pay a route found
37254  * according to the given [`RouteParameters`].
37255  *
37256  * This may be used to send \"pre-flight\" probes, i.e., to train our scorer before conducting
37257  * the actual payment. Note this is only useful if there likely is sufficient time for the
37258  * probe to settle before sending out the actual payment, e.g., when waiting for user
37259  * confirmation in a wallet UI.
37260  *
37261  * Otherwise, there is a chance the probe could take up some liquidity needed to complete the
37262  * actual payment. Users should therefore be cautious and might avoid sending probes if
37263  * liquidity is scarce and/or they don't expect the probe to return before they send the
37264  * payment. To mitigate this issue, channels with available liquidity less than the required
37265  * amount times the given `liquidity_limit_multiplier` won't be used to send pre-flight
37266  * probes. If `None` is given as `liquidity_limit_multiplier`, it defaults to `3`.
37267  */
37268 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ChannelManager_send_preflight_probes(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKRouteParameters route_params, struct LDKCOption_u64Z liquidity_limit_multiplier);
37269
37270 /**
37271  * Call this upon creation of a funding transaction for the given channel.
37272  *
37273  * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
37274  * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
37275  *
37276  * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
37277  * across the p2p network.
37278  *
37279  * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
37280  * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
37281  *
37282  * May panic if the output found in the funding transaction is duplicative with some other
37283  * channel (note that this should be trivially prevented by using unique funding transaction
37284  * keys per-channel).
37285  *
37286  * Do NOT broadcast the funding transaction yourself. When we have safely received our
37287  * counterparty's signature the funding transaction will automatically be broadcast via the
37288  * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
37289  *
37290  * Note that this includes RBF or similar transaction replacement strategies - lightning does
37291  * not currently support replacing a funding transaction on an existing channel. Instead,
37292  * create a new channel with a conflicting funding transaction.
37293  *
37294  * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
37295  * the wallet software generating the funding transaction to apply anti-fee sniping as
37296  * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
37297  * for more details.
37298  *
37299  * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
37300  * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
37301  */
37302 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKTransaction funding_transaction);
37303
37304 /**
37305  * Call this upon creation of a batch funding transaction for the given channels.
37306  *
37307  * Return values are identical to [`Self::funding_transaction_generated`], respective to
37308  * each individual channel and transaction output.
37309  *
37310  * Do NOT broadcast the funding transaction yourself. This batch funding transaction
37311  * will only be broadcast when we have safely received and persisted the counterparty's
37312  * signature for each channel.
37313  *
37314  * If there is an error, all channels in the batch are to be considered closed.
37315  */
37316 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_batch_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ temporary_channels, struct LDKTransaction funding_transaction);
37317
37318 /**
37319  * Atomically applies partial updates to the [`ChannelConfig`] of the given channels.
37320  *
37321  * Once the updates are applied, each eligible channel (advertised with a known short channel
37322  * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
37323  * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
37324  * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
37325  *
37326  * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
37327  * `counterparty_node_id` is provided.
37328  *
37329  * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
37330  * below [`MIN_CLTV_EXPIRY_DELTA`].
37331  *
37332  * If an error is returned, none of the updates should be considered applied.
37333  *
37334  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
37335  * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
37336  * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
37337  * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
37338  * [`ChannelUpdate`]: msgs::ChannelUpdate
37339  * [`ChannelUnavailable`]: APIError::ChannelUnavailable
37340  * [`APIMisuseError`]: APIError::APIMisuseError
37341  */
37342 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_partial_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ChannelIdZ channel_ids, const struct LDKChannelConfigUpdate *NONNULL_PTR config_update);
37343
37344 /**
37345  * Atomically updates the [`ChannelConfig`] for the given channels.
37346  *
37347  * Once the updates are applied, each eligible channel (advertised with a known short channel
37348  * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
37349  * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
37350  * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
37351  *
37352  * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
37353  * `counterparty_node_id` is provided.
37354  *
37355  * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
37356  * below [`MIN_CLTV_EXPIRY_DELTA`].
37357  *
37358  * If an error is returned, none of the updates should be considered applied.
37359  *
37360  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
37361  * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
37362  * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
37363  * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
37364  * [`ChannelUpdate`]: msgs::ChannelUpdate
37365  * [`ChannelUnavailable`]: APIError::ChannelUnavailable
37366  * [`APIMisuseError`]: APIError::APIMisuseError
37367  */
37368 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ChannelIdZ channel_ids, const struct LDKChannelConfig *NONNULL_PTR config);
37369
37370 /**
37371  * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
37372  * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
37373  *
37374  * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
37375  * channel to a receiving node if the node lacks sufficient inbound liquidity.
37376  *
37377  * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
37378  * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
37379  * receiver's invoice route hints. These route hints will signal to LDK to generate an
37380  * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
37381  * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
37382  *
37383  * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
37384  * you from forwarding more than you received. See
37385  * [`HTLCIntercepted::expected_outbound_amount_msat`] for more on forwarding a different amount
37386  * than expected.
37387  *
37388  * Errors if the event was not handled in time, in which case the HTLC was automatically failed
37389  * backwards.
37390  *
37391  * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
37392  * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
37393  * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat
37394  */
37395 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_forward_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id, const struct LDKChannelId *NONNULL_PTR next_hop_channel_id, struct LDKPublicKey next_node_id, uint64_t amt_to_forward_msat);
37396
37397 /**
37398  * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
37399  * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
37400  *
37401  * Errors if the event was not handled in time, in which case the HTLC was automatically failed
37402  * backwards.
37403  *
37404  * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
37405  */
37406 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
37407
37408 /**
37409  * Processes HTLCs which are pending waiting on random forward delay.
37410  *
37411  * Should only really ever be called in response to a PendingHTLCsForwardable event.
37412  * Will likely generate further events.
37413  */
37414 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
37415
37416 /**
37417  * Performs actions which should happen on startup and roughly once per minute thereafter.
37418  *
37419  * This currently includes:
37420  *  * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
37421  *  * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more
37422  *    than a minute, informing the network that they should no longer attempt to route over
37423  *    the channel.
37424  *  * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs
37425  *    with the current [`ChannelConfig`].
37426  *  * Removing peers which have disconnected but and no longer have any channels.
37427  *  * Force-closing and removing channels which have not completed establishment in a timely manner.
37428  *  * Forgetting about stale outbound payments, either those that have already been fulfilled
37429  *    or those awaiting an invoice that hasn't been delivered in the necessary amount of time.
37430  *    The latter is determined using the system clock in `std` and the highest seen block time
37431  *    minus two hours in `no-std`.
37432  *
37433  * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate
37434  * estimate fetches.
37435  *
37436  * [`ChannelUpdate`]: msgs::ChannelUpdate
37437  * [`ChannelConfig`]: crate::util::config::ChannelConfig
37438  */
37439 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
37440
37441 /**
37442  * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
37443  * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
37444  * along the path (including in our own channel on which we received it).
37445  *
37446  * Note that in some cases around unclean shutdown, it is possible the payment may have
37447  * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
37448  * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
37449  * may have already been failed automatically by LDK if it was nearing its expiration time.
37450  *
37451  * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
37452  * [`ChannelManager::claim_funds`]), you should still monitor for
37453  * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
37454  * startup during which time claims that were in-progress at shutdown may be replayed.
37455  */
37456 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
37457
37458 /**
37459  * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
37460  * reason for the failure.
37461  *
37462  * See [`FailureCode`] for valid failure codes.
37463  */
37464 void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKFailureCode failure_code);
37465
37466 /**
37467  * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
37468  * [`MessageSendEvent`]s needed to claim the payment.
37469  *
37470  * This method is guaranteed to ensure the payment has been claimed but only if the current
37471  * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race
37472  * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment
37473  * successful. It will generally be available in the next [`process_pending_events`] call.
37474  *
37475  * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
37476  * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
37477  * event matches your expectation. If you fail to do so and call this method, you may provide
37478  * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
37479  *
37480  * This function will fail the payment if it has custom TLVs with even type numbers, as we
37481  * will assume they are unknown. If you intend to accept even custom TLVs, you should use
37482  * [`claim_funds_with_known_custom_tlvs`].
37483  *
37484  * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
37485  * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
37486  * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
37487  * [`process_pending_events`]: EventsProvider::process_pending_events
37488  * [`create_inbound_payment`]: Self::create_inbound_payment
37489  * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
37490  * [`claim_funds_with_known_custom_tlvs`]: Self::claim_funds_with_known_custom_tlvs
37491  */
37492 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
37493
37494 /**
37495  * This is a variant of [`claim_funds`] that allows accepting a payment with custom TLVs with
37496  * even type numbers.
37497  *
37498  * # Note
37499  *
37500  * You MUST check you've understood all even TLVs before using this to
37501  * claim, otherwise you may unintentionally agree to some protocol you do not understand.
37502  *
37503  * [`claim_funds`]: Self::claim_funds
37504  */
37505 void ChannelManager_claim_funds_with_known_custom_tlvs(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
37506
37507 /**
37508  * Gets the node_id held by this ChannelManager
37509  */
37510 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
37511
37512 /**
37513  * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
37514  *
37515  * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
37516  * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
37517  * the channel.
37518  *
37519  * The `user_channel_id` parameter will be provided back in
37520  * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
37521  * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
37522  *
37523  * Note that this method will return an error and reject the channel, if it requires support
37524  * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
37525  * used to accept such channels.
37526  *
37527  * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
37528  * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
37529  */
37530 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
37531
37532 /**
37533  * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
37534  * it as confirmed immediately.
37535  *
37536  * The `user_channel_id` parameter will be provided back in
37537  * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
37538  * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
37539  *
37540  * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
37541  * and (if the counterparty agrees), enables forwarding of payments immediately.
37542  *
37543  * This fully trusts that the counterparty has honestly and correctly constructed the funding
37544  * transaction and blindly assumes that it will eventually confirm.
37545  *
37546  * If it does not confirm before we decide to close the channel, or if the funding transaction
37547  * does not pay to the correct script the correct amount, *you will lose funds*.
37548  *
37549  * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
37550  * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
37551  */
37552 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
37553
37554 /**
37555  * Creates an [`OfferBuilder`] such that the [`Offer`] it builds is recognized by the
37556  * [`ChannelManager`] when handling [`InvoiceRequest`] messages for the offer. The offer will
37557  * not have an expiration unless otherwise set on the builder.
37558  *
37559  * # Privacy
37560  *
37561  * Uses [`MessageRouter::create_blinded_paths`] to construct a [`BlindedPath`] for the offer.
37562  * However, if one is not found, uses a one-hop [`BlindedPath`] with
37563  * [`ChannelManager::get_our_node_id`] as the introduction node instead. In the latter case,
37564  * the node must be announced, otherwise, there is no way to find a path to the introduction in
37565  * order to send the [`InvoiceRequest`].
37566  *
37567  * Also, uses a derived signing pubkey in the offer for recipient privacy.
37568  *
37569  * # Limitations
37570  *
37571  * Requires a direct connection to the introduction node in the responding [`InvoiceRequest`]'s
37572  * reply path.
37573  *
37574  * # Errors
37575  *
37576  * Errors if the parameterized [`Router`] is unable to create a blinded path for the offer.
37577  *
37578  * [`Offer`]: crate::offers::offer::Offer
37579  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
37580  */
37581 MUST_USE_RES struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ChannelManager_create_offer_builder(const struct LDKChannelManager *NONNULL_PTR this_arg);
37582
37583 /**
37584  * Creates a [`RefundBuilder`] such that the [`Refund`] it builds is recognized by the
37585  * [`ChannelManager`] when handling [`Bolt12Invoice`] messages for the refund.
37586  *
37587  * # Payment
37588  *
37589  * The provided `payment_id` is used to ensure that only one invoice is paid for the refund.
37590  * See [Avoiding Duplicate Payments] for other requirements once the payment has been sent.
37591  *
37592  * The builder will have the provided expiration set. Any changes to the expiration on the
37593  * returned builder will not be honored by [`ChannelManager`]. For `no-std`, the highest seen
37594  * block time minus two hours is used for the current time when determining if the refund has
37595  * expired.
37596  *
37597  * To revoke the refund, use [`ChannelManager::abandon_payment`] prior to receiving the
37598  * invoice. If abandoned, or an invoice isn't received before expiration, the payment will fail
37599  * with an [`Event::InvoiceRequestFailed`].
37600  *
37601  * If `max_total_routing_fee_msat` is not specified, The default from
37602  * [`RouteParameters::from_payment_params_and_value`] is applied.
37603  *
37604  * # Privacy
37605  *
37606  * Uses [`MessageRouter::create_blinded_paths`] to construct a [`BlindedPath`] for the refund.
37607  * However, if one is not found, uses a one-hop [`BlindedPath`] with
37608  * [`ChannelManager::get_our_node_id`] as the introduction node instead. In the latter case,
37609  * the node must be announced, otherwise, there is no way to find a path to the introduction in
37610  * order to send the [`Bolt12Invoice`].
37611  *
37612  * Also, uses a derived payer id in the refund for payer privacy.
37613  *
37614  * # Limitations
37615  *
37616  * Requires a direct connection to an introduction node in the responding
37617  * [`Bolt12Invoice::payment_paths`].
37618  *
37619  * # Errors
37620  *
37621  * Errors if:
37622  * - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
37623  * - `amount_msats` is invalid, or
37624  * - the parameterized [`Router`] is unable to create a blinded path for the refund.
37625  *
37626  * [`Refund`]: crate::offers::refund::Refund
37627  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37628  * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
37629  * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
37630  */
37631 MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ChannelManager_create_refund_builder(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t amount_msats, uint64_t absolute_expiry, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, struct LDKCOption_u64Z max_total_routing_fee_msat);
37632
37633 /**
37634  * Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
37635  * enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
37636  * [`Bolt12Invoice`] once it is received.
37637  *
37638  * Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
37639  * the [`ChannelManager`] when handling a [`Bolt12Invoice`] message in response to the request.
37640  * The optional parameters are used in the builder, if `Some`:
37641  * - `quantity` for [`InvoiceRequest::quantity`] which must be set if
37642  *   [`Offer::expects_quantity`] is `true`.
37643  * - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
37644  * - `payer_note` for [`InvoiceRequest::payer_note`].
37645  *
37646  * If `max_total_routing_fee_msat` is not specified, The default from
37647  * [`RouteParameters::from_payment_params_and_value`] is applied.
37648  *
37649  * # Payment
37650  *
37651  * The provided `payment_id` is used to ensure that only one invoice is paid for the request
37652  * when received. See [Avoiding Duplicate Payments] for other requirements once the payment has
37653  * been sent.
37654  *
37655  * To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
37656  * invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
37657  * payment will fail with an [`Event::InvoiceRequestFailed`].
37658  *
37659  * # Privacy
37660  *
37661  * Uses a one-hop [`BlindedPath`] for the reply path with [`ChannelManager::get_our_node_id`]
37662  * as the introduction node and a derived payer id for payer privacy. As such, currently, the
37663  * node must be announced. Otherwise, there is no way to find a path to the introduction node
37664  * in order to send the [`Bolt12Invoice`].
37665  *
37666  * # Limitations
37667  *
37668  * Requires a direct connection to an introduction node in [`Offer::paths`] or to
37669  * [`Offer::signing_pubkey`], if empty. A similar restriction applies to the responding
37670  * [`Bolt12Invoice::payment_paths`].
37671  *
37672  * # Errors
37673  *
37674  * Errors if:
37675  * - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
37676  * - the provided parameters are invalid for the offer,
37677  * - the offer is for an unsupported chain, or
37678  * - the parameterized [`Router`] is unable to create a blinded reply path for the invoice
37679  *   request.
37680  *
37681  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
37682  * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
37683  * [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
37684  * [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
37685  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37686  * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
37687  * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
37688  */
37689 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ ChannelManager_pay_for_offer(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKOffer *NONNULL_PTR offer, struct LDKCOption_u64Z quantity, struct LDKCOption_u64Z amount_msats, struct LDKCOption_StrZ payer_note, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, struct LDKCOption_u64Z max_total_routing_fee_msat);
37690
37691 /**
37692  * Creates a [`Bolt12Invoice`] for a [`Refund`] and enqueues it to be sent via an onion
37693  * message.
37694  *
37695  * The resulting invoice uses a [`PaymentHash`] recognized by the [`ChannelManager`] and a
37696  * [`BlindedPath`] containing the [`PaymentSecret`] needed to reconstruct the corresponding
37697  * [`PaymentPreimage`]. It is returned purely for informational purposes.
37698  *
37699  * # Limitations
37700  *
37701  * Requires a direct connection to an introduction node in [`Refund::paths`] or to
37702  * [`Refund::payer_id`], if empty. This request is best effort; an invoice will be sent to each
37703  * node meeting the aforementioned criteria, but there's no guarantee that they will be
37704  * received and no retries will be made.
37705  *
37706  * # Errors
37707  *
37708  * Errors if:
37709  * - the refund is for an unsupported chain, or
37710  * - the parameterized [`Router`] is unable to create a blinded payment path or reply path for
37711  *   the invoice.
37712  *
37713  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37714  */
37715 MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ ChannelManager_request_refund_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRefund *NONNULL_PTR refund);
37716
37717 /**
37718  * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
37719  * to pay us.
37720  *
37721  * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
37722  * [`PaymentHash`] and [`PaymentPreimage`] for you.
37723  *
37724  * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`] event, which
37725  * will have the [`PaymentClaimable::purpose`] return `Some` for [`PaymentPurpose::preimage`]. That
37726  * should then be passed directly to [`claim_funds`].
37727  *
37728  * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
37729  *
37730  * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
37731  * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
37732  *
37733  * # Note
37734  *
37735  * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
37736  * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
37737  *
37738  * Errors if `min_value_msat` is greater than total bitcoin supply.
37739  *
37740  * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
37741  * on versions of LDK prior to 0.0.114.
37742  *
37743  * [`claim_funds`]: Self::claim_funds
37744  * [`PaymentClaimable`]: events::Event::PaymentClaimable
37745  * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
37746  * [`PaymentPurpose::preimage`]: events::PaymentPurpose::preimage
37747  * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
37748  */
37749 MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
37750
37751 /**
37752  * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
37753  * stored external to LDK.
37754  *
37755  * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
37756  * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
37757  * the `min_value_msat` provided here, if one is provided.
37758  *
37759  * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
37760  * note that LDK will not stop you from registering duplicate payment hashes for inbound
37761  * payments.
37762  *
37763  * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
37764  * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
37765  * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
37766  * sender \"proof-of-payment\" unless they have paid the required amount.
37767  *
37768  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
37769  * in excess of the current time. This should roughly match the expiry time set in the invoice.
37770  * After this many seconds, we will remove the inbound payment, resulting in any attempts to
37771  * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
37772  * invoices when no timeout is set.
37773  *
37774  * Note that we use block header time to time-out pending inbound payments (with some margin
37775  * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
37776  * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
37777  * If you need exact expiry semantics, you should enforce them upon receipt of
37778  * [`PaymentClaimable`].
37779  *
37780  * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
37781  * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
37782  *
37783  * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
37784  * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
37785  *
37786  * # Note
37787  *
37788  * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
37789  * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
37790  *
37791  * Errors if `min_value_msat` is greater than total bitcoin supply.
37792  *
37793  * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
37794  * on versions of LDK prior to 0.0.114.
37795  *
37796  * [`create_inbound_payment`]: Self::create_inbound_payment
37797  * [`PaymentClaimable`]: events::Event::PaymentClaimable
37798  */
37799 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ ChannelManager_create_inbound_payment_for_hash(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry);
37800
37801 /**
37802  * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
37803  * previously returned from [`create_inbound_payment`].
37804  *
37805  * [`create_inbound_payment`]: Self::create_inbound_payment
37806  */
37807 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesAPIErrorZ ChannelManager_get_payment_preimage(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
37808
37809 /**
37810  * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
37811  * are used when constructing the phantom invoice's route hints.
37812  *
37813  * [phantom node payments]: crate::sign::PhantomKeysManager
37814  */
37815 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
37816
37817 /**
37818  * Gets route hints for use in receiving [phantom node payments].
37819  *
37820  * [phantom node payments]: crate::sign::PhantomKeysManager
37821  */
37822 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
37823
37824 /**
37825  * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
37826  * used when constructing the route hints for HTLCs intended to be intercepted. See
37827  * [`ChannelManager::forward_intercepted_htlc`].
37828  *
37829  * Note that this method is not guaranteed to return unique values, you may need to call it a few
37830  * times to get a unique scid.
37831  */
37832 MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
37833
37834 /**
37835  * Gets inflight HTLC information by processing pending outbound payments that are in
37836  * our channels. May be used during pathfinding to account for in-use channel liquidity.
37837  */
37838 MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
37839
37840 /**
37841  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
37842  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
37843  */
37844 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
37845
37846 /**
37847  * Constructs a new EventsProvider which calls the relevant methods on this_arg.
37848  * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
37849  */
37850 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
37851
37852 /**
37853  * Constructs a new Listen which calls the relevant methods on this_arg.
37854  * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
37855  */
37856 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
37857
37858 /**
37859  * Constructs a new Confirm which calls the relevant methods on this_arg.
37860  * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
37861  */
37862 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
37863
37864 /**
37865  * Gets a [`Future`] that completes when this [`ChannelManager`] may need to be persisted or
37866  * may have events that need processing.
37867  *
37868  * In order to check if this [`ChannelManager`] needs persisting, call
37869  * [`Self::get_and_clear_needs_persistence`].
37870  *
37871  * Note that callbacks registered on the [`Future`] MUST NOT call back into this
37872  * [`ChannelManager`] and should instead register actions to be taken later.
37873  */
37874 MUST_USE_RES struct LDKFuture ChannelManager_get_event_or_persistence_needed_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
37875
37876 /**
37877  * Returns true if this [`ChannelManager`] needs to be persisted.
37878  *
37879  * See [`Self::get_event_or_persistence_needed_future`] for retrieving a [`Future`] that
37880  * indicates this should be checked.
37881  */
37882 MUST_USE_RES bool ChannelManager_get_and_clear_needs_persistence(const struct LDKChannelManager *NONNULL_PTR this_arg);
37883
37884 /**
37885  * Gets the latest best block which was connected either via the [`chain::Listen`] or
37886  * [`chain::Confirm`] interfaces.
37887  */
37888 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
37889
37890 /**
37891  * Fetches the set of [`NodeFeatures`] flags that are provided by or required by
37892  * [`ChannelManager`].
37893  */
37894 MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
37895
37896 /**
37897  * Fetches the set of [`ChannelFeatures`] flags that are provided by or required by
37898  * [`ChannelManager`].
37899  */
37900 MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
37901
37902 /**
37903  * Fetches the set of [`ChannelTypeFeatures`] flags that are provided by or required by
37904  * [`ChannelManager`].
37905  */
37906 MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
37907
37908 /**
37909  * Fetches the set of [`InitFeatures`] flags that are provided by or required by
37910  * [`ChannelManager`].
37911  */
37912 MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
37913
37914 /**
37915  * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
37916  * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
37917  */
37918 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
37919
37920 /**
37921  * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
37922  * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
37923  */
37924 struct LDKOffersMessageHandler ChannelManager_as_OffersMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
37925
37926 /**
37927  * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg.
37928  * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is
37929  */
37930 struct LDKNodeIdLookUp ChannelManager_as_NodeIdLookUp(const struct LDKChannelManager *NONNULL_PTR this_arg);
37931
37932 /**
37933  * Fetches the set of [`InitFeatures`] flags that are provided by or required by
37934  * [`ChannelManager`].
37935  */
37936 struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config);
37937
37938 /**
37939  * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
37940  */
37941 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
37942
37943 /**
37944  * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
37945  */
37946 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
37947
37948 /**
37949  * Serialize the BlindedForward object into a byte array which can be read by BlindedForward_read
37950  */
37951 struct LDKCVec_u8Z BlindedForward_write(const struct LDKBlindedForward *NONNULL_PTR obj);
37952
37953 /**
37954  * Read a BlindedForward from a byte array, created by BlindedForward_write
37955  */
37956 struct LDKCResult_BlindedForwardDecodeErrorZ BlindedForward_read(struct LDKu8slice ser);
37957
37958 /**
37959  * Serialize the PendingHTLCRouting object into a byte array which can be read by PendingHTLCRouting_read
37960  */
37961 struct LDKCVec_u8Z PendingHTLCRouting_write(const struct LDKPendingHTLCRouting *NONNULL_PTR obj);
37962
37963 /**
37964  * Read a PendingHTLCRouting from a byte array, created by PendingHTLCRouting_write
37965  */
37966 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ PendingHTLCRouting_read(struct LDKu8slice ser);
37967
37968 /**
37969  * Serialize the PendingHTLCInfo object into a byte array which can be read by PendingHTLCInfo_read
37970  */
37971 struct LDKCVec_u8Z PendingHTLCInfo_write(const struct LDKPendingHTLCInfo *NONNULL_PTR obj);
37972
37973 /**
37974  * Read a PendingHTLCInfo from a byte array, created by PendingHTLCInfo_write
37975  */
37976 struct LDKCResult_PendingHTLCInfoDecodeErrorZ PendingHTLCInfo_read(struct LDKu8slice ser);
37977
37978 /**
37979  * Serialize the BlindedFailure object into a byte array which can be read by BlindedFailure_read
37980  */
37981 struct LDKCVec_u8Z BlindedFailure_write(const enum LDKBlindedFailure *NONNULL_PTR obj);
37982
37983 /**
37984  * Read a BlindedFailure from a byte array, created by BlindedFailure_write
37985  */
37986 struct LDKCResult_BlindedFailureDecodeErrorZ BlindedFailure_read(struct LDKu8slice ser);
37987
37988 /**
37989  * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
37990  */
37991 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
37992
37993 /**
37994  * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
37995  */
37996 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
37997
37998 /**
37999  * A cryptographically secure source of entropy.
38000  */
38001 const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38002
38003 /**
38004  * A cryptographically secure source of entropy.
38005  */
38006 void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val);
38007
38008 /**
38009  * A signer that is able to perform node-scoped cryptographic operations.
38010  */
38011 const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38012
38013 /**
38014  * A signer that is able to perform node-scoped cryptographic operations.
38015  */
38016 void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val);
38017
38018 /**
38019  * The keys provider which will give us relevant keys. Some keys will be loaded during
38020  * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
38021  * signing data.
38022  */
38023 const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38024
38025 /**
38026  * The keys provider which will give us relevant keys. Some keys will be loaded during
38027  * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
38028  * signing data.
38029  */
38030 void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val);
38031
38032 /**
38033  * The fee_estimator for use in the ChannelManager in the future.
38034  *
38035  * No calls to the FeeEstimator will be made during deserialization.
38036  */
38037 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38038
38039 /**
38040  * The fee_estimator for use in the ChannelManager in the future.
38041  *
38042  * No calls to the FeeEstimator will be made during deserialization.
38043  */
38044 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
38045
38046 /**
38047  * The chain::Watch for use in the ChannelManager in the future.
38048  *
38049  * No calls to the chain::Watch will be made during deserialization. It is assumed that
38050  * you have deserialized ChannelMonitors separately and will add them to your
38051  * chain::Watch after deserializing this ChannelManager.
38052  */
38053 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38054
38055 /**
38056  * The chain::Watch for use in the ChannelManager in the future.
38057  *
38058  * No calls to the chain::Watch will be made during deserialization. It is assumed that
38059  * you have deserialized ChannelMonitors separately and will add them to your
38060  * chain::Watch after deserializing this ChannelManager.
38061  */
38062 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
38063
38064 /**
38065  * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
38066  * used to broadcast the latest local commitment transactions of channels which must be
38067  * force-closed during deserialization.
38068  */
38069 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38070
38071 /**
38072  * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
38073  * used to broadcast the latest local commitment transactions of channels which must be
38074  * force-closed during deserialization.
38075  */
38076 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
38077
38078 /**
38079  * The router which will be used in the ChannelManager in the future for finding routes
38080  * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
38081  *
38082  * No calls to the router will be made during deserialization.
38083  */
38084 const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38085
38086 /**
38087  * The router which will be used in the ChannelManager in the future for finding routes
38088  * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
38089  *
38090  * No calls to the router will be made during deserialization.
38091  */
38092 void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val);
38093
38094 /**
38095  * The Logger for use in the ChannelManager and which may be used to log information during
38096  * deserialization.
38097  */
38098 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38099
38100 /**
38101  * The Logger for use in the ChannelManager and which may be used to log information during
38102  * deserialization.
38103  */
38104 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
38105
38106 /**
38107  * Default settings used for new channels. Any existing channels will continue to use the
38108  * runtime settings which were stored when the ChannelManager was serialized.
38109  */
38110 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38111
38112 /**
38113  * Default settings used for new channels. Any existing channels will continue to use the
38114  * runtime settings which were stored when the ChannelManager was serialized.
38115  */
38116 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
38117
38118 /**
38119  * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
38120  * HashMap for you. This is primarily useful for C bindings where it is not practical to
38121  * populate a HashMap directly from C.
38122  */
38123 MUST_USE_RES struct LDKChannelManagerReadArgs ChannelManagerReadArgs_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKFeeEstimator fee_estimator, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKLogger logger, struct LDKUserConfig default_config, struct LDKCVec_ChannelMonitorZ channel_monitors);
38124
38125 /**
38126  * Read a C2Tuple_ThirtyTwoBytesChannelManagerZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelManagerZ_write
38127  */
38128 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
38129
38130 /**
38131  * Frees any resources used by the DelayedPaymentBasepoint, if is_owned is set and inner is non-NULL.
38132  */
38133 void DelayedPaymentBasepoint_free(struct LDKDelayedPaymentBasepoint this_obj);
38134
38135 struct LDKPublicKey DelayedPaymentBasepoint_get_a(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr);
38136
38137 void DelayedPaymentBasepoint_set_a(struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38138
38139 /**
38140  * Constructs a new DelayedPaymentBasepoint given each field
38141  */
38142 MUST_USE_RES struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_new(struct LDKPublicKey a_arg);
38143
38144 /**
38145  * Checks if two DelayedPaymentBasepoints contain equal inner contents.
38146  * This ignores pointers and is_owned flags and looks at the values in fields.
38147  * Two objects with NULL inner values will be considered "equal" here.
38148  */
38149 bool DelayedPaymentBasepoint_eq(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR a, const struct LDKDelayedPaymentBasepoint *NONNULL_PTR b);
38150
38151 /**
38152  * Creates a copy of the DelayedPaymentBasepoint
38153  */
38154 struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_clone(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR orig);
38155
38156 /**
38157  * Generates a non-cryptographic 64-bit hash of the DelayedPaymentBasepoint.
38158  */
38159 uint64_t DelayedPaymentBasepoint_hash(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR o);
38160
38161 /**
38162  * Get inner Public Key
38163  */
38164 MUST_USE_RES struct LDKPublicKey DelayedPaymentBasepoint_to_public_key(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg);
38165
38166 /**
38167  *Derives the \"tweak\" used in calculate [`DelayedPaymentKey::from_basepoint`].\n\n[`DelayedPaymentKey::from_basepoint`] calculates a private key as:\n`privkey = basepoint_secret + SHA256(per_commitment_point || basepoint)`\n\nThis calculates the hash part in the tweak derivation process, which is used to\nensure that each key is unique and cannot be guessed by an external party.
38168  */
38169 MUST_USE_RES struct LDKThirtyTwoBytes DelayedPaymentBasepoint_derive_add_tweak(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point);
38170
38171 /**
38172  * Serialize the DelayedPaymentBasepoint object into a byte array which can be read by DelayedPaymentBasepoint_read
38173  */
38174 struct LDKCVec_u8Z DelayedPaymentBasepoint_write(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR obj);
38175
38176 /**
38177  * Read a DelayedPaymentBasepoint from a byte array, created by DelayedPaymentBasepoint_write
38178  */
38179 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ DelayedPaymentBasepoint_read(struct LDKu8slice ser);
38180
38181 /**
38182  * Frees any resources used by the DelayedPaymentKey, if is_owned is set and inner is non-NULL.
38183  */
38184 void DelayedPaymentKey_free(struct LDKDelayedPaymentKey this_obj);
38185
38186 struct LDKPublicKey DelayedPaymentKey_get_a(const struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr);
38187
38188 void DelayedPaymentKey_set_a(struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38189
38190 /**
38191  * Constructs a new DelayedPaymentKey given each field
38192  */
38193 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_new(struct LDKPublicKey a_arg);
38194
38195 /**
38196  * Checks if two DelayedPaymentKeys contain equal inner contents.
38197  * This ignores pointers and is_owned flags and looks at the values in fields.
38198  * Two objects with NULL inner values will be considered "equal" here.
38199  */
38200 bool DelayedPaymentKey_eq(const struct LDKDelayedPaymentKey *NONNULL_PTR a, const struct LDKDelayedPaymentKey *NONNULL_PTR b);
38201
38202 /**
38203  * Creates a copy of the DelayedPaymentKey
38204  */
38205 struct LDKDelayedPaymentKey DelayedPaymentKey_clone(const struct LDKDelayedPaymentKey *NONNULL_PTR orig);
38206
38207 /**
38208  *Derive a public delayedpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
38209  */
38210 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_basepoint(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
38211
38212 /**
38213  *Build a delayedpubkey directly from an already-derived private key
38214  */
38215 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_secret_key(const uint8_t (*sk)[32]);
38216
38217 /**
38218  * Get inner Public Key
38219  */
38220 MUST_USE_RES struct LDKPublicKey DelayedPaymentKey_to_public_key(const struct LDKDelayedPaymentKey *NONNULL_PTR this_arg);
38221
38222 /**
38223  * Serialize the DelayedPaymentKey object into a byte array which can be read by DelayedPaymentKey_read
38224  */
38225 struct LDKCVec_u8Z DelayedPaymentKey_write(const struct LDKDelayedPaymentKey *NONNULL_PTR obj);
38226
38227 /**
38228  * Read a DelayedPaymentKey from a byte array, created by DelayedPaymentKey_write
38229  */
38230 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ DelayedPaymentKey_read(struct LDKu8slice ser);
38231
38232 /**
38233  * Frees any resources used by the HtlcBasepoint, if is_owned is set and inner is non-NULL.
38234  */
38235 void HtlcBasepoint_free(struct LDKHtlcBasepoint this_obj);
38236
38237 struct LDKPublicKey HtlcBasepoint_get_a(const struct LDKHtlcBasepoint *NONNULL_PTR this_ptr);
38238
38239 void HtlcBasepoint_set_a(struct LDKHtlcBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38240
38241 /**
38242  * Constructs a new HtlcBasepoint given each field
38243  */
38244 MUST_USE_RES struct LDKHtlcBasepoint HtlcBasepoint_new(struct LDKPublicKey a_arg);
38245
38246 /**
38247  * Checks if two HtlcBasepoints contain equal inner contents.
38248  * This ignores pointers and is_owned flags and looks at the values in fields.
38249  * Two objects with NULL inner values will be considered "equal" here.
38250  */
38251 bool HtlcBasepoint_eq(const struct LDKHtlcBasepoint *NONNULL_PTR a, const struct LDKHtlcBasepoint *NONNULL_PTR b);
38252
38253 /**
38254  * Creates a copy of the HtlcBasepoint
38255  */
38256 struct LDKHtlcBasepoint HtlcBasepoint_clone(const struct LDKHtlcBasepoint *NONNULL_PTR orig);
38257
38258 /**
38259  * Generates a non-cryptographic 64-bit hash of the HtlcBasepoint.
38260  */
38261 uint64_t HtlcBasepoint_hash(const struct LDKHtlcBasepoint *NONNULL_PTR o);
38262
38263 /**
38264  * Get inner Public Key
38265  */
38266 MUST_USE_RES struct LDKPublicKey HtlcBasepoint_to_public_key(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg);
38267
38268 /**
38269  *Derives the \"tweak\" used in calculate [`HtlcKey::from_basepoint`].\n\n[`HtlcKey::from_basepoint`] calculates a private key as:\n`privkey = basepoint_secret + SHA256(per_commitment_point || basepoint)`\n\nThis calculates the hash part in the tweak derivation process, which is used to\nensure that each key is unique and cannot be guessed by an external party.
38270  */
38271 MUST_USE_RES struct LDKThirtyTwoBytes HtlcBasepoint_derive_add_tweak(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point);
38272
38273 /**
38274  * Serialize the HtlcBasepoint object into a byte array which can be read by HtlcBasepoint_read
38275  */
38276 struct LDKCVec_u8Z HtlcBasepoint_write(const struct LDKHtlcBasepoint *NONNULL_PTR obj);
38277
38278 /**
38279  * Read a HtlcBasepoint from a byte array, created by HtlcBasepoint_write
38280  */
38281 struct LDKCResult_HtlcBasepointDecodeErrorZ HtlcBasepoint_read(struct LDKu8slice ser);
38282
38283 /**
38284  * Frees any resources used by the HtlcKey, if is_owned is set and inner is non-NULL.
38285  */
38286 void HtlcKey_free(struct LDKHtlcKey this_obj);
38287
38288 struct LDKPublicKey HtlcKey_get_a(const struct LDKHtlcKey *NONNULL_PTR this_ptr);
38289
38290 void HtlcKey_set_a(struct LDKHtlcKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38291
38292 /**
38293  * Constructs a new HtlcKey given each field
38294  */
38295 MUST_USE_RES struct LDKHtlcKey HtlcKey_new(struct LDKPublicKey a_arg);
38296
38297 /**
38298  * Checks if two HtlcKeys contain equal inner contents.
38299  * This ignores pointers and is_owned flags and looks at the values in fields.
38300  * Two objects with NULL inner values will be considered "equal" here.
38301  */
38302 bool HtlcKey_eq(const struct LDKHtlcKey *NONNULL_PTR a, const struct LDKHtlcKey *NONNULL_PTR b);
38303
38304 /**
38305  * Creates a copy of the HtlcKey
38306  */
38307 struct LDKHtlcKey HtlcKey_clone(const struct LDKHtlcKey *NONNULL_PTR orig);
38308
38309 /**
38310  *Derive a public htlcpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
38311  */
38312 MUST_USE_RES struct LDKHtlcKey HtlcKey_from_basepoint(const struct LDKHtlcBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
38313
38314 /**
38315  *Build a htlcpubkey directly from an already-derived private key
38316  */
38317 MUST_USE_RES struct LDKHtlcKey HtlcKey_from_secret_key(const uint8_t (*sk)[32]);
38318
38319 /**
38320  * Get inner Public Key
38321  */
38322 MUST_USE_RES struct LDKPublicKey HtlcKey_to_public_key(const struct LDKHtlcKey *NONNULL_PTR this_arg);
38323
38324 /**
38325  * Serialize the HtlcKey object into a byte array which can be read by HtlcKey_read
38326  */
38327 struct LDKCVec_u8Z HtlcKey_write(const struct LDKHtlcKey *NONNULL_PTR obj);
38328
38329 /**
38330  * Read a HtlcKey from a byte array, created by HtlcKey_write
38331  */
38332 struct LDKCResult_HtlcKeyDecodeErrorZ HtlcKey_read(struct LDKu8slice ser);
38333
38334 /**
38335  * Adds a tweak to a public key to derive a new public key.
38336  *
38337  * May panic if `tweak` is not the output of a SHA-256 hash.
38338  */
38339 struct LDKPublicKey add_public_key_tweak(struct LDKPublicKey base_point, const uint8_t (*tweak)[32]);
38340
38341 /**
38342  * Frees any resources used by the RevocationBasepoint, if is_owned is set and inner is non-NULL.
38343  */
38344 void RevocationBasepoint_free(struct LDKRevocationBasepoint this_obj);
38345
38346 struct LDKPublicKey RevocationBasepoint_get_a(const struct LDKRevocationBasepoint *NONNULL_PTR this_ptr);
38347
38348 void RevocationBasepoint_set_a(struct LDKRevocationBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38349
38350 /**
38351  * Constructs a new RevocationBasepoint given each field
38352  */
38353 MUST_USE_RES struct LDKRevocationBasepoint RevocationBasepoint_new(struct LDKPublicKey a_arg);
38354
38355 /**
38356  * Checks if two RevocationBasepoints contain equal inner contents.
38357  * This ignores pointers and is_owned flags and looks at the values in fields.
38358  * Two objects with NULL inner values will be considered "equal" here.
38359  */
38360 bool RevocationBasepoint_eq(const struct LDKRevocationBasepoint *NONNULL_PTR a, const struct LDKRevocationBasepoint *NONNULL_PTR b);
38361
38362 /**
38363  * Creates a copy of the RevocationBasepoint
38364  */
38365 struct LDKRevocationBasepoint RevocationBasepoint_clone(const struct LDKRevocationBasepoint *NONNULL_PTR orig);
38366
38367 /**
38368  * Generates a non-cryptographic 64-bit hash of the RevocationBasepoint.
38369  */
38370 uint64_t RevocationBasepoint_hash(const struct LDKRevocationBasepoint *NONNULL_PTR o);
38371
38372 /**
38373  * Get inner Public Key
38374  */
38375 MUST_USE_RES struct LDKPublicKey RevocationBasepoint_to_public_key(const struct LDKRevocationBasepoint *NONNULL_PTR this_arg);
38376
38377 /**
38378  * Serialize the RevocationBasepoint object into a byte array which can be read by RevocationBasepoint_read
38379  */
38380 struct LDKCVec_u8Z RevocationBasepoint_write(const struct LDKRevocationBasepoint *NONNULL_PTR obj);
38381
38382 /**
38383  * Read a RevocationBasepoint from a byte array, created by RevocationBasepoint_write
38384  */
38385 struct LDKCResult_RevocationBasepointDecodeErrorZ RevocationBasepoint_read(struct LDKu8slice ser);
38386
38387 /**
38388  * Frees any resources used by the RevocationKey, if is_owned is set and inner is non-NULL.
38389  */
38390 void RevocationKey_free(struct LDKRevocationKey this_obj);
38391
38392 struct LDKPublicKey RevocationKey_get_a(const struct LDKRevocationKey *NONNULL_PTR this_ptr);
38393
38394 void RevocationKey_set_a(struct LDKRevocationKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38395
38396 /**
38397  * Constructs a new RevocationKey given each field
38398  */
38399 MUST_USE_RES struct LDKRevocationKey RevocationKey_new(struct LDKPublicKey a_arg);
38400
38401 /**
38402  * Checks if two RevocationKeys contain equal inner contents.
38403  * This ignores pointers and is_owned flags and looks at the values in fields.
38404  * Two objects with NULL inner values will be considered "equal" here.
38405  */
38406 bool RevocationKey_eq(const struct LDKRevocationKey *NONNULL_PTR a, const struct LDKRevocationKey *NONNULL_PTR b);
38407
38408 /**
38409  * Creates a copy of the RevocationKey
38410  */
38411 struct LDKRevocationKey RevocationKey_clone(const struct LDKRevocationKey *NONNULL_PTR orig);
38412
38413 /**
38414  * Generates a non-cryptographic 64-bit hash of the RevocationKey.
38415  */
38416 uint64_t RevocationKey_hash(const struct LDKRevocationKey *NONNULL_PTR o);
38417
38418 /**
38419  * Derives a per-commitment-transaction revocation public key from one party's per-commitment
38420  * point and the other party's [`RevocationBasepoint`]. This is the public equivalent of
38421  * [`chan_utils::derive_private_revocation_key`] - using only public keys to derive a public
38422  * key instead of private keys.
38423  *
38424  * Note that this is infallible iff we trust that at least one of the two input keys are randomly
38425  * generated (ie our own).
38426  *
38427  * [`chan_utils::derive_private_revocation_key`]: crate::ln::chan_utils::derive_private_revocation_key
38428  */
38429 MUST_USE_RES struct LDKRevocationKey RevocationKey_from_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
38430
38431 /**
38432  * Get inner Public Key
38433  */
38434 MUST_USE_RES struct LDKPublicKey RevocationKey_to_public_key(const struct LDKRevocationKey *NONNULL_PTR this_arg);
38435
38436 /**
38437  * Serialize the RevocationKey object into a byte array which can be read by RevocationKey_read
38438  */
38439 struct LDKCVec_u8Z RevocationKey_write(const struct LDKRevocationKey *NONNULL_PTR obj);
38440
38441 /**
38442  * Read a RevocationKey from a byte array, created by RevocationKey_write
38443  */
38444 struct LDKCResult_RevocationKeyDecodeErrorZ RevocationKey_read(struct LDKu8slice ser);
38445
38446 /**
38447  * Creates a copy of the InboundHTLCStateDetails
38448  */
38449 enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_clone(const enum LDKInboundHTLCStateDetails *NONNULL_PTR orig);
38450
38451 /**
38452  * Utility method to constructs a new AwaitingRemoteRevokeToAdd-variant InboundHTLCStateDetails
38453  */
38454 enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_add(void);
38455
38456 /**
38457  * Utility method to constructs a new Committed-variant InboundHTLCStateDetails
38458  */
38459 enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_committed(void);
38460
38461 /**
38462  * Utility method to constructs a new AwaitingRemoteRevokeToRemoveFulfill-variant InboundHTLCStateDetails
38463  */
38464 enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fulfill(void);
38465
38466 /**
38467  * Utility method to constructs a new AwaitingRemoteRevokeToRemoveFail-variant InboundHTLCStateDetails
38468  */
38469 enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fail(void);
38470
38471 /**
38472  * Serialize the InboundHTLCStateDetails object into a byte array which can be read by InboundHTLCStateDetails_read
38473  */
38474 struct LDKCVec_u8Z InboundHTLCStateDetails_write(const enum LDKInboundHTLCStateDetails *NONNULL_PTR obj);
38475
38476 /**
38477  * Read a InboundHTLCStateDetails from a byte array, created by InboundHTLCStateDetails_write
38478  */
38479 struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ InboundHTLCStateDetails_read(struct LDKu8slice ser);
38480
38481 /**
38482  * Frees any resources used by the InboundHTLCDetails, if is_owned is set and inner is non-NULL.
38483  */
38484 void InboundHTLCDetails_free(struct LDKInboundHTLCDetails this_obj);
38485
38486 /**
38487  * The HTLC ID.
38488  * The IDs are incremented by 1 starting from 0 for each offered HTLC.
38489  * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced
38490  * and not part of any commitment transaction.
38491  */
38492 uint64_t InboundHTLCDetails_get_htlc_id(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
38493
38494 /**
38495  * The HTLC ID.
38496  * The IDs are incremented by 1 starting from 0 for each offered HTLC.
38497  * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced
38498  * and not part of any commitment transaction.
38499  */
38500 void InboundHTLCDetails_set_htlc_id(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, uint64_t val);
38501
38502 /**
38503  * The amount in msat.
38504  */
38505 uint64_t InboundHTLCDetails_get_amount_msat(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
38506
38507 /**
38508  * The amount in msat.
38509  */
38510 void InboundHTLCDetails_set_amount_msat(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, uint64_t val);
38511
38512 /**
38513  * The block height at which this HTLC expires.
38514  */
38515 uint32_t InboundHTLCDetails_get_cltv_expiry(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
38516
38517 /**
38518  * The block height at which this HTLC expires.
38519  */
38520 void InboundHTLCDetails_set_cltv_expiry(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, uint32_t val);
38521
38522 /**
38523  * The payment hash.
38524  */
38525 const uint8_t (*InboundHTLCDetails_get_payment_hash(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr))[32];
38526
38527 /**
38528  * The payment hash.
38529  */
38530 void InboundHTLCDetails_set_payment_hash(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38531
38532 /**
38533  * The state of the HTLC in the state machine.
38534  *
38535  * Determines on which commitment transactions the HTLC is included and what message the HTLC is
38536  * waiting for to advance to the next state.
38537  *
38538  * See [`InboundHTLCStateDetails`] for information on the specific states.
38539  *
38540  * LDK will always fill this field in, but when downgrading to prior versions of LDK, new
38541  * states may result in `None` here.
38542  */
38543 struct LDKCOption_InboundHTLCStateDetailsZ InboundHTLCDetails_get_state(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
38544
38545 /**
38546  * The state of the HTLC in the state machine.
38547  *
38548  * Determines on which commitment transactions the HTLC is included and what message the HTLC is
38549  * waiting for to advance to the next state.
38550  *
38551  * See [`InboundHTLCStateDetails`] for information on the specific states.
38552  *
38553  * LDK will always fill this field in, but when downgrading to prior versions of LDK, new
38554  * states may result in `None` here.
38555  */
38556 void InboundHTLCDetails_set_state(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_InboundHTLCStateDetailsZ val);
38557
38558 /**
38559  * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed
38560  * from the local commitment transaction and added to the commitment transaction fee.
38561  * For non-anchor channels, this takes into account the cost of the second-stage HTLC
38562  * transactions as well.
38563  *
38564  * When the local commitment transaction is broadcasted as part of a unilateral closure,
38565  * the value of this HTLC will therefore not be claimable but instead burned as a transaction
38566  * fee.
38567  *
38568  * Note that dust limits are specific to each party. An HTLC can be dust for the local
38569  * commitment transaction but not for the counterparty's commitment transaction and vice versa.
38570  */
38571 bool InboundHTLCDetails_get_is_dust(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
38572
38573 /**
38574  * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed
38575  * from the local commitment transaction and added to the commitment transaction fee.
38576  * For non-anchor channels, this takes into account the cost of the second-stage HTLC
38577  * transactions as well.
38578  *
38579  * When the local commitment transaction is broadcasted as part of a unilateral closure,
38580  * the value of this HTLC will therefore not be claimable but instead burned as a transaction
38581  * fee.
38582  *
38583  * Note that dust limits are specific to each party. An HTLC can be dust for the local
38584  * commitment transaction but not for the counterparty's commitment transaction and vice versa.
38585  */
38586 void InboundHTLCDetails_set_is_dust(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, bool val);
38587
38588 /**
38589  * Constructs a new InboundHTLCDetails given each field
38590  */
38591 MUST_USE_RES struct LDKInboundHTLCDetails InboundHTLCDetails_new(uint64_t htlc_id_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_InboundHTLCStateDetailsZ state_arg, bool is_dust_arg);
38592
38593 /**
38594  * Creates a copy of the InboundHTLCDetails
38595  */
38596 struct LDKInboundHTLCDetails InboundHTLCDetails_clone(const struct LDKInboundHTLCDetails *NONNULL_PTR orig);
38597
38598 /**
38599  * Serialize the InboundHTLCDetails object into a byte array which can be read by InboundHTLCDetails_read
38600  */
38601 struct LDKCVec_u8Z InboundHTLCDetails_write(const struct LDKInboundHTLCDetails *NONNULL_PTR obj);
38602
38603 /**
38604  * Read a InboundHTLCDetails from a byte array, created by InboundHTLCDetails_write
38605  */
38606 struct LDKCResult_InboundHTLCDetailsDecodeErrorZ InboundHTLCDetails_read(struct LDKu8slice ser);
38607
38608 /**
38609  * Creates a copy of the OutboundHTLCStateDetails
38610  */
38611 enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_clone(const enum LDKOutboundHTLCStateDetails *NONNULL_PTR orig);
38612
38613 /**
38614  * Utility method to constructs a new AwaitingRemoteRevokeToAdd-variant OutboundHTLCStateDetails
38615  */
38616 enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_add(void);
38617
38618 /**
38619  * Utility method to constructs a new Committed-variant OutboundHTLCStateDetails
38620  */
38621 enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_committed(void);
38622
38623 /**
38624  * Utility method to constructs a new AwaitingRemoteRevokeToRemoveSuccess-variant OutboundHTLCStateDetails
38625  */
38626 enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_success(void);
38627
38628 /**
38629  * Utility method to constructs a new AwaitingRemoteRevokeToRemoveFailure-variant OutboundHTLCStateDetails
38630  */
38631 enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_failure(void);
38632
38633 /**
38634  * Serialize the OutboundHTLCStateDetails object into a byte array which can be read by OutboundHTLCStateDetails_read
38635  */
38636 struct LDKCVec_u8Z OutboundHTLCStateDetails_write(const enum LDKOutboundHTLCStateDetails *NONNULL_PTR obj);
38637
38638 /**
38639  * Read a OutboundHTLCStateDetails from a byte array, created by OutboundHTLCStateDetails_write
38640  */
38641 struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ OutboundHTLCStateDetails_read(struct LDKu8slice ser);
38642
38643 /**
38644  * Frees any resources used by the OutboundHTLCDetails, if is_owned is set and inner is non-NULL.
38645  */
38646 void OutboundHTLCDetails_free(struct LDKOutboundHTLCDetails this_obj);
38647
38648 /**
38649  * The HTLC ID.
38650  * The IDs are incremented by 1 starting from 0 for each offered HTLC.
38651  * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced
38652  * and not part of any commitment transaction.
38653  *
38654  * Not present when we are awaiting a remote revocation and the HTLC is not added yet.
38655  */
38656 struct LDKCOption_u64Z OutboundHTLCDetails_get_htlc_id(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
38657
38658 /**
38659  * The HTLC ID.
38660  * The IDs are incremented by 1 starting from 0 for each offered HTLC.
38661  * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced
38662  * and not part of any commitment transaction.
38663  *
38664  * Not present when we are awaiting a remote revocation and the HTLC is not added yet.
38665  */
38666 void OutboundHTLCDetails_set_htlc_id(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
38667
38668 /**
38669  * The amount in msat.
38670  */
38671 uint64_t OutboundHTLCDetails_get_amount_msat(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
38672
38673 /**
38674  * The amount in msat.
38675  */
38676 void OutboundHTLCDetails_set_amount_msat(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, uint64_t val);
38677
38678 /**
38679  * The block height at which this HTLC expires.
38680  */
38681 uint32_t OutboundHTLCDetails_get_cltv_expiry(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
38682
38683 /**
38684  * The block height at which this HTLC expires.
38685  */
38686 void OutboundHTLCDetails_set_cltv_expiry(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, uint32_t val);
38687
38688 /**
38689  * The payment hash.
38690  */
38691 const uint8_t (*OutboundHTLCDetails_get_payment_hash(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr))[32];
38692
38693 /**
38694  * The payment hash.
38695  */
38696 void OutboundHTLCDetails_set_payment_hash(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38697
38698 /**
38699  * The state of the HTLC in the state machine.
38700  *
38701  * Determines on which commitment transactions the HTLC is included and what message the HTLC is
38702  * waiting for to advance to the next state.
38703  *
38704  * See [`OutboundHTLCStateDetails`] for information on the specific states.
38705  *
38706  * LDK will always fill this field in, but when downgrading to prior versions of LDK, new
38707  * states may result in `None` here.
38708  */
38709 struct LDKCOption_OutboundHTLCStateDetailsZ OutboundHTLCDetails_get_state(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
38710
38711 /**
38712  * The state of the HTLC in the state machine.
38713  *
38714  * Determines on which commitment transactions the HTLC is included and what message the HTLC is
38715  * waiting for to advance to the next state.
38716  *
38717  * See [`OutboundHTLCStateDetails`] for information on the specific states.
38718  *
38719  * LDK will always fill this field in, but when downgrading to prior versions of LDK, new
38720  * states may result in `None` here.
38721  */
38722 void OutboundHTLCDetails_set_state(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_OutboundHTLCStateDetailsZ val);
38723
38724 /**
38725  * The extra fee being skimmed off the top of this HTLC.
38726  */
38727 struct LDKCOption_u64Z OutboundHTLCDetails_get_skimmed_fee_msat(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
38728
38729 /**
38730  * The extra fee being skimmed off the top of this HTLC.
38731  */
38732 void OutboundHTLCDetails_set_skimmed_fee_msat(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
38733
38734 /**
38735  * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed
38736  * from the local commitment transaction and added to the commitment transaction fee.
38737  * For non-anchor channels, this takes into account the cost of the second-stage HTLC
38738  * transactions as well.
38739  *
38740  * When the local commitment transaction is broadcasted as part of a unilateral closure,
38741  * the value of this HTLC will therefore not be claimable but instead burned as a transaction
38742  * fee.
38743  *
38744  * Note that dust limits are specific to each party. An HTLC can be dust for the local
38745  * commitment transaction but not for the counterparty's commitment transaction and vice versa.
38746  */
38747 bool OutboundHTLCDetails_get_is_dust(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
38748
38749 /**
38750  * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed
38751  * from the local commitment transaction and added to the commitment transaction fee.
38752  * For non-anchor channels, this takes into account the cost of the second-stage HTLC
38753  * transactions as well.
38754  *
38755  * When the local commitment transaction is broadcasted as part of a unilateral closure,
38756  * the value of this HTLC will therefore not be claimable but instead burned as a transaction
38757  * fee.
38758  *
38759  * Note that dust limits are specific to each party. An HTLC can be dust for the local
38760  * commitment transaction but not for the counterparty's commitment transaction and vice versa.
38761  */
38762 void OutboundHTLCDetails_set_is_dust(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, bool val);
38763
38764 /**
38765  * Constructs a new OutboundHTLCDetails given each field
38766  */
38767 MUST_USE_RES struct LDKOutboundHTLCDetails OutboundHTLCDetails_new(struct LDKCOption_u64Z htlc_id_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_OutboundHTLCStateDetailsZ state_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg, bool is_dust_arg);
38768
38769 /**
38770  * Creates a copy of the OutboundHTLCDetails
38771  */
38772 struct LDKOutboundHTLCDetails OutboundHTLCDetails_clone(const struct LDKOutboundHTLCDetails *NONNULL_PTR orig);
38773
38774 /**
38775  * Serialize the OutboundHTLCDetails object into a byte array which can be read by OutboundHTLCDetails_read
38776  */
38777 struct LDKCVec_u8Z OutboundHTLCDetails_write(const struct LDKOutboundHTLCDetails *NONNULL_PTR obj);
38778
38779 /**
38780  * Read a OutboundHTLCDetails from a byte array, created by OutboundHTLCDetails_write
38781  */
38782 struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ OutboundHTLCDetails_read(struct LDKu8slice ser);
38783
38784 /**
38785  * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
38786  */
38787 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
38788
38789 /**
38790  * Base routing fee in millisatoshis.
38791  */
38792 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
38793
38794 /**
38795  * Base routing fee in millisatoshis.
38796  */
38797 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
38798
38799 /**
38800  * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
38801  */
38802 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
38803
38804 /**
38805  * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
38806  */
38807 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
38808
38809 /**
38810  * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
38811  * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
38812  * `cltv_expiry_delta` for more details.
38813  */
38814 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
38815
38816 /**
38817  * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
38818  * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
38819  * `cltv_expiry_delta` for more details.
38820  */
38821 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
38822
38823 /**
38824  * Constructs a new CounterpartyForwardingInfo given each field
38825  */
38826 MUST_USE_RES struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg);
38827
38828 /**
38829  * Creates a copy of the CounterpartyForwardingInfo
38830  */
38831 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
38832
38833 /**
38834  * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
38835  */
38836 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
38837
38838 /**
38839  * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
38840  */
38841 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
38842
38843 /**
38844  * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
38845  */
38846 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
38847
38848 /**
38849  * The node_id of our counterparty
38850  */
38851 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
38852
38853 /**
38854  * The node_id of our counterparty
38855  */
38856 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38857
38858 /**
38859  * The Features the channel counterparty provided upon last connection.
38860  * Useful for routing as it is the most up-to-date copy of the counterparty's features and
38861  * many routing-relevant features are present in the init context.
38862  */
38863 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
38864
38865 /**
38866  * The Features the channel counterparty provided upon last connection.
38867  * Useful for routing as it is the most up-to-date copy of the counterparty's features and
38868  * many routing-relevant features are present in the init context.
38869  */
38870 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
38871
38872 /**
38873  * The value, in satoshis, that must always be held in the channel for our counterparty. This
38874  * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
38875  * claiming at least this value on chain.
38876  *
38877  * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
38878  *
38879  * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
38880  */
38881 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
38882
38883 /**
38884  * The value, in satoshis, that must always be held in the channel for our counterparty. This
38885  * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
38886  * claiming at least this value on chain.
38887  *
38888  * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
38889  *
38890  * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
38891  */
38892 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
38893
38894 /**
38895  * Information on the fees and requirements that the counterparty requires when forwarding
38896  * payments to us through this channel.
38897  *
38898  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38899  */
38900 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
38901
38902 /**
38903  * Information on the fees and requirements that the counterparty requires when forwarding
38904  * payments to us through this channel.
38905  *
38906  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
38907  */
38908 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
38909
38910 /**
38911  * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
38912  * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
38913  * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
38914  */
38915 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
38916
38917 /**
38918  * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
38919  * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
38920  * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
38921  */
38922 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
38923
38924 /**
38925  * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
38926  */
38927 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
38928
38929 /**
38930  * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
38931  */
38932 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
38933
38934 /**
38935  * Constructs a new ChannelCounterparty given each field
38936  *
38937  * Note that forwarding_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
38938  */
38939 MUST_USE_RES struct LDKChannelCounterparty ChannelCounterparty_new(struct LDKPublicKey node_id_arg, struct LDKInitFeatures features_arg, uint64_t unspendable_punishment_reserve_arg, struct LDKCounterpartyForwardingInfo forwarding_info_arg, struct LDKCOption_u64Z outbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z outbound_htlc_maximum_msat_arg);
38940
38941 /**
38942  * Creates a copy of the ChannelCounterparty
38943  */
38944 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
38945
38946 /**
38947  * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
38948  */
38949 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
38950
38951 /**
38952  * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
38953  */
38954 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
38955
38956 /**
38957  * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
38958  */
38959 void ChannelDetails_free(struct LDKChannelDetails this_obj);
38960
38961 /**
38962  * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
38963  * thereafter this is the txid of the funding transaction xor the funding transaction output).
38964  * Note that this means this value is *not* persistent - it can change once during the
38965  * lifetime of the channel.
38966  */
38967 struct LDKChannelId ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
38968
38969 /**
38970  * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
38971  * thereafter this is the txid of the funding transaction xor the funding transaction output).
38972  * Note that this means this value is *not* persistent - it can change once during the
38973  * lifetime of the channel.
38974  */
38975 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelId val);
38976
38977 /**
38978  * Parameters which apply to our counterparty. See individual fields for more information.
38979  */
38980 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
38981
38982 /**
38983  * Parameters which apply to our counterparty. See individual fields for more information.
38984  */
38985 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
38986
38987 /**
38988  * The Channel's funding transaction output, if we've negotiated the funding transaction with
38989  * our counterparty already.
38990  *
38991  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38992  */
38993 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
38994
38995 /**
38996  * The Channel's funding transaction output, if we've negotiated the funding transaction with
38997  * our counterparty already.
38998  *
38999  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
39000  */
39001 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
39002
39003 /**
39004  * The features which this channel operates with. See individual features for more info.
39005  *
39006  * `None` until negotiation completes and the channel type is finalized.
39007  *
39008  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39009  */
39010 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39011
39012 /**
39013  * The features which this channel operates with. See individual features for more info.
39014  *
39015  * `None` until negotiation completes and the channel type is finalized.
39016  *
39017  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
39018  */
39019 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
39020
39021 /**
39022  * The position of the funding transaction in the chain. None if the funding transaction has
39023  * not yet been confirmed and the channel fully opened.
39024  *
39025  * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
39026  * payments instead of this. See [`get_inbound_payment_scid`].
39027  *
39028  * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
39029  * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
39030  *
39031  * [`inbound_scid_alias`]: Self::inbound_scid_alias
39032  * [`outbound_scid_alias`]: Self::outbound_scid_alias
39033  * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
39034  * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
39035  * [`confirmations_required`]: Self::confirmations_required
39036  */
39037 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39038
39039 /**
39040  * The position of the funding transaction in the chain. None if the funding transaction has
39041  * not yet been confirmed and the channel fully opened.
39042  *
39043  * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
39044  * payments instead of this. See [`get_inbound_payment_scid`].
39045  *
39046  * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
39047  * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
39048  *
39049  * [`inbound_scid_alias`]: Self::inbound_scid_alias
39050  * [`outbound_scid_alias`]: Self::outbound_scid_alias
39051  * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
39052  * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
39053  * [`confirmations_required`]: Self::confirmations_required
39054  */
39055 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
39056
39057 /**
39058  * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
39059  * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
39060  * the channel has not yet been confirmed (as long as [`confirmations_required`] is
39061  * `Some(0)`).
39062  *
39063  * This will be `None` as long as the channel is not available for routing outbound payments.
39064  *
39065  * [`short_channel_id`]: Self::short_channel_id
39066  * [`confirmations_required`]: Self::confirmations_required
39067  */
39068 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39069
39070 /**
39071  * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
39072  * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
39073  * the channel has not yet been confirmed (as long as [`confirmations_required`] is
39074  * `Some(0)`).
39075  *
39076  * This will be `None` as long as the channel is not available for routing outbound payments.
39077  *
39078  * [`short_channel_id`]: Self::short_channel_id
39079  * [`confirmations_required`]: Self::confirmations_required
39080  */
39081 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
39082
39083 /**
39084  * An optional [`short_channel_id`] alias for this channel, randomly generated by our
39085  * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
39086  * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
39087  * when they see a payment to be routed to us.
39088  *
39089  * Our counterparty may choose to rotate this value at any time, though will always recognize
39090  * previous values for inbound payment forwarding.
39091  *
39092  * [`short_channel_id`]: Self::short_channel_id
39093  */
39094 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39095
39096 /**
39097  * An optional [`short_channel_id`] alias for this channel, randomly generated by our
39098  * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
39099  * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
39100  * when they see a payment to be routed to us.
39101  *
39102  * Our counterparty may choose to rotate this value at any time, though will always recognize
39103  * previous values for inbound payment forwarding.
39104  *
39105  * [`short_channel_id`]: Self::short_channel_id
39106  */
39107 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
39108
39109 /**
39110  * The value, in satoshis, of this channel as appears in the funding output
39111  */
39112 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39113
39114 /**
39115  * The value, in satoshis, of this channel as appears in the funding output
39116  */
39117 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
39118
39119 /**
39120  * The value, in satoshis, that must always be held in the channel for us. This value ensures
39121  * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
39122  * this value on chain.
39123  *
39124  * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
39125  *
39126  * This value will be `None` for outbound channels until the counterparty accepts the channel.
39127  *
39128  * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
39129  */
39130 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39131
39132 /**
39133  * The value, in satoshis, that must always be held in the channel for us. This value ensures
39134  * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
39135  * this value on chain.
39136  *
39137  * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
39138  *
39139  * This value will be `None` for outbound channels until the counterparty accepts the channel.
39140  *
39141  * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
39142  */
39143 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
39144
39145 /**
39146  * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
39147  * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
39148  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
39149  * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
39150  * serialized with LDK versions prior to 0.0.113.
39151  *
39152  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
39153  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
39154  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
39155  */
39156 struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39157
39158 /**
39159  * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
39160  * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
39161  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
39162  * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
39163  * serialized with LDK versions prior to 0.0.113.
39164  *
39165  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
39166  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
39167  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
39168  */
39169 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
39170
39171 /**
39172  * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
39173  * which is applied to commitment and HTLC transactions.
39174  *
39175  * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
39176  */
39177 struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39178
39179 /**
39180  * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
39181  * which is applied to commitment and HTLC transactions.
39182  *
39183  * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
39184  */
39185 void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
39186
39187 /**
39188  * Our total balance.  This is the amount we would get if we close the channel.
39189  * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
39190  * amount is not likely to be recoverable on close.
39191  *
39192  * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
39193  * balance is not available for inclusion in new outbound HTLCs). This further does not include
39194  * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
39195  * This does not consider any on-chain fees.
39196  *
39197  * See also [`ChannelDetails::outbound_capacity_msat`]
39198  */
39199 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39200
39201 /**
39202  * Our total balance.  This is the amount we would get if we close the channel.
39203  * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
39204  * amount is not likely to be recoverable on close.
39205  *
39206  * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
39207  * balance is not available for inclusion in new outbound HTLCs). This further does not include
39208  * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
39209  * This does not consider any on-chain fees.
39210  *
39211  * See also [`ChannelDetails::outbound_capacity_msat`]
39212  */
39213 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
39214
39215 /**
39216  * The available outbound capacity for sending HTLCs to the remote peer. This does not include
39217  * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
39218  * available for inclusion in new outbound HTLCs). This further does not include any pending
39219  * outgoing HTLCs which are awaiting some other resolution to be sent.
39220  *
39221  * See also [`ChannelDetails::balance_msat`]
39222  *
39223  * This value is not exact. Due to various in-flight changes, feerate changes, and our
39224  * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
39225  * should be able to spend nearly this amount.
39226  */
39227 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39228
39229 /**
39230  * The available outbound capacity for sending HTLCs to the remote peer. This does not include
39231  * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
39232  * available for inclusion in new outbound HTLCs). This further does not include any pending
39233  * outgoing HTLCs which are awaiting some other resolution to be sent.
39234  *
39235  * See also [`ChannelDetails::balance_msat`]
39236  *
39237  * This value is not exact. Due to various in-flight changes, feerate changes, and our
39238  * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
39239  * should be able to spend nearly this amount.
39240  */
39241 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
39242
39243 /**
39244  * The available outbound capacity for sending a single HTLC to the remote peer. This is
39245  * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
39246  * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
39247  * to use a limit as close as possible to the HTLC limit we can currently send.
39248  *
39249  * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
39250  * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
39251  */
39252 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39253
39254 /**
39255  * The available outbound capacity for sending a single HTLC to the remote peer. This is
39256  * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
39257  * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
39258  * to use a limit as close as possible to the HTLC limit we can currently send.
39259  *
39260  * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
39261  * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
39262  */
39263 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
39264
39265 /**
39266  * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
39267  * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
39268  * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
39269  * route which is valid.
39270  */
39271 uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39272
39273 /**
39274  * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
39275  * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
39276  * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
39277  * route which is valid.
39278  */
39279 void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
39280
39281 /**
39282  * The available inbound capacity for the remote peer to send HTLCs to us. This does not
39283  * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
39284  * available for inclusion in new inbound HTLCs).
39285  * Note that there are some corner cases not fully handled here, so the actual available
39286  * inbound capacity may be slightly higher than this.
39287  *
39288  * This value is not exact. Due to various in-flight changes, feerate changes, and our
39289  * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
39290  * However, our counterparty should be able to spend nearly this amount.
39291  */
39292 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39293
39294 /**
39295  * The available inbound capacity for the remote peer to send HTLCs to us. This does not
39296  * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
39297  * available for inclusion in new inbound HTLCs).
39298  * Note that there are some corner cases not fully handled here, so the actual available
39299  * inbound capacity may be slightly higher than this.
39300  *
39301  * This value is not exact. Due to various in-flight changes, feerate changes, and our
39302  * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
39303  * However, our counterparty should be able to spend nearly this amount.
39304  */
39305 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
39306
39307 /**
39308  * The number of required confirmations on the funding transaction before the funding will be
39309  * considered \"locked\". This number is selected by the channel fundee (i.e. us if
39310  * [`is_outbound`] is *not* set), and can be selected for inbound channels with
39311  * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
39312  * [`ChannelHandshakeLimits::max_minimum_depth`].
39313  *
39314  * This value will be `None` for outbound channels until the counterparty accepts the channel.
39315  *
39316  * [`is_outbound`]: ChannelDetails::is_outbound
39317  * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
39318  * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
39319  */
39320 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39321
39322 /**
39323  * The number of required confirmations on the funding transaction before the funding will be
39324  * considered \"locked\". This number is selected by the channel fundee (i.e. us if
39325  * [`is_outbound`] is *not* set), and can be selected for inbound channels with
39326  * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
39327  * [`ChannelHandshakeLimits::max_minimum_depth`].
39328  *
39329  * This value will be `None` for outbound channels until the counterparty accepts the channel.
39330  *
39331  * [`is_outbound`]: ChannelDetails::is_outbound
39332  * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
39333  * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
39334  */
39335 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
39336
39337 /**
39338  * The current number of confirmations on the funding transaction.
39339  *
39340  * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
39341  */
39342 struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39343
39344 /**
39345  * The current number of confirmations on the funding transaction.
39346  *
39347  * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
39348  */
39349 void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
39350
39351 /**
39352  * The number of blocks (after our commitment transaction confirms) that we will need to wait
39353  * until we can claim our funds after we force-close the channel. During this time our
39354  * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
39355  * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
39356  * time to claim our non-HTLC-encumbered funds.
39357  *
39358  * This value will be `None` for outbound channels until the counterparty accepts the channel.
39359  */
39360 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39361
39362 /**
39363  * The number of blocks (after our commitment transaction confirms) that we will need to wait
39364  * until we can claim our funds after we force-close the channel. During this time our
39365  * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
39366  * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
39367  * time to claim our non-HTLC-encumbered funds.
39368  *
39369  * This value will be `None` for outbound channels until the counterparty accepts the channel.
39370  */
39371 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
39372
39373 /**
39374  * True if the channel was initiated (and thus funded) by us.
39375  */
39376 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39377
39378 /**
39379  * True if the channel was initiated (and thus funded) by us.
39380  */
39381 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
39382
39383 /**
39384  * True if the channel is confirmed, channel_ready messages have been exchanged, and the
39385  * channel is not currently being shut down. `channel_ready` message exchange implies the
39386  * required confirmation count has been reached (and we were connected to the peer at some
39387  * point after the funding transaction received enough confirmations). The required
39388  * confirmation count is provided in [`confirmations_required`].
39389  *
39390  * [`confirmations_required`]: ChannelDetails::confirmations_required
39391  */
39392 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39393
39394 /**
39395  * True if the channel is confirmed, channel_ready messages have been exchanged, and the
39396  * channel is not currently being shut down. `channel_ready` message exchange implies the
39397  * required confirmation count has been reached (and we were connected to the peer at some
39398  * point after the funding transaction received enough confirmations). The required
39399  * confirmation count is provided in [`confirmations_required`].
39400  *
39401  * [`confirmations_required`]: ChannelDetails::confirmations_required
39402  */
39403 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
39404
39405 /**
39406  * The stage of the channel's shutdown.
39407  * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
39408  *
39409  * Returns a copy of the field.
39410  */
39411 struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39412
39413 /**
39414  * The stage of the channel's shutdown.
39415  * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
39416  */
39417 void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val);
39418
39419 /**
39420  * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
39421  * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
39422  *
39423  * This is a strict superset of `is_channel_ready`.
39424  */
39425 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39426
39427 /**
39428  * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
39429  * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
39430  *
39431  * This is a strict superset of `is_channel_ready`.
39432  */
39433 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
39434
39435 /**
39436  * True if this channel is (or will be) publicly-announced.
39437  */
39438 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39439
39440 /**
39441  * True if this channel is (or will be) publicly-announced.
39442  */
39443 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
39444
39445 /**
39446  * The smallest value HTLC (in msat) we will accept, for this channel. This field
39447  * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
39448  */
39449 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39450
39451 /**
39452  * The smallest value HTLC (in msat) we will accept, for this channel. This field
39453  * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
39454  */
39455 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
39456
39457 /**
39458  * The largest value HTLC (in msat) we currently will accept, for this channel.
39459  */
39460 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39461
39462 /**
39463  * The largest value HTLC (in msat) we currently will accept, for this channel.
39464  */
39465 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
39466
39467 /**
39468  * Set of configurable parameters that affect channel operation.
39469  *
39470  * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
39471  *
39472  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39473  */
39474 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39475
39476 /**
39477  * Set of configurable parameters that affect channel operation.
39478  *
39479  * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
39480  *
39481  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
39482  */
39483 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
39484
39485 /**
39486  * Pending inbound HTLCs.
39487  *
39488  * This field is empty for objects serialized with LDK versions prior to 0.0.122.
39489  */
39490 struct LDKCVec_InboundHTLCDetailsZ ChannelDetails_get_pending_inbound_htlcs(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39491
39492 /**
39493  * Pending inbound HTLCs.
39494  *
39495  * This field is empty for objects serialized with LDK versions prior to 0.0.122.
39496  */
39497 void ChannelDetails_set_pending_inbound_htlcs(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCVec_InboundHTLCDetailsZ val);
39498
39499 /**
39500  * Pending outbound HTLCs.
39501  *
39502  * This field is empty for objects serialized with LDK versions prior to 0.0.122.
39503  */
39504 struct LDKCVec_OutboundHTLCDetailsZ ChannelDetails_get_pending_outbound_htlcs(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
39505
39506 /**
39507  * Pending outbound HTLCs.
39508  *
39509  * This field is empty for objects serialized with LDK versions prior to 0.0.122.
39510  */
39511 void ChannelDetails_set_pending_outbound_htlcs(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCVec_OutboundHTLCDetailsZ val);
39512
39513 /**
39514  * Constructs a new ChannelDetails given each field
39515  *
39516  * Note that funding_txo_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
39517  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
39518  * Note that config_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
39519  */
39520 MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKChannelId channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKChannelTypeFeatures channel_type_arg, struct LDKCOption_u64Z short_channel_id_arg, struct LDKCOption_u64Z outbound_scid_alias_arg, struct LDKCOption_u64Z inbound_scid_alias_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, struct LDKU128 user_channel_id_arg, struct LDKCOption_u32Z feerate_sat_per_1000_weight_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t next_outbound_htlc_limit_msat_arg, uint64_t next_outbound_htlc_minimum_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u32Z confirmations_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_channel_ready_arg, struct LDKCOption_ChannelShutdownStateZ channel_shutdown_state_arg, bool is_usable_arg, bool is_public_arg, struct LDKCOption_u64Z inbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z inbound_htlc_maximum_msat_arg, struct LDKChannelConfig config_arg, struct LDKCVec_InboundHTLCDetailsZ pending_inbound_htlcs_arg, struct LDKCVec_OutboundHTLCDetailsZ pending_outbound_htlcs_arg);
39521
39522 /**
39523  * Creates a copy of the ChannelDetails
39524  */
39525 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
39526
39527 /**
39528  * Gets the current SCID which should be used to identify this channel for inbound payments.
39529  * This should be used for providing invoice hints or in any other context where our
39530  * counterparty will forward a payment to us.
39531  *
39532  * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
39533  * [`ChannelDetails::short_channel_id`]. See those for more information.
39534  */
39535 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
39536
39537 /**
39538  * Gets the current SCID which should be used to identify this channel for outbound payments.
39539  * This should be used in [`Route`]s to describe the first hop or in other contexts where
39540  * we're sending or forwarding a payment outbound over this channel.
39541  *
39542  * This is either the [`ChannelDetails::short_channel_id`], if set, or the
39543  * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
39544  *
39545  * [`Route`]: crate::routing::router::Route
39546  */
39547 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
39548
39549 /**
39550  * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
39551  */
39552 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
39553
39554 /**
39555  * Read a ChannelDetails from a byte array, created by ChannelDetails_write
39556  */
39557 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
39558
39559 /**
39560  * Creates a copy of the ChannelShutdownState
39561  */
39562 enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig);
39563
39564 /**
39565  * Utility method to constructs a new NotShuttingDown-variant ChannelShutdownState
39566  */
39567 enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void);
39568
39569 /**
39570  * Utility method to constructs a new ShutdownInitiated-variant ChannelShutdownState
39571  */
39572 enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void);
39573
39574 /**
39575  * Utility method to constructs a new ResolvingHTLCs-variant ChannelShutdownState
39576  */
39577 enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void);
39578
39579 /**
39580  * Utility method to constructs a new NegotiatingClosingFee-variant ChannelShutdownState
39581  */
39582 enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void);
39583
39584 /**
39585  * Utility method to constructs a new ShutdownComplete-variant ChannelShutdownState
39586  */
39587 enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void);
39588
39589 /**
39590  * Checks if two ChannelShutdownStates contain equal inner contents.
39591  * This ignores pointers and is_owned flags and looks at the values in fields.
39592  */
39593 bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b);
39594
39595 /**
39596  * Serialize the ChannelShutdownState object into a byte array which can be read by ChannelShutdownState_read
39597  */
39598 struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj);
39599
39600 /**
39601  * Read a ChannelShutdownState from a byte array, created by ChannelShutdownState_write
39602  */
39603 struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser);
39604
39605 /**
39606  * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
39607  */
39608 void ExpandedKey_free(struct LDKExpandedKey this_obj);
39609
39610 /**
39611  * Create a  new [`ExpandedKey`] for generating an inbound payment hash and secret.
39612  *
39613  * It is recommended to cache this value and not regenerate it for each new inbound payment.
39614  */
39615 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
39616
39617 /**
39618  * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
39619  * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
39620  * a `ChannelManager`.
39621  *
39622  * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
39623  * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
39624  * regenerate it for each new inbound payment.
39625  *
39626  * `current_time` is a Unix timestamp representing the current time.
39627  *
39628  * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
39629  * on versions of LDK prior to 0.0.114.
39630  *
39631  * [phantom node payments]: crate::sign::PhantomKeysManager
39632  * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
39633  */
39634 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ create(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, const struct LDKEntropySource *NONNULL_PTR entropy_source, uint64_t current_time, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
39635
39636 /**
39637  * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
39638  * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
39639  * without a `ChannelManager`.
39640  *
39641  * See [`create`] for information on the `keys` and `current_time` parameters.
39642  *
39643  * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
39644  * on versions of LDK prior to 0.0.114.
39645  *
39646  * [phantom node payments]: crate::sign::PhantomKeysManager
39647  */
39648 struct LDKCResult_ThirtyTwoBytesNoneZ create_from_hash(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, struct LDKThirtyTwoBytes payment_hash, uint32_t invoice_expiry_delta_secs, uint64_t current_time, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
39649
39650 /**
39651  * Frees any resources used by the DecodeError
39652  */
39653 void DecodeError_free(struct LDKDecodeError this_ptr);
39654
39655 /**
39656  * Creates a copy of the DecodeError
39657  */
39658 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
39659
39660 /**
39661  * Utility method to constructs a new UnknownVersion-variant DecodeError
39662  */
39663 struct LDKDecodeError DecodeError_unknown_version(void);
39664
39665 /**
39666  * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
39667  */
39668 struct LDKDecodeError DecodeError_unknown_required_feature(void);
39669
39670 /**
39671  * Utility method to constructs a new InvalidValue-variant DecodeError
39672  */
39673 struct LDKDecodeError DecodeError_invalid_value(void);
39674
39675 /**
39676  * Utility method to constructs a new ShortRead-variant DecodeError
39677  */
39678 struct LDKDecodeError DecodeError_short_read(void);
39679
39680 /**
39681  * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
39682  */
39683 struct LDKDecodeError DecodeError_bad_length_descriptor(void);
39684
39685 /**
39686  * Utility method to constructs a new Io-variant DecodeError
39687  */
39688 struct LDKDecodeError DecodeError_io(enum LDKIOError a);
39689
39690 /**
39691  * Utility method to constructs a new UnsupportedCompression-variant DecodeError
39692  */
39693 struct LDKDecodeError DecodeError_unsupported_compression(void);
39694
39695 /**
39696  * Utility method to constructs a new DangerousValue-variant DecodeError
39697  */
39698 struct LDKDecodeError DecodeError_dangerous_value(void);
39699
39700 /**
39701  * Generates a non-cryptographic 64-bit hash of the DecodeError.
39702  */
39703 uint64_t DecodeError_hash(const struct LDKDecodeError *NONNULL_PTR o);
39704
39705 /**
39706  * Checks if two DecodeErrors contain equal inner contents.
39707  * This ignores pointers and is_owned flags and looks at the values in fields.
39708  */
39709 bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
39710
39711 /**
39712  * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
39713  */
39714 void Init_free(struct LDKInit this_obj);
39715
39716 /**
39717  * The relevant features which the sender supports.
39718  */
39719 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
39720
39721 /**
39722  * The relevant features which the sender supports.
39723  */
39724 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
39725
39726 /**
39727  * Indicates chains the sender is interested in.
39728  *
39729  * If there are no common chains, the connection will be closed.
39730  *
39731  * Returns a copy of the field.
39732  */
39733 struct LDKCOption_CVec_ThirtyTwoBytesZZ Init_get_networks(const struct LDKInit *NONNULL_PTR this_ptr);
39734
39735 /**
39736  * Indicates chains the sender is interested in.
39737  *
39738  * If there are no common chains, the connection will be closed.
39739  */
39740 void Init_set_networks(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_CVec_ThirtyTwoBytesZZ val);
39741
39742 /**
39743  * The receipient's network address.
39744  *
39745  * This adds the option to report a remote IP address back to a connecting peer using the init
39746  * message. A node can decide to use that information to discover a potential update to its
39747  * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
39748  * the new address.
39749  */
39750 struct LDKCOption_SocketAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
39751
39752 /**
39753  * The receipient's network address.
39754  *
39755  * This adds the option to report a remote IP address back to a connecting peer using the init
39756  * message. A node can decide to use that information to discover a potential update to its
39757  * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
39758  * the new address.
39759  */
39760 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
39761
39762 /**
39763  * Constructs a new Init given each field
39764  */
39765 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_CVec_ThirtyTwoBytesZZ networks_arg, struct LDKCOption_SocketAddressZ remote_network_address_arg);
39766
39767 /**
39768  * Creates a copy of the Init
39769  */
39770 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
39771
39772 /**
39773  * Generates a non-cryptographic 64-bit hash of the Init.
39774  */
39775 uint64_t Init_hash(const struct LDKInit *NONNULL_PTR o);
39776
39777 /**
39778  * Checks if two Inits contain equal inner contents.
39779  * This ignores pointers and is_owned flags and looks at the values in fields.
39780  * Two objects with NULL inner values will be considered "equal" here.
39781  */
39782 bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
39783
39784 /**
39785  * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
39786  */
39787 void ErrorMessage_free(struct LDKErrorMessage this_obj);
39788
39789 /**
39790  * The channel ID involved in the error.
39791  *
39792  * All-0s indicates a general error unrelated to a specific channel, after which all channels
39793  * with the sending peer should be closed.
39794  */
39795 struct LDKChannelId ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
39796
39797 /**
39798  * The channel ID involved in the error.
39799  *
39800  * All-0s indicates a general error unrelated to a specific channel, after which all channels
39801  * with the sending peer should be closed.
39802  */
39803 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKChannelId val);
39804
39805 /**
39806  * A possibly human-readable error description.
39807  *
39808  * The string should be sanitized before it is used (e.g., emitted to logs or printed to
39809  * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
39810  * the terminal emulator or the logging subsystem.
39811  */
39812 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
39813
39814 /**
39815  * A possibly human-readable error description.
39816  *
39817  * The string should be sanitized before it is used (e.g., emitted to logs or printed to
39818  * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
39819  * the terminal emulator or the logging subsystem.
39820  */
39821 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
39822
39823 /**
39824  * Constructs a new ErrorMessage given each field
39825  */
39826 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg);
39827
39828 /**
39829  * Creates a copy of the ErrorMessage
39830  */
39831 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
39832
39833 /**
39834  * Generates a non-cryptographic 64-bit hash of the ErrorMessage.
39835  */
39836 uint64_t ErrorMessage_hash(const struct LDKErrorMessage *NONNULL_PTR o);
39837
39838 /**
39839  * Checks if two ErrorMessages contain equal inner contents.
39840  * This ignores pointers and is_owned flags and looks at the values in fields.
39841  * Two objects with NULL inner values will be considered "equal" here.
39842  */
39843 bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
39844
39845 /**
39846  * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
39847  */
39848 void WarningMessage_free(struct LDKWarningMessage this_obj);
39849
39850 /**
39851  * The channel ID involved in the warning.
39852  *
39853  * All-0s indicates a warning unrelated to a specific channel.
39854  */
39855 struct LDKChannelId WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
39856
39857 /**
39858  * The channel ID involved in the warning.
39859  *
39860  * All-0s indicates a warning unrelated to a specific channel.
39861  */
39862 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKChannelId val);
39863
39864 /**
39865  * A possibly human-readable warning description.
39866  *
39867  * The string should be sanitized before it is used (e.g. emitted to logs or printed to
39868  * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
39869  * the terminal emulator or the logging subsystem.
39870  */
39871 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
39872
39873 /**
39874  * A possibly human-readable warning description.
39875  *
39876  * The string should be sanitized before it is used (e.g. emitted to logs or printed to
39877  * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
39878  * the terminal emulator or the logging subsystem.
39879  */
39880 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
39881
39882 /**
39883  * Constructs a new WarningMessage given each field
39884  */
39885 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg);
39886
39887 /**
39888  * Creates a copy of the WarningMessage
39889  */
39890 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
39891
39892 /**
39893  * Generates a non-cryptographic 64-bit hash of the WarningMessage.
39894  */
39895 uint64_t WarningMessage_hash(const struct LDKWarningMessage *NONNULL_PTR o);
39896
39897 /**
39898  * Checks if two WarningMessages contain equal inner contents.
39899  * This ignores pointers and is_owned flags and looks at the values in fields.
39900  * Two objects with NULL inner values will be considered "equal" here.
39901  */
39902 bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
39903
39904 /**
39905  * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
39906  */
39907 void Ping_free(struct LDKPing this_obj);
39908
39909 /**
39910  * The desired response length.
39911  */
39912 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
39913
39914 /**
39915  * The desired response length.
39916  */
39917 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
39918
39919 /**
39920  * The ping packet size.
39921  *
39922  * This field is not sent on the wire. byteslen zeros are sent.
39923  */
39924 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
39925
39926 /**
39927  * The ping packet size.
39928  *
39929  * This field is not sent on the wire. byteslen zeros are sent.
39930  */
39931 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
39932
39933 /**
39934  * Constructs a new Ping given each field
39935  */
39936 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
39937
39938 /**
39939  * Creates a copy of the Ping
39940  */
39941 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
39942
39943 /**
39944  * Generates a non-cryptographic 64-bit hash of the Ping.
39945  */
39946 uint64_t Ping_hash(const struct LDKPing *NONNULL_PTR o);
39947
39948 /**
39949  * Checks if two Pings contain equal inner contents.
39950  * This ignores pointers and is_owned flags and looks at the values in fields.
39951  * Two objects with NULL inner values will be considered "equal" here.
39952  */
39953 bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
39954
39955 /**
39956  * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
39957  */
39958 void Pong_free(struct LDKPong this_obj);
39959
39960 /**
39961  * The pong packet size.
39962  *
39963  * This field is not sent on the wire. byteslen zeros are sent.
39964  */
39965 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
39966
39967 /**
39968  * The pong packet size.
39969  *
39970  * This field is not sent on the wire. byteslen zeros are sent.
39971  */
39972 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
39973
39974 /**
39975  * Constructs a new Pong given each field
39976  */
39977 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
39978
39979 /**
39980  * Creates a copy of the Pong
39981  */
39982 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
39983
39984 /**
39985  * Generates a non-cryptographic 64-bit hash of the Pong.
39986  */
39987 uint64_t Pong_hash(const struct LDKPong *NONNULL_PTR o);
39988
39989 /**
39990  * Checks if two Pongs contain equal inner contents.
39991  * This ignores pointers and is_owned flags and looks at the values in fields.
39992  * Two objects with NULL inner values will be considered "equal" here.
39993  */
39994 bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
39995
39996 /**
39997  * Frees any resources used by the CommonOpenChannelFields, if is_owned is set and inner is non-NULL.
39998  */
39999 void CommonOpenChannelFields_free(struct LDKCommonOpenChannelFields this_obj);
40000
40001 /**
40002  * The genesis hash of the blockchain where the channel is to be opened
40003  */
40004 const uint8_t (*CommonOpenChannelFields_get_chain_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr))[32];
40005
40006 /**
40007  * The genesis hash of the blockchain where the channel is to be opened
40008  */
40009 void CommonOpenChannelFields_set_chain_hash(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40010
40011 /**
40012  * A temporary channel ID
40013  * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
40014  * For V1 channels: a temporary channel ID, until the funding outpoint is announced
40015  */
40016 struct LDKChannelId CommonOpenChannelFields_get_temporary_channel_id(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40017
40018 /**
40019  * A temporary channel ID
40020  * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
40021  * For V1 channels: a temporary channel ID, until the funding outpoint is announced
40022  */
40023 void CommonOpenChannelFields_set_temporary_channel_id(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val);
40024
40025 /**
40026  * For V1 channels: The channel value
40027  * For V2 channels: Part of the channel value contributed by the channel initiator
40028  */
40029 uint64_t CommonOpenChannelFields_get_funding_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40030
40031 /**
40032  * For V1 channels: The channel value
40033  * For V2 channels: Part of the channel value contributed by the channel initiator
40034  */
40035 void CommonOpenChannelFields_set_funding_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
40036
40037 /**
40038  * The threshold below which outputs on transactions broadcast by the channel initiator will be
40039  * omitted
40040  */
40041 uint64_t CommonOpenChannelFields_get_dust_limit_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40042
40043 /**
40044  * The threshold below which outputs on transactions broadcast by the channel initiator will be
40045  * omitted
40046  */
40047 void CommonOpenChannelFields_set_dust_limit_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
40048
40049 /**
40050  * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
40051  */
40052 uint64_t CommonOpenChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40053
40054 /**
40055  * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
40056  */
40057 void CommonOpenChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
40058
40059 /**
40060  * The minimum HTLC size incoming to channel initiator, in milli-satoshi
40061  */
40062 uint64_t CommonOpenChannelFields_get_htlc_minimum_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40063
40064 /**
40065  * The minimum HTLC size incoming to channel initiator, in milli-satoshi
40066  */
40067 void CommonOpenChannelFields_set_htlc_minimum_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
40068
40069 /**
40070  * The feerate for the commitment transaction set by the channel initiator until updated by
40071  * [`UpdateFee`]
40072  */
40073 uint32_t CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40074
40075 /**
40076  * The feerate for the commitment transaction set by the channel initiator until updated by
40077  * [`UpdateFee`]
40078  */
40079 void CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint32_t val);
40080
40081 /**
40082  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
40083  * broadcast a commitment transaction
40084  */
40085 uint16_t CommonOpenChannelFields_get_to_self_delay(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40086
40087 /**
40088  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
40089  * broadcast a commitment transaction
40090  */
40091 void CommonOpenChannelFields_set_to_self_delay(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val);
40092
40093 /**
40094  * The maximum number of inbound HTLCs towards channel initiator
40095  */
40096 uint16_t CommonOpenChannelFields_get_max_accepted_htlcs(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40097
40098 /**
40099  * The maximum number of inbound HTLCs towards channel initiator
40100  */
40101 void CommonOpenChannelFields_set_max_accepted_htlcs(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val);
40102
40103 /**
40104  * The channel initiator's key controlling the funding transaction
40105  */
40106 struct LDKPublicKey CommonOpenChannelFields_get_funding_pubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40107
40108 /**
40109  * The channel initiator's key controlling the funding transaction
40110  */
40111 void CommonOpenChannelFields_set_funding_pubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40112
40113 /**
40114  * Used to derive a revocation key for transactions broadcast by counterparty
40115  */
40116 struct LDKPublicKey CommonOpenChannelFields_get_revocation_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40117
40118 /**
40119  * Used to derive a revocation key for transactions broadcast by counterparty
40120  */
40121 void CommonOpenChannelFields_set_revocation_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40122
40123 /**
40124  * A payment key to channel initiator for transactions broadcast by counterparty
40125  */
40126 struct LDKPublicKey CommonOpenChannelFields_get_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40127
40128 /**
40129  * A payment key to channel initiator for transactions broadcast by counterparty
40130  */
40131 void CommonOpenChannelFields_set_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40132
40133 /**
40134  * Used to derive a payment key to channel initiator for transactions broadcast by channel
40135  * initiator
40136  */
40137 struct LDKPublicKey CommonOpenChannelFields_get_delayed_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40138
40139 /**
40140  * Used to derive a payment key to channel initiator for transactions broadcast by channel
40141  * initiator
40142  */
40143 void CommonOpenChannelFields_set_delayed_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40144
40145 /**
40146  * Used to derive an HTLC payment key to channel initiator
40147  */
40148 struct LDKPublicKey CommonOpenChannelFields_get_htlc_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40149
40150 /**
40151  * Used to derive an HTLC payment key to channel initiator
40152  */
40153 void CommonOpenChannelFields_set_htlc_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40154
40155 /**
40156  * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
40157  */
40158 struct LDKPublicKey CommonOpenChannelFields_get_first_per_commitment_point(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40159
40160 /**
40161  * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
40162  */
40163 void CommonOpenChannelFields_set_first_per_commitment_point(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40164
40165 /**
40166  * The channel flags to be used
40167  */
40168 uint8_t CommonOpenChannelFields_get_channel_flags(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40169
40170 /**
40171  * The channel flags to be used
40172  */
40173 void CommonOpenChannelFields_set_channel_flags(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint8_t val);
40174
40175 /**
40176  * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
40177  * collaboratively close
40178  */
40179 struct LDKCOption_CVec_u8ZZ CommonOpenChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40180
40181 /**
40182  * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
40183  * collaboratively close
40184  */
40185 void CommonOpenChannelFields_set_shutdown_scriptpubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
40186
40187 /**
40188  * The channel type that this channel will represent
40189  *
40190  * If this is `None`, we derive the channel type from the intersection of our
40191  * feature bits with our counterparty's feature bits from the [`Init`] message.
40192  *
40193  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40194  */
40195 struct LDKChannelTypeFeatures CommonOpenChannelFields_get_channel_type(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
40196
40197 /**
40198  * The channel type that this channel will represent
40199  *
40200  * If this is `None`, we derive the channel type from the intersection of our
40201  * feature bits with our counterparty's feature bits from the [`Init`] message.
40202  *
40203  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40204  */
40205 void CommonOpenChannelFields_set_channel_type(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
40206
40207 /**
40208  * Constructs a new CommonOpenChannelFields given each field
40209  *
40210  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40211  */
40212 MUST_USE_RES struct LDKCommonOpenChannelFields CommonOpenChannelFields_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKChannelId temporary_channel_id_arg, uint64_t funding_satoshis_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t commitment_feerate_sat_per_1000_weight_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, uint8_t channel_flags_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
40213
40214 /**
40215  * Creates a copy of the CommonOpenChannelFields
40216  */
40217 struct LDKCommonOpenChannelFields CommonOpenChannelFields_clone(const struct LDKCommonOpenChannelFields *NONNULL_PTR orig);
40218
40219 /**
40220  * Generates a non-cryptographic 64-bit hash of the CommonOpenChannelFields.
40221  */
40222 uint64_t CommonOpenChannelFields_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR o);
40223
40224 /**
40225  * Checks if two CommonOpenChannelFieldss contain equal inner contents.
40226  * This ignores pointers and is_owned flags and looks at the values in fields.
40227  * Two objects with NULL inner values will be considered "equal" here.
40228  */
40229 bool CommonOpenChannelFields_eq(const struct LDKCommonOpenChannelFields *NONNULL_PTR a, const struct LDKCommonOpenChannelFields *NONNULL_PTR b);
40230
40231 /**
40232  * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
40233  */
40234 void OpenChannel_free(struct LDKOpenChannel this_obj);
40235
40236 /**
40237  * Common fields of `open_channel(2)`-like messages
40238  */
40239 struct LDKCommonOpenChannelFields OpenChannel_get_common_fields(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
40240
40241 /**
40242  * Common fields of `open_channel(2)`-like messages
40243  */
40244 void OpenChannel_set_common_fields(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val);
40245
40246 /**
40247  * The amount to push to the counterparty as part of the open, in milli-satoshi
40248  */
40249 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
40250
40251 /**
40252  * The amount to push to the counterparty as part of the open, in milli-satoshi
40253  */
40254 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
40255
40256 /**
40257  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
40258  */
40259 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
40260
40261 /**
40262  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
40263  */
40264 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
40265
40266 /**
40267  * Constructs a new OpenChannel given each field
40268  */
40269 MUST_USE_RES struct LDKOpenChannel OpenChannel_new(struct LDKCommonOpenChannelFields common_fields_arg, uint64_t push_msat_arg, uint64_t channel_reserve_satoshis_arg);
40270
40271 /**
40272  * Creates a copy of the OpenChannel
40273  */
40274 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
40275
40276 /**
40277  * Generates a non-cryptographic 64-bit hash of the OpenChannel.
40278  */
40279 uint64_t OpenChannel_hash(const struct LDKOpenChannel *NONNULL_PTR o);
40280
40281 /**
40282  * Checks if two OpenChannels contain equal inner contents.
40283  * This ignores pointers and is_owned flags and looks at the values in fields.
40284  * Two objects with NULL inner values will be considered "equal" here.
40285  */
40286 bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
40287
40288 /**
40289  * Frees any resources used by the OpenChannelV2, if is_owned is set and inner is non-NULL.
40290  */
40291 void OpenChannelV2_free(struct LDKOpenChannelV2 this_obj);
40292
40293 /**
40294  * Common fields of `open_channel(2)`-like messages
40295  */
40296 struct LDKCommonOpenChannelFields OpenChannelV2_get_common_fields(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
40297
40298 /**
40299  * Common fields of `open_channel(2)`-like messages
40300  */
40301 void OpenChannelV2_set_common_fields(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val);
40302
40303 /**
40304  * The feerate for the funding transaction set by the channel initiator
40305  */
40306 uint32_t OpenChannelV2_get_funding_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
40307
40308 /**
40309  * The feerate for the funding transaction set by the channel initiator
40310  */
40311 void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
40312
40313 /**
40314  * The locktime for the funding transaction
40315  */
40316 uint32_t OpenChannelV2_get_locktime(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
40317
40318 /**
40319  * The locktime for the funding transaction
40320  */
40321 void OpenChannelV2_set_locktime(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
40322
40323 /**
40324  * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
40325  */
40326 struct LDKPublicKey OpenChannelV2_get_second_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
40327
40328 /**
40329  * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
40330  */
40331 void OpenChannelV2_set_second_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40332
40333 /**
40334  * Optionally, a requirement that only confirmed inputs can be added
40335  */
40336 enum LDKCOption_NoneZ OpenChannelV2_get_require_confirmed_inputs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
40337
40338 /**
40339  * Optionally, a requirement that only confirmed inputs can be added
40340  */
40341 void OpenChannelV2_set_require_confirmed_inputs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
40342
40343 /**
40344  * Constructs a new OpenChannelV2 given each field
40345  */
40346 MUST_USE_RES struct LDKOpenChannelV2 OpenChannelV2_new(struct LDKCommonOpenChannelFields common_fields_arg, uint32_t funding_feerate_sat_per_1000_weight_arg, uint32_t locktime_arg, struct LDKPublicKey second_per_commitment_point_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
40347
40348 /**
40349  * Creates a copy of the OpenChannelV2
40350  */
40351 struct LDKOpenChannelV2 OpenChannelV2_clone(const struct LDKOpenChannelV2 *NONNULL_PTR orig);
40352
40353 /**
40354  * Generates a non-cryptographic 64-bit hash of the OpenChannelV2.
40355  */
40356 uint64_t OpenChannelV2_hash(const struct LDKOpenChannelV2 *NONNULL_PTR o);
40357
40358 /**
40359  * Checks if two OpenChannelV2s contain equal inner contents.
40360  * This ignores pointers and is_owned flags and looks at the values in fields.
40361  * Two objects with NULL inner values will be considered "equal" here.
40362  */
40363 bool OpenChannelV2_eq(const struct LDKOpenChannelV2 *NONNULL_PTR a, const struct LDKOpenChannelV2 *NONNULL_PTR b);
40364
40365 /**
40366  * Frees any resources used by the CommonAcceptChannelFields, if is_owned is set and inner is non-NULL.
40367  */
40368 void CommonAcceptChannelFields_free(struct LDKCommonAcceptChannelFields this_obj);
40369
40370 /**
40371  * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message.
40372  */
40373 struct LDKChannelId CommonAcceptChannelFields_get_temporary_channel_id(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40374
40375 /**
40376  * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message.
40377  */
40378 void CommonAcceptChannelFields_set_temporary_channel_id(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val);
40379
40380 /**
40381  * The threshold below which outputs on transactions broadcast by the channel acceptor will be
40382  * omitted
40383  */
40384 uint64_t CommonAcceptChannelFields_get_dust_limit_satoshis(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40385
40386 /**
40387  * The threshold below which outputs on transactions broadcast by the channel acceptor will be
40388  * omitted
40389  */
40390 void CommonAcceptChannelFields_set_dust_limit_satoshis(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
40391
40392 /**
40393  * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
40394  */
40395 uint64_t CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40396
40397 /**
40398  * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
40399  */
40400 void CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
40401
40402 /**
40403  * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
40404  */
40405 uint64_t CommonAcceptChannelFields_get_htlc_minimum_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40406
40407 /**
40408  * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
40409  */
40410 void CommonAcceptChannelFields_set_htlc_minimum_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
40411
40412 /**
40413  * Minimum depth of the funding transaction before the channel is considered open
40414  */
40415 uint32_t CommonAcceptChannelFields_get_minimum_depth(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40416
40417 /**
40418  * Minimum depth of the funding transaction before the channel is considered open
40419  */
40420 void CommonAcceptChannelFields_set_minimum_depth(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint32_t val);
40421
40422 /**
40423  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
40424  * broadcast a commitment transaction
40425  */
40426 uint16_t CommonAcceptChannelFields_get_to_self_delay(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40427
40428 /**
40429  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
40430  * broadcast a commitment transaction
40431  */
40432 void CommonAcceptChannelFields_set_to_self_delay(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val);
40433
40434 /**
40435  * The maximum number of inbound HTLCs towards channel acceptor
40436  */
40437 uint16_t CommonAcceptChannelFields_get_max_accepted_htlcs(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40438
40439 /**
40440  * The maximum number of inbound HTLCs towards channel acceptor
40441  */
40442 void CommonAcceptChannelFields_set_max_accepted_htlcs(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val);
40443
40444 /**
40445  * The channel acceptor's key controlling the funding transaction
40446  */
40447 struct LDKPublicKey CommonAcceptChannelFields_get_funding_pubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40448
40449 /**
40450  * The channel acceptor's key controlling the funding transaction
40451  */
40452 void CommonAcceptChannelFields_set_funding_pubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40453
40454 /**
40455  * Used to derive a revocation key for transactions broadcast by counterparty
40456  */
40457 struct LDKPublicKey CommonAcceptChannelFields_get_revocation_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40458
40459 /**
40460  * Used to derive a revocation key for transactions broadcast by counterparty
40461  */
40462 void CommonAcceptChannelFields_set_revocation_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40463
40464 /**
40465  * A payment key to channel acceptor for transactions broadcast by counterparty
40466  */
40467 struct LDKPublicKey CommonAcceptChannelFields_get_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40468
40469 /**
40470  * A payment key to channel acceptor for transactions broadcast by counterparty
40471  */
40472 void CommonAcceptChannelFields_set_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40473
40474 /**
40475  * Used to derive a payment key to channel acceptor for transactions broadcast by channel
40476  * acceptor
40477  */
40478 struct LDKPublicKey CommonAcceptChannelFields_get_delayed_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40479
40480 /**
40481  * Used to derive a payment key to channel acceptor for transactions broadcast by channel
40482  * acceptor
40483  */
40484 void CommonAcceptChannelFields_set_delayed_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40485
40486 /**
40487  * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
40488  */
40489 struct LDKPublicKey CommonAcceptChannelFields_get_htlc_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40490
40491 /**
40492  * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
40493  */
40494 void CommonAcceptChannelFields_set_htlc_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40495
40496 /**
40497  * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
40498  */
40499 struct LDKPublicKey CommonAcceptChannelFields_get_first_per_commitment_point(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40500
40501 /**
40502  * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
40503  */
40504 void CommonAcceptChannelFields_set_first_per_commitment_point(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40505
40506 /**
40507  * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
40508  * collaboratively close
40509  */
40510 struct LDKCOption_CVec_u8ZZ CommonAcceptChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40511
40512 /**
40513  * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
40514  * collaboratively close
40515  */
40516 void CommonAcceptChannelFields_set_shutdown_scriptpubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
40517
40518 /**
40519  * The channel type that this channel will represent. If none is set, we derive the channel
40520  * type from the intersection of our feature bits with our counterparty's feature bits from
40521  * the Init message.
40522  *
40523  * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s
40524  * [`CommonOpenChannelFields::channel_type`].
40525  *
40526  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40527  */
40528 struct LDKChannelTypeFeatures CommonAcceptChannelFields_get_channel_type(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
40529
40530 /**
40531  * The channel type that this channel will represent. If none is set, we derive the channel
40532  * type from the intersection of our feature bits with our counterparty's feature bits from
40533  * the Init message.
40534  *
40535  * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s
40536  * [`CommonOpenChannelFields::channel_type`].
40537  *
40538  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40539  */
40540 void CommonAcceptChannelFields_set_channel_type(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
40541
40542 /**
40543  * Constructs a new CommonAcceptChannelFields given each field
40544  *
40545  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40546  */
40547 MUST_USE_RES struct LDKCommonAcceptChannelFields CommonAcceptChannelFields_new(struct LDKChannelId temporary_channel_id_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t minimum_depth_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
40548
40549 /**
40550  * Creates a copy of the CommonAcceptChannelFields
40551  */
40552 struct LDKCommonAcceptChannelFields CommonAcceptChannelFields_clone(const struct LDKCommonAcceptChannelFields *NONNULL_PTR orig);
40553
40554 /**
40555  * Generates a non-cryptographic 64-bit hash of the CommonAcceptChannelFields.
40556  */
40557 uint64_t CommonAcceptChannelFields_hash(const struct LDKCommonAcceptChannelFields *NONNULL_PTR o);
40558
40559 /**
40560  * Checks if two CommonAcceptChannelFieldss contain equal inner contents.
40561  * This ignores pointers and is_owned flags and looks at the values in fields.
40562  * Two objects with NULL inner values will be considered "equal" here.
40563  */
40564 bool CommonAcceptChannelFields_eq(const struct LDKCommonAcceptChannelFields *NONNULL_PTR a, const struct LDKCommonAcceptChannelFields *NONNULL_PTR b);
40565
40566 /**
40567  * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
40568  */
40569 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
40570
40571 /**
40572  * Common fields of `accept_channel(2)`-like messages
40573  */
40574 struct LDKCommonAcceptChannelFields AcceptChannel_get_common_fields(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
40575
40576 /**
40577  * Common fields of `accept_channel(2)`-like messages
40578  */
40579 void AcceptChannel_set_common_fields(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val);
40580
40581 /**
40582  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
40583  */
40584 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
40585
40586 /**
40587  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
40588  */
40589 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
40590
40591 /**
40592  * Constructs a new AcceptChannel given each field
40593  */
40594 MUST_USE_RES struct LDKAcceptChannel AcceptChannel_new(struct LDKCommonAcceptChannelFields common_fields_arg, uint64_t channel_reserve_satoshis_arg);
40595
40596 /**
40597  * Creates a copy of the AcceptChannel
40598  */
40599 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
40600
40601 /**
40602  * Generates a non-cryptographic 64-bit hash of the AcceptChannel.
40603  */
40604 uint64_t AcceptChannel_hash(const struct LDKAcceptChannel *NONNULL_PTR o);
40605
40606 /**
40607  * Checks if two AcceptChannels contain equal inner contents.
40608  * This ignores pointers and is_owned flags and looks at the values in fields.
40609  * Two objects with NULL inner values will be considered "equal" here.
40610  */
40611 bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
40612
40613 /**
40614  * Frees any resources used by the AcceptChannelV2, if is_owned is set and inner is non-NULL.
40615  */
40616 void AcceptChannelV2_free(struct LDKAcceptChannelV2 this_obj);
40617
40618 /**
40619  * Common fields of `accept_channel(2)`-like messages
40620  */
40621 struct LDKCommonAcceptChannelFields AcceptChannelV2_get_common_fields(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
40622
40623 /**
40624  * Common fields of `accept_channel(2)`-like messages
40625  */
40626 void AcceptChannelV2_set_common_fields(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val);
40627
40628 /**
40629  * Part of the channel value contributed by the channel acceptor
40630  */
40631 uint64_t AcceptChannelV2_get_funding_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
40632
40633 /**
40634  * Part of the channel value contributed by the channel acceptor
40635  */
40636 void AcceptChannelV2_set_funding_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
40637
40638 /**
40639  * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
40640  */
40641 struct LDKPublicKey AcceptChannelV2_get_second_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
40642
40643 /**
40644  * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
40645  */
40646 void AcceptChannelV2_set_second_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40647
40648 /**
40649  * Optionally, a requirement that only confirmed inputs can be added
40650  */
40651 enum LDKCOption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
40652
40653 /**
40654  * Optionally, a requirement that only confirmed inputs can be added
40655  */
40656 void AcceptChannelV2_set_require_confirmed_inputs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
40657
40658 /**
40659  * Constructs a new AcceptChannelV2 given each field
40660  */
40661 MUST_USE_RES struct LDKAcceptChannelV2 AcceptChannelV2_new(struct LDKCommonAcceptChannelFields common_fields_arg, uint64_t funding_satoshis_arg, struct LDKPublicKey second_per_commitment_point_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
40662
40663 /**
40664  * Creates a copy of the AcceptChannelV2
40665  */
40666 struct LDKAcceptChannelV2 AcceptChannelV2_clone(const struct LDKAcceptChannelV2 *NONNULL_PTR orig);
40667
40668 /**
40669  * Generates a non-cryptographic 64-bit hash of the AcceptChannelV2.
40670  */
40671 uint64_t AcceptChannelV2_hash(const struct LDKAcceptChannelV2 *NONNULL_PTR o);
40672
40673 /**
40674  * Checks if two AcceptChannelV2s contain equal inner contents.
40675  * This ignores pointers and is_owned flags and looks at the values in fields.
40676  * Two objects with NULL inner values will be considered "equal" here.
40677  */
40678 bool AcceptChannelV2_eq(const struct LDKAcceptChannelV2 *NONNULL_PTR a, const struct LDKAcceptChannelV2 *NONNULL_PTR b);
40679
40680 /**
40681  * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
40682  */
40683 void FundingCreated_free(struct LDKFundingCreated this_obj);
40684
40685 /**
40686  * A temporary channel ID, until the funding is established
40687  */
40688 struct LDKChannelId FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
40689
40690 /**
40691  * A temporary channel ID, until the funding is established
40692  */
40693 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKChannelId val);
40694
40695 /**
40696  * The funding transaction ID
40697  */
40698 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
40699
40700 /**
40701  * The funding transaction ID
40702  */
40703 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40704
40705 /**
40706  * The specific output index funding this channel
40707  */
40708 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
40709
40710 /**
40711  * The specific output index funding this channel
40712  */
40713 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
40714
40715 /**
40716  * The signature of the channel initiator (funder) on the initial commitment transaction
40717  */
40718 struct LDKECDSASignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
40719
40720 /**
40721  * The signature of the channel initiator (funder) on the initial commitment transaction
40722  */
40723 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
40724
40725 /**
40726  * Constructs a new FundingCreated given each field
40727  */
40728 MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKChannelId temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKECDSASignature signature_arg);
40729
40730 /**
40731  * Creates a copy of the FundingCreated
40732  */
40733 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
40734
40735 /**
40736  * Generates a non-cryptographic 64-bit hash of the FundingCreated.
40737  */
40738 uint64_t FundingCreated_hash(const struct LDKFundingCreated *NONNULL_PTR o);
40739
40740 /**
40741  * Checks if two FundingCreateds contain equal inner contents.
40742  * This ignores pointers and is_owned flags and looks at the values in fields.
40743  * Two objects with NULL inner values will be considered "equal" here.
40744  */
40745 bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
40746
40747 /**
40748  * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
40749  */
40750 void FundingSigned_free(struct LDKFundingSigned this_obj);
40751
40752 /**
40753  * The channel ID
40754  */
40755 struct LDKChannelId FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
40756
40757 /**
40758  * The channel ID
40759  */
40760 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
40761
40762 /**
40763  * The signature of the channel acceptor (fundee) on the initial commitment transaction
40764  */
40765 struct LDKECDSASignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
40766
40767 /**
40768  * The signature of the channel acceptor (fundee) on the initial commitment transaction
40769  */
40770 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
40771
40772 /**
40773  * Constructs a new FundingSigned given each field
40774  */
40775 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg);
40776
40777 /**
40778  * Creates a copy of the FundingSigned
40779  */
40780 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
40781
40782 /**
40783  * Generates a non-cryptographic 64-bit hash of the FundingSigned.
40784  */
40785 uint64_t FundingSigned_hash(const struct LDKFundingSigned *NONNULL_PTR o);
40786
40787 /**
40788  * Checks if two FundingSigneds contain equal inner contents.
40789  * This ignores pointers and is_owned flags and looks at the values in fields.
40790  * Two objects with NULL inner values will be considered "equal" here.
40791  */
40792 bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
40793
40794 /**
40795  * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
40796  */
40797 void ChannelReady_free(struct LDKChannelReady this_obj);
40798
40799 /**
40800  * The channel ID
40801  */
40802 struct LDKChannelId ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr);
40803
40804 /**
40805  * The channel ID
40806  */
40807 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKChannelId val);
40808
40809 /**
40810  * The per-commitment point of the second commitment transaction
40811  */
40812 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
40813
40814 /**
40815  * The per-commitment point of the second commitment transaction
40816  */
40817 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40818
40819 /**
40820  * If set, provides a `short_channel_id` alias for this channel.
40821  *
40822  * The sender will accept payments to be forwarded over this SCID and forward them to this
40823  * messages' recipient.
40824  */
40825 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
40826
40827 /**
40828  * If set, provides a `short_channel_id` alias for this channel.
40829  *
40830  * The sender will accept payments to be forwarded over this SCID and forward them to this
40831  * messages' recipient.
40832  */
40833 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
40834
40835 /**
40836  * Constructs a new ChannelReady given each field
40837  */
40838 MUST_USE_RES struct LDKChannelReady ChannelReady_new(struct LDKChannelId channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg, struct LDKCOption_u64Z short_channel_id_alias_arg);
40839
40840 /**
40841  * Creates a copy of the ChannelReady
40842  */
40843 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
40844
40845 /**
40846  * Generates a non-cryptographic 64-bit hash of the ChannelReady.
40847  */
40848 uint64_t ChannelReady_hash(const struct LDKChannelReady *NONNULL_PTR o);
40849
40850 /**
40851  * Checks if two ChannelReadys contain equal inner contents.
40852  * This ignores pointers and is_owned flags and looks at the values in fields.
40853  * Two objects with NULL inner values will be considered "equal" here.
40854  */
40855 bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
40856
40857 /**
40858  * Frees any resources used by the Stfu, if is_owned is set and inner is non-NULL.
40859  */
40860 void Stfu_free(struct LDKStfu this_obj);
40861
40862 /**
40863  * The channel ID where quiescence is intended
40864  */
40865 struct LDKChannelId Stfu_get_channel_id(const struct LDKStfu *NONNULL_PTR this_ptr);
40866
40867 /**
40868  * The channel ID where quiescence is intended
40869  */
40870 void Stfu_set_channel_id(struct LDKStfu *NONNULL_PTR this_ptr, struct LDKChannelId val);
40871
40872 /**
40873  * Initiator flag, 1 if initiating, 0 if replying to an stfu.
40874  */
40875 uint8_t Stfu_get_initiator(const struct LDKStfu *NONNULL_PTR this_ptr);
40876
40877 /**
40878  * Initiator flag, 1 if initiating, 0 if replying to an stfu.
40879  */
40880 void Stfu_set_initiator(struct LDKStfu *NONNULL_PTR this_ptr, uint8_t val);
40881
40882 /**
40883  * Constructs a new Stfu given each field
40884  */
40885 MUST_USE_RES struct LDKStfu Stfu_new(struct LDKChannelId channel_id_arg, uint8_t initiator_arg);
40886
40887 /**
40888  * Creates a copy of the Stfu
40889  */
40890 struct LDKStfu Stfu_clone(const struct LDKStfu *NONNULL_PTR orig);
40891
40892 /**
40893  * Checks if two Stfus contain equal inner contents.
40894  * This ignores pointers and is_owned flags and looks at the values in fields.
40895  * Two objects with NULL inner values will be considered "equal" here.
40896  */
40897 bool Stfu_eq(const struct LDKStfu *NONNULL_PTR a, const struct LDKStfu *NONNULL_PTR b);
40898
40899 /**
40900  * Frees any resources used by the Splice, if is_owned is set and inner is non-NULL.
40901  */
40902 void Splice_free(struct LDKSplice this_obj);
40903
40904 /**
40905  * The channel ID where splicing is intended
40906  */
40907 struct LDKChannelId Splice_get_channel_id(const struct LDKSplice *NONNULL_PTR this_ptr);
40908
40909 /**
40910  * The channel ID where splicing is intended
40911  */
40912 void Splice_set_channel_id(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKChannelId val);
40913
40914 /**
40915  * The genesis hash of the blockchain where the channel is intended to be spliced
40916  */
40917 const uint8_t (*Splice_get_chain_hash(const struct LDKSplice *NONNULL_PTR this_ptr))[32];
40918
40919 /**
40920  * The genesis hash of the blockchain where the channel is intended to be spliced
40921  */
40922 void Splice_set_chain_hash(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40923
40924 /**
40925  * The intended change in channel capacity: the amount to be added (positive value)
40926  * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel.
40927  */
40928 int64_t Splice_get_relative_satoshis(const struct LDKSplice *NONNULL_PTR this_ptr);
40929
40930 /**
40931  * The intended change in channel capacity: the amount to be added (positive value)
40932  * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel.
40933  */
40934 void Splice_set_relative_satoshis(struct LDKSplice *NONNULL_PTR this_ptr, int64_t val);
40935
40936 /**
40937  * The feerate for the new funding transaction, set by the splice initiator
40938  */
40939 uint32_t Splice_get_funding_feerate_perkw(const struct LDKSplice *NONNULL_PTR this_ptr);
40940
40941 /**
40942  * The feerate for the new funding transaction, set by the splice initiator
40943  */
40944 void Splice_set_funding_feerate_perkw(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val);
40945
40946 /**
40947  * The locktime for the new funding transaction
40948  */
40949 uint32_t Splice_get_locktime(const struct LDKSplice *NONNULL_PTR this_ptr);
40950
40951 /**
40952  * The locktime for the new funding transaction
40953  */
40954 void Splice_set_locktime(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val);
40955
40956 /**
40957  * The key of the sender (splice initiator) controlling the new funding transaction
40958  */
40959 struct LDKPublicKey Splice_get_funding_pubkey(const struct LDKSplice *NONNULL_PTR this_ptr);
40960
40961 /**
40962  * The key of the sender (splice initiator) controlling the new funding transaction
40963  */
40964 void Splice_set_funding_pubkey(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40965
40966 /**
40967  * Constructs a new Splice given each field
40968  */
40969 MUST_USE_RES struct LDKSplice Splice_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes chain_hash_arg, int64_t relative_satoshis_arg, uint32_t funding_feerate_perkw_arg, uint32_t locktime_arg, struct LDKPublicKey funding_pubkey_arg);
40970
40971 /**
40972  * Creates a copy of the Splice
40973  */
40974 struct LDKSplice Splice_clone(const struct LDKSplice *NONNULL_PTR orig);
40975
40976 /**
40977  * Checks if two Splices contain equal inner contents.
40978  * This ignores pointers and is_owned flags and looks at the values in fields.
40979  * Two objects with NULL inner values will be considered "equal" here.
40980  */
40981 bool Splice_eq(const struct LDKSplice *NONNULL_PTR a, const struct LDKSplice *NONNULL_PTR b);
40982
40983 /**
40984  * Frees any resources used by the SpliceAck, if is_owned is set and inner is non-NULL.
40985  */
40986 void SpliceAck_free(struct LDKSpliceAck this_obj);
40987
40988 /**
40989  * The channel ID where splicing is intended
40990  */
40991 struct LDKChannelId SpliceAck_get_channel_id(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
40992
40993 /**
40994  * The channel ID where splicing is intended
40995  */
40996 void SpliceAck_set_channel_id(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKChannelId val);
40997
40998 /**
40999  * The genesis hash of the blockchain where the channel is intended to be spliced
41000  */
41001 const uint8_t (*SpliceAck_get_chain_hash(const struct LDKSpliceAck *NONNULL_PTR this_ptr))[32];
41002
41003 /**
41004  * The genesis hash of the blockchain where the channel is intended to be spliced
41005  */
41006 void SpliceAck_set_chain_hash(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41007
41008 /**
41009  * The intended change in channel capacity: the amount to be added (positive value)
41010  * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
41011  */
41012 int64_t SpliceAck_get_relative_satoshis(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
41013
41014 /**
41015  * The intended change in channel capacity: the amount to be added (positive value)
41016  * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
41017  */
41018 void SpliceAck_set_relative_satoshis(struct LDKSpliceAck *NONNULL_PTR this_ptr, int64_t val);
41019
41020 /**
41021  * The key of the sender (splice acceptor) controlling the new funding transaction
41022  */
41023 struct LDKPublicKey SpliceAck_get_funding_pubkey(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
41024
41025 /**
41026  * The key of the sender (splice acceptor) controlling the new funding transaction
41027  */
41028 void SpliceAck_set_funding_pubkey(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKPublicKey val);
41029
41030 /**
41031  * Constructs a new SpliceAck given each field
41032  */
41033 MUST_USE_RES struct LDKSpliceAck SpliceAck_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes chain_hash_arg, int64_t relative_satoshis_arg, struct LDKPublicKey funding_pubkey_arg);
41034
41035 /**
41036  * Creates a copy of the SpliceAck
41037  */
41038 struct LDKSpliceAck SpliceAck_clone(const struct LDKSpliceAck *NONNULL_PTR orig);
41039
41040 /**
41041  * Checks if two SpliceAcks contain equal inner contents.
41042  * This ignores pointers and is_owned flags and looks at the values in fields.
41043  * Two objects with NULL inner values will be considered "equal" here.
41044  */
41045 bool SpliceAck_eq(const struct LDKSpliceAck *NONNULL_PTR a, const struct LDKSpliceAck *NONNULL_PTR b);
41046
41047 /**
41048  * Frees any resources used by the SpliceLocked, if is_owned is set and inner is non-NULL.
41049  */
41050 void SpliceLocked_free(struct LDKSpliceLocked this_obj);
41051
41052 /**
41053  * The channel ID
41054  */
41055 struct LDKChannelId SpliceLocked_get_channel_id(const struct LDKSpliceLocked *NONNULL_PTR this_ptr);
41056
41057 /**
41058  * The channel ID
41059  */
41060 void SpliceLocked_set_channel_id(struct LDKSpliceLocked *NONNULL_PTR this_ptr, struct LDKChannelId val);
41061
41062 /**
41063  * Constructs a new SpliceLocked given each field
41064  */
41065 MUST_USE_RES struct LDKSpliceLocked SpliceLocked_new(struct LDKChannelId channel_id_arg);
41066
41067 /**
41068  * Creates a copy of the SpliceLocked
41069  */
41070 struct LDKSpliceLocked SpliceLocked_clone(const struct LDKSpliceLocked *NONNULL_PTR orig);
41071
41072 /**
41073  * Checks if two SpliceLockeds contain equal inner contents.
41074  * This ignores pointers and is_owned flags and looks at the values in fields.
41075  * Two objects with NULL inner values will be considered "equal" here.
41076  */
41077 bool SpliceLocked_eq(const struct LDKSpliceLocked *NONNULL_PTR a, const struct LDKSpliceLocked *NONNULL_PTR b);
41078
41079 /**
41080  * Frees any resources used by the TxAddInput, if is_owned is set and inner is non-NULL.
41081  */
41082 void TxAddInput_free(struct LDKTxAddInput this_obj);
41083
41084 /**
41085  * The channel ID
41086  */
41087 struct LDKChannelId TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
41088
41089 /**
41090  * The channel ID
41091  */
41092 void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKChannelId val);
41093
41094 /**
41095  * A randomly chosen unique identifier for this input, which is even for initiators and odd for
41096  * non-initiators.
41097  */
41098 uint64_t TxAddInput_get_serial_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
41099
41100 /**
41101  * A randomly chosen unique identifier for this input, which is even for initiators and odd for
41102  * non-initiators.
41103  */
41104 void TxAddInput_set_serial_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint64_t val);
41105
41106 /**
41107  * Serialized transaction that contains the output this input spends to verify that it is non
41108  * malleable.
41109  */
41110 struct LDKTransactionU16LenLimited TxAddInput_get_prevtx(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
41111
41112 /**
41113  * Serialized transaction that contains the output this input spends to verify that it is non
41114  * malleable.
41115  */
41116 void TxAddInput_set_prevtx(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKTransactionU16LenLimited val);
41117
41118 /**
41119  * The index of the output being spent
41120  */
41121 uint32_t TxAddInput_get_prevtx_out(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
41122
41123 /**
41124  * The index of the output being spent
41125  */
41126 void TxAddInput_set_prevtx_out(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
41127
41128 /**
41129  * The sequence number of this input
41130  */
41131 uint32_t TxAddInput_get_sequence(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
41132
41133 /**
41134  * The sequence number of this input
41135  */
41136 void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
41137
41138 /**
41139  * Constructs a new TxAddInput given each field
41140  */
41141 MUST_USE_RES struct LDKTxAddInput TxAddInput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg, struct LDKTransactionU16LenLimited prevtx_arg, uint32_t prevtx_out_arg, uint32_t sequence_arg);
41142
41143 /**
41144  * Creates a copy of the TxAddInput
41145  */
41146 struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig);
41147
41148 /**
41149  * Generates a non-cryptographic 64-bit hash of the TxAddInput.
41150  */
41151 uint64_t TxAddInput_hash(const struct LDKTxAddInput *NONNULL_PTR o);
41152
41153 /**
41154  * Checks if two TxAddInputs contain equal inner contents.
41155  * This ignores pointers and is_owned flags and looks at the values in fields.
41156  * Two objects with NULL inner values will be considered "equal" here.
41157  */
41158 bool TxAddInput_eq(const struct LDKTxAddInput *NONNULL_PTR a, const struct LDKTxAddInput *NONNULL_PTR b);
41159
41160 /**
41161  * Frees any resources used by the TxAddOutput, if is_owned is set and inner is non-NULL.
41162  */
41163 void TxAddOutput_free(struct LDKTxAddOutput this_obj);
41164
41165 /**
41166  * The channel ID
41167  */
41168 struct LDKChannelId TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
41169
41170 /**
41171  * The channel ID
41172  */
41173 void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
41174
41175 /**
41176  * A randomly chosen unique identifier for this output, which is even for initiators and odd for
41177  * non-initiators.
41178  */
41179 uint64_t TxAddOutput_get_serial_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
41180
41181 /**
41182  * A randomly chosen unique identifier for this output, which is even for initiators and odd for
41183  * non-initiators.
41184  */
41185 void TxAddOutput_set_serial_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
41186
41187 /**
41188  * The satoshi value of the output
41189  */
41190 uint64_t TxAddOutput_get_sats(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
41191
41192 /**
41193  * The satoshi value of the output
41194  */
41195 void TxAddOutput_set_sats(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
41196
41197 /**
41198  * The scriptPubKey for the output
41199  */
41200 struct LDKCVec_u8Z TxAddOutput_get_script(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
41201
41202 /**
41203  * The scriptPubKey for the output
41204  */
41205 void TxAddOutput_set_script(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
41206
41207 /**
41208  * Constructs a new TxAddOutput given each field
41209  */
41210 MUST_USE_RES struct LDKTxAddOutput TxAddOutput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg, uint64_t sats_arg, struct LDKCVec_u8Z script_arg);
41211
41212 /**
41213  * Creates a copy of the TxAddOutput
41214  */
41215 struct LDKTxAddOutput TxAddOutput_clone(const struct LDKTxAddOutput *NONNULL_PTR orig);
41216
41217 /**
41218  * Generates a non-cryptographic 64-bit hash of the TxAddOutput.
41219  */
41220 uint64_t TxAddOutput_hash(const struct LDKTxAddOutput *NONNULL_PTR o);
41221
41222 /**
41223  * Checks if two TxAddOutputs contain equal inner contents.
41224  * This ignores pointers and is_owned flags and looks at the values in fields.
41225  * Two objects with NULL inner values will be considered "equal" here.
41226  */
41227 bool TxAddOutput_eq(const struct LDKTxAddOutput *NONNULL_PTR a, const struct LDKTxAddOutput *NONNULL_PTR b);
41228
41229 /**
41230  * Frees any resources used by the TxRemoveInput, if is_owned is set and inner is non-NULL.
41231  */
41232 void TxRemoveInput_free(struct LDKTxRemoveInput this_obj);
41233
41234 /**
41235  * The channel ID
41236  */
41237 struct LDKChannelId TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
41238
41239 /**
41240  * The channel ID
41241  */
41242 void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKChannelId val);
41243
41244 /**
41245  * The serial ID of the input to be removed
41246  */
41247 uint64_t TxRemoveInput_get_serial_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
41248
41249 /**
41250  * The serial ID of the input to be removed
41251  */
41252 void TxRemoveInput_set_serial_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, uint64_t val);
41253
41254 /**
41255  * Constructs a new TxRemoveInput given each field
41256  */
41257 MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg);
41258
41259 /**
41260  * Creates a copy of the TxRemoveInput
41261  */
41262 struct LDKTxRemoveInput TxRemoveInput_clone(const struct LDKTxRemoveInput *NONNULL_PTR orig);
41263
41264 /**
41265  * Generates a non-cryptographic 64-bit hash of the TxRemoveInput.
41266  */
41267 uint64_t TxRemoveInput_hash(const struct LDKTxRemoveInput *NONNULL_PTR o);
41268
41269 /**
41270  * Checks if two TxRemoveInputs contain equal inner contents.
41271  * This ignores pointers and is_owned flags and looks at the values in fields.
41272  * Two objects with NULL inner values will be considered "equal" here.
41273  */
41274 bool TxRemoveInput_eq(const struct LDKTxRemoveInput *NONNULL_PTR a, const struct LDKTxRemoveInput *NONNULL_PTR b);
41275
41276 /**
41277  * Frees any resources used by the TxRemoveOutput, if is_owned is set and inner is non-NULL.
41278  */
41279 void TxRemoveOutput_free(struct LDKTxRemoveOutput this_obj);
41280
41281 /**
41282  * The channel ID
41283  */
41284 struct LDKChannelId TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
41285
41286 /**
41287  * The channel ID
41288  */
41289 void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
41290
41291 /**
41292  * The serial ID of the output to be removed
41293  */
41294 uint64_t TxRemoveOutput_get_serial_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
41295
41296 /**
41297  * The serial ID of the output to be removed
41298  */
41299 void TxRemoveOutput_set_serial_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, uint64_t val);
41300
41301 /**
41302  * Constructs a new TxRemoveOutput given each field
41303  */
41304 MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg);
41305
41306 /**
41307  * Creates a copy of the TxRemoveOutput
41308  */
41309 struct LDKTxRemoveOutput TxRemoveOutput_clone(const struct LDKTxRemoveOutput *NONNULL_PTR orig);
41310
41311 /**
41312  * Generates a non-cryptographic 64-bit hash of the TxRemoveOutput.
41313  */
41314 uint64_t TxRemoveOutput_hash(const struct LDKTxRemoveOutput *NONNULL_PTR o);
41315
41316 /**
41317  * Checks if two TxRemoveOutputs contain equal inner contents.
41318  * This ignores pointers and is_owned flags and looks at the values in fields.
41319  * Two objects with NULL inner values will be considered "equal" here.
41320  */
41321 bool TxRemoveOutput_eq(const struct LDKTxRemoveOutput *NONNULL_PTR a, const struct LDKTxRemoveOutput *NONNULL_PTR b);
41322
41323 /**
41324  * Frees any resources used by the TxComplete, if is_owned is set and inner is non-NULL.
41325  */
41326 void TxComplete_free(struct LDKTxComplete this_obj);
41327
41328 /**
41329  * The channel ID
41330  */
41331 struct LDKChannelId TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr);
41332
41333 /**
41334  * The channel ID
41335  */
41336 void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKChannelId val);
41337
41338 /**
41339  * Constructs a new TxComplete given each field
41340  */
41341 MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKChannelId channel_id_arg);
41342
41343 /**
41344  * Creates a copy of the TxComplete
41345  */
41346 struct LDKTxComplete TxComplete_clone(const struct LDKTxComplete *NONNULL_PTR orig);
41347
41348 /**
41349  * Generates a non-cryptographic 64-bit hash of the TxComplete.
41350  */
41351 uint64_t TxComplete_hash(const struct LDKTxComplete *NONNULL_PTR o);
41352
41353 /**
41354  * Checks if two TxCompletes contain equal inner contents.
41355  * This ignores pointers and is_owned flags and looks at the values in fields.
41356  * Two objects with NULL inner values will be considered "equal" here.
41357  */
41358 bool TxComplete_eq(const struct LDKTxComplete *NONNULL_PTR a, const struct LDKTxComplete *NONNULL_PTR b);
41359
41360 /**
41361  * Frees any resources used by the TxSignatures, if is_owned is set and inner is non-NULL.
41362  */
41363 void TxSignatures_free(struct LDKTxSignatures this_obj);
41364
41365 /**
41366  * The channel ID
41367  */
41368 struct LDKChannelId TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
41369
41370 /**
41371  * The channel ID
41372  */
41373 void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val);
41374
41375 /**
41376  * The TXID
41377  */
41378 const uint8_t (*TxSignatures_get_tx_hash(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
41379
41380 /**
41381  * The TXID
41382  */
41383 void TxSignatures_set_tx_hash(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41384
41385 /**
41386  * The list of witnesses
41387  *
41388  * Returns a copy of the field.
41389  */
41390 struct LDKCVec_WitnessZ TxSignatures_get_witnesses(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
41391
41392 /**
41393  * The list of witnesses
41394  */
41395 void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val);
41396
41397 /**
41398  * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers
41399  */
41400 struct LDKCOption_ECDSASignatureZ TxSignatures_get_funding_outpoint_sig(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
41401
41402 /**
41403  * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers
41404  */
41405 void TxSignatures_set_funding_outpoint_sig(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCOption_ECDSASignatureZ val);
41406
41407 /**
41408  * Constructs a new TxSignatures given each field
41409  */
41410 MUST_USE_RES struct LDKTxSignatures TxSignatures_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes tx_hash_arg, struct LDKCVec_WitnessZ witnesses_arg, struct LDKCOption_ECDSASignatureZ funding_outpoint_sig_arg);
41411
41412 /**
41413  * Creates a copy of the TxSignatures
41414  */
41415 struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig);
41416
41417 /**
41418  * Generates a non-cryptographic 64-bit hash of the TxSignatures.
41419  */
41420 uint64_t TxSignatures_hash(const struct LDKTxSignatures *NONNULL_PTR o);
41421
41422 /**
41423  * Checks if two TxSignaturess contain equal inner contents.
41424  * This ignores pointers and is_owned flags and looks at the values in fields.
41425  * Two objects with NULL inner values will be considered "equal" here.
41426  */
41427 bool TxSignatures_eq(const struct LDKTxSignatures *NONNULL_PTR a, const struct LDKTxSignatures *NONNULL_PTR b);
41428
41429 /**
41430  * Frees any resources used by the TxInitRbf, if is_owned is set and inner is non-NULL.
41431  */
41432 void TxInitRbf_free(struct LDKTxInitRbf this_obj);
41433
41434 /**
41435  * The channel ID
41436  */
41437 struct LDKChannelId TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
41438
41439 /**
41440  * The channel ID
41441  */
41442 void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKChannelId val);
41443
41444 /**
41445  * The locktime of the transaction
41446  */
41447 uint32_t TxInitRbf_get_locktime(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
41448
41449 /**
41450  * The locktime of the transaction
41451  */
41452 void TxInitRbf_set_locktime(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
41453
41454 /**
41455  * The feerate of the transaction
41456  */
41457 uint32_t TxInitRbf_get_feerate_sat_per_1000_weight(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
41458
41459 /**
41460  * The feerate of the transaction
41461  */
41462 void TxInitRbf_set_feerate_sat_per_1000_weight(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
41463
41464 /**
41465  * The number of satoshis the sender will contribute to or, if negative, remove from
41466  * (e.g. splice-out) the funding output of the transaction
41467  */
41468 struct LDKCOption_i64Z TxInitRbf_get_funding_output_contribution(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
41469
41470 /**
41471  * The number of satoshis the sender will contribute to or, if negative, remove from
41472  * (e.g. splice-out) the funding output of the transaction
41473  */
41474 void TxInitRbf_set_funding_output_contribution(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
41475
41476 /**
41477  * Constructs a new TxInitRbf given each field
41478  */
41479 MUST_USE_RES struct LDKTxInitRbf TxInitRbf_new(struct LDKChannelId channel_id_arg, uint32_t locktime_arg, uint32_t feerate_sat_per_1000_weight_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
41480
41481 /**
41482  * Creates a copy of the TxInitRbf
41483  */
41484 struct LDKTxInitRbf TxInitRbf_clone(const struct LDKTxInitRbf *NONNULL_PTR orig);
41485
41486 /**
41487  * Generates a non-cryptographic 64-bit hash of the TxInitRbf.
41488  */
41489 uint64_t TxInitRbf_hash(const struct LDKTxInitRbf *NONNULL_PTR o);
41490
41491 /**
41492  * Checks if two TxInitRbfs contain equal inner contents.
41493  * This ignores pointers and is_owned flags and looks at the values in fields.
41494  * Two objects with NULL inner values will be considered "equal" here.
41495  */
41496 bool TxInitRbf_eq(const struct LDKTxInitRbf *NONNULL_PTR a, const struct LDKTxInitRbf *NONNULL_PTR b);
41497
41498 /**
41499  * Frees any resources used by the TxAckRbf, if is_owned is set and inner is non-NULL.
41500  */
41501 void TxAckRbf_free(struct LDKTxAckRbf this_obj);
41502
41503 /**
41504  * The channel ID
41505  */
41506 struct LDKChannelId TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
41507
41508 /**
41509  * The channel ID
41510  */
41511 void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKChannelId val);
41512
41513 /**
41514  * The number of satoshis the sender will contribute to or, if negative, remove from
41515  * (e.g. splice-out) the funding output of the transaction
41516  */
41517 struct LDKCOption_i64Z TxAckRbf_get_funding_output_contribution(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
41518
41519 /**
41520  * The number of satoshis the sender will contribute to or, if negative, remove from
41521  * (e.g. splice-out) the funding output of the transaction
41522  */
41523 void TxAckRbf_set_funding_output_contribution(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
41524
41525 /**
41526  * Constructs a new TxAckRbf given each field
41527  */
41528 MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKChannelId channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
41529
41530 /**
41531  * Creates a copy of the TxAckRbf
41532  */
41533 struct LDKTxAckRbf TxAckRbf_clone(const struct LDKTxAckRbf *NONNULL_PTR orig);
41534
41535 /**
41536  * Generates a non-cryptographic 64-bit hash of the TxAckRbf.
41537  */
41538 uint64_t TxAckRbf_hash(const struct LDKTxAckRbf *NONNULL_PTR o);
41539
41540 /**
41541  * Checks if two TxAckRbfs contain equal inner contents.
41542  * This ignores pointers and is_owned flags and looks at the values in fields.
41543  * Two objects with NULL inner values will be considered "equal" here.
41544  */
41545 bool TxAckRbf_eq(const struct LDKTxAckRbf *NONNULL_PTR a, const struct LDKTxAckRbf *NONNULL_PTR b);
41546
41547 /**
41548  * Frees any resources used by the TxAbort, if is_owned is set and inner is non-NULL.
41549  */
41550 void TxAbort_free(struct LDKTxAbort this_obj);
41551
41552 /**
41553  * The channel ID
41554  */
41555 struct LDKChannelId TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr);
41556
41557 /**
41558  * The channel ID
41559  */
41560 void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKChannelId val);
41561
41562 /**
41563  * Message data
41564  *
41565  * Returns a copy of the field.
41566  */
41567 struct LDKCVec_u8Z TxAbort_get_data(const struct LDKTxAbort *NONNULL_PTR this_ptr);
41568
41569 /**
41570  * Message data
41571  */
41572 void TxAbort_set_data(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
41573
41574 /**
41575  * Constructs a new TxAbort given each field
41576  */
41577 MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z data_arg);
41578
41579 /**
41580  * Creates a copy of the TxAbort
41581  */
41582 struct LDKTxAbort TxAbort_clone(const struct LDKTxAbort *NONNULL_PTR orig);
41583
41584 /**
41585  * Generates a non-cryptographic 64-bit hash of the TxAbort.
41586  */
41587 uint64_t TxAbort_hash(const struct LDKTxAbort *NONNULL_PTR o);
41588
41589 /**
41590  * Checks if two TxAborts contain equal inner contents.
41591  * This ignores pointers and is_owned flags and looks at the values in fields.
41592  * Two objects with NULL inner values will be considered "equal" here.
41593  */
41594 bool TxAbort_eq(const struct LDKTxAbort *NONNULL_PTR a, const struct LDKTxAbort *NONNULL_PTR b);
41595
41596 /**
41597  * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
41598  */
41599 void Shutdown_free(struct LDKShutdown this_obj);
41600
41601 /**
41602  * The channel ID
41603  */
41604 struct LDKChannelId Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr);
41605
41606 /**
41607  * The channel ID
41608  */
41609 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKChannelId val);
41610
41611 /**
41612  * The destination of this peer's funds on closing.
41613  *
41614  * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
41615  */
41616 struct LDKCVec_u8Z Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
41617
41618 /**
41619  * The destination of this peer's funds on closing.
41620  *
41621  * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
41622  */
41623 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
41624
41625 /**
41626  * Constructs a new Shutdown given each field
41627  */
41628 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
41629
41630 /**
41631  * Creates a copy of the Shutdown
41632  */
41633 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
41634
41635 /**
41636  * Generates a non-cryptographic 64-bit hash of the Shutdown.
41637  */
41638 uint64_t Shutdown_hash(const struct LDKShutdown *NONNULL_PTR o);
41639
41640 /**
41641  * Checks if two Shutdowns contain equal inner contents.
41642  * This ignores pointers and is_owned flags and looks at the values in fields.
41643  * Two objects with NULL inner values will be considered "equal" here.
41644  */
41645 bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
41646
41647 /**
41648  * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
41649  */
41650 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
41651
41652 /**
41653  * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
41654  * transaction.
41655  */
41656 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
41657
41658 /**
41659  * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
41660  * transaction.
41661  */
41662 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
41663
41664 /**
41665  * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
41666  * transaction.
41667  */
41668 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
41669
41670 /**
41671  * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
41672  * transaction.
41673  */
41674 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
41675
41676 /**
41677  * Constructs a new ClosingSignedFeeRange given each field
41678  */
41679 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
41680
41681 /**
41682  * Creates a copy of the ClosingSignedFeeRange
41683  */
41684 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
41685
41686 /**
41687  * Generates a non-cryptographic 64-bit hash of the ClosingSignedFeeRange.
41688  */
41689 uint64_t ClosingSignedFeeRange_hash(const struct LDKClosingSignedFeeRange *NONNULL_PTR o);
41690
41691 /**
41692  * Checks if two ClosingSignedFeeRanges contain equal inner contents.
41693  * This ignores pointers and is_owned flags and looks at the values in fields.
41694  * Two objects with NULL inner values will be considered "equal" here.
41695  */
41696 bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
41697
41698 /**
41699  * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
41700  */
41701 void ClosingSigned_free(struct LDKClosingSigned this_obj);
41702
41703 /**
41704  * The channel ID
41705  */
41706 struct LDKChannelId ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
41707
41708 /**
41709  * The channel ID
41710  */
41711 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
41712
41713 /**
41714  * The proposed total fee for the closing transaction
41715  */
41716 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
41717
41718 /**
41719  * The proposed total fee for the closing transaction
41720  */
41721 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
41722
41723 /**
41724  * A signature on the closing transaction
41725  */
41726 struct LDKECDSASignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
41727
41728 /**
41729  * A signature on the closing transaction
41730  */
41731 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41732
41733 /**
41734  * The minimum and maximum fees which the sender is willing to accept, provided only by new
41735  * nodes.
41736  *
41737  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41738  */
41739 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
41740
41741 /**
41742  * The minimum and maximum fees which the sender is willing to accept, provided only by new
41743  * nodes.
41744  *
41745  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41746  */
41747 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
41748
41749 /**
41750  * Constructs a new ClosingSigned given each field
41751  *
41752  * Note that fee_range_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
41753  */
41754 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKChannelId channel_id_arg, uint64_t fee_satoshis_arg, struct LDKECDSASignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg);
41755
41756 /**
41757  * Creates a copy of the ClosingSigned
41758  */
41759 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
41760
41761 /**
41762  * Generates a non-cryptographic 64-bit hash of the ClosingSigned.
41763  */
41764 uint64_t ClosingSigned_hash(const struct LDKClosingSigned *NONNULL_PTR o);
41765
41766 /**
41767  * Checks if two ClosingSigneds contain equal inner contents.
41768  * This ignores pointers and is_owned flags and looks at the values in fields.
41769  * Two objects with NULL inner values will be considered "equal" here.
41770  */
41771 bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
41772
41773 /**
41774  * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
41775  */
41776 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
41777
41778 /**
41779  * The channel ID
41780  */
41781 struct LDKChannelId UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
41782
41783 /**
41784  * The channel ID
41785  */
41786 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
41787
41788 /**
41789  * The HTLC ID
41790  */
41791 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
41792
41793 /**
41794  * The HTLC ID
41795  */
41796 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
41797
41798 /**
41799  * The HTLC value in milli-satoshi
41800  */
41801 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
41802
41803 /**
41804  * The HTLC value in milli-satoshi
41805  */
41806 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
41807
41808 /**
41809  * The payment hash, the pre-image of which controls HTLC redemption
41810  */
41811 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
41812
41813 /**
41814  * The payment hash, the pre-image of which controls HTLC redemption
41815  */
41816 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41817
41818 /**
41819  * The expiry height of the HTLC
41820  */
41821 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
41822
41823 /**
41824  * The expiry height of the HTLC
41825  */
41826 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
41827
41828 /**
41829  * The extra fee skimmed by the sender of this message. See
41830  * [`ChannelConfig::accept_underpaying_htlcs`].
41831  *
41832  * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
41833  */
41834 struct LDKCOption_u64Z UpdateAddHTLC_get_skimmed_fee_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
41835
41836 /**
41837  * The extra fee skimmed by the sender of this message. See
41838  * [`ChannelConfig::accept_underpaying_htlcs`].
41839  *
41840  * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
41841  */
41842 void UpdateAddHTLC_set_skimmed_fee_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
41843
41844 /**
41845  * The onion routing packet with encrypted data for the next hop.
41846  */
41847 struct LDKOnionPacket UpdateAddHTLC_get_onion_routing_packet(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
41848
41849 /**
41850  * The onion routing packet with encrypted data for the next hop.
41851  */
41852 void UpdateAddHTLC_set_onion_routing_packet(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKOnionPacket val);
41853
41854 /**
41855  * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
41856  * routing packet and the recipient-provided encrypted payload within.
41857  *
41858  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41859  */
41860 struct LDKPublicKey UpdateAddHTLC_get_blinding_point(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
41861
41862 /**
41863  * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
41864  * routing packet and the recipient-provided encrypted payload within.
41865  *
41866  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41867  */
41868 void UpdateAddHTLC_set_blinding_point(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKPublicKey val);
41869
41870 /**
41871  * Constructs a new UpdateAddHTLC given each field
41872  *
41873  * Note that blinding_point_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
41874  */
41875 MUST_USE_RES struct LDKUpdateAddHTLC UpdateAddHTLC_new(struct LDKChannelId channel_id_arg, uint64_t htlc_id_arg, uint64_t amount_msat_arg, struct LDKThirtyTwoBytes payment_hash_arg, uint32_t cltv_expiry_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg, struct LDKOnionPacket onion_routing_packet_arg, struct LDKPublicKey blinding_point_arg);
41876
41877 /**
41878  * Creates a copy of the UpdateAddHTLC
41879  */
41880 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
41881
41882 /**
41883  * Generates a non-cryptographic 64-bit hash of the UpdateAddHTLC.
41884  */
41885 uint64_t UpdateAddHTLC_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR o);
41886
41887 /**
41888  * Checks if two UpdateAddHTLCs contain equal inner contents.
41889  * This ignores pointers and is_owned flags and looks at the values in fields.
41890  * Two objects with NULL inner values will be considered "equal" here.
41891  */
41892 bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
41893
41894 /**
41895  * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
41896  */
41897 void OnionMessage_free(struct LDKOnionMessage this_obj);
41898
41899 /**
41900  * Used in decrypting the onion packet's payload.
41901  */
41902 struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
41903
41904 /**
41905  * Used in decrypting the onion packet's payload.
41906  */
41907 void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
41908
41909 /**
41910  * The full onion packet including hop data, pubkey, and hmac
41911  */
41912 struct LDKPacket OnionMessage_get_onion_routing_packet(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
41913
41914 /**
41915  * The full onion packet including hop data, pubkey, and hmac
41916  */
41917 void OnionMessage_set_onion_routing_packet(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPacket val);
41918
41919 /**
41920  * Constructs a new OnionMessage given each field
41921  */
41922 MUST_USE_RES struct LDKOnionMessage OnionMessage_new(struct LDKPublicKey blinding_point_arg, struct LDKPacket onion_routing_packet_arg);
41923
41924 /**
41925  * Creates a copy of the OnionMessage
41926  */
41927 struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
41928
41929 /**
41930  * Generates a non-cryptographic 64-bit hash of the OnionMessage.
41931  */
41932 uint64_t OnionMessage_hash(const struct LDKOnionMessage *NONNULL_PTR o);
41933
41934 /**
41935  * Checks if two OnionMessages contain equal inner contents.
41936  * This ignores pointers and is_owned flags and looks at the values in fields.
41937  * Two objects with NULL inner values will be considered "equal" here.
41938  */
41939 bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
41940
41941 /**
41942  * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
41943  */
41944 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
41945
41946 /**
41947  * The channel ID
41948  */
41949 struct LDKChannelId UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
41950
41951 /**
41952  * The channel ID
41953  */
41954 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
41955
41956 /**
41957  * The HTLC ID
41958  */
41959 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
41960
41961 /**
41962  * The HTLC ID
41963  */
41964 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
41965
41966 /**
41967  * The pre-image of the payment hash, allowing HTLC redemption
41968  */
41969 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
41970
41971 /**
41972  * The pre-image of the payment hash, allowing HTLC redemption
41973  */
41974 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41975
41976 /**
41977  * Constructs a new UpdateFulfillHTLC given each field
41978  */
41979 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKChannelId channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
41980
41981 /**
41982  * Creates a copy of the UpdateFulfillHTLC
41983  */
41984 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
41985
41986 /**
41987  * Generates a non-cryptographic 64-bit hash of the UpdateFulfillHTLC.
41988  */
41989 uint64_t UpdateFulfillHTLC_hash(const struct LDKUpdateFulfillHTLC *NONNULL_PTR o);
41990
41991 /**
41992  * Checks if two UpdateFulfillHTLCs contain equal inner contents.
41993  * This ignores pointers and is_owned flags and looks at the values in fields.
41994  * Two objects with NULL inner values will be considered "equal" here.
41995  */
41996 bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
41997
41998 /**
41999  * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
42000  */
42001 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
42002
42003 /**
42004  * The channel ID
42005  */
42006 struct LDKChannelId UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
42007
42008 /**
42009  * The channel ID
42010  */
42011 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
42012
42013 /**
42014  * The HTLC ID
42015  */
42016 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
42017
42018 /**
42019  * The HTLC ID
42020  */
42021 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
42022
42023 /**
42024  * Creates a copy of the UpdateFailHTLC
42025  */
42026 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
42027
42028 /**
42029  * Generates a non-cryptographic 64-bit hash of the UpdateFailHTLC.
42030  */
42031 uint64_t UpdateFailHTLC_hash(const struct LDKUpdateFailHTLC *NONNULL_PTR o);
42032
42033 /**
42034  * Checks if two UpdateFailHTLCs contain equal inner contents.
42035  * This ignores pointers and is_owned flags and looks at the values in fields.
42036  * Two objects with NULL inner values will be considered "equal" here.
42037  */
42038 bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
42039
42040 /**
42041  * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
42042  */
42043 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
42044
42045 /**
42046  * The channel ID
42047  */
42048 struct LDKChannelId UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
42049
42050 /**
42051  * The channel ID
42052  */
42053 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
42054
42055 /**
42056  * The HTLC ID
42057  */
42058 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
42059
42060 /**
42061  * The HTLC ID
42062  */
42063 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
42064
42065 /**
42066  * The failure code
42067  */
42068 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
42069
42070 /**
42071  * The failure code
42072  */
42073 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
42074
42075 /**
42076  * Creates a copy of the UpdateFailMalformedHTLC
42077  */
42078 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
42079
42080 /**
42081  * Generates a non-cryptographic 64-bit hash of the UpdateFailMalformedHTLC.
42082  */
42083 uint64_t UpdateFailMalformedHTLC_hash(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR o);
42084
42085 /**
42086  * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
42087  * This ignores pointers and is_owned flags and looks at the values in fields.
42088  * Two objects with NULL inner values will be considered "equal" here.
42089  */
42090 bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
42091
42092 /**
42093  * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
42094  */
42095 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
42096
42097 /**
42098  * The channel ID
42099  */
42100 struct LDKChannelId CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
42101
42102 /**
42103  * The channel ID
42104  */
42105 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
42106
42107 /**
42108  * A signature on the commitment transaction
42109  */
42110 struct LDKECDSASignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
42111
42112 /**
42113  * A signature on the commitment transaction
42114  */
42115 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
42116
42117 /**
42118  * Signatures on the HTLC transactions
42119  *
42120  * Returns a copy of the field.
42121  */
42122 struct LDKCVec_ECDSASignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
42123
42124 /**
42125  * Signatures on the HTLC transactions
42126  */
42127 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
42128
42129 /**
42130  * Constructs a new CommitmentSigned given each field
42131  */
42132 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg);
42133
42134 /**
42135  * Creates a copy of the CommitmentSigned
42136  */
42137 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
42138
42139 /**
42140  * Generates a non-cryptographic 64-bit hash of the CommitmentSigned.
42141  */
42142 uint64_t CommitmentSigned_hash(const struct LDKCommitmentSigned *NONNULL_PTR o);
42143
42144 /**
42145  * Checks if two CommitmentSigneds contain equal inner contents.
42146  * This ignores pointers and is_owned flags and looks at the values in fields.
42147  * Two objects with NULL inner values will be considered "equal" here.
42148  */
42149 bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
42150
42151 /**
42152  * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
42153  */
42154 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
42155
42156 /**
42157  * The channel ID
42158  */
42159 struct LDKChannelId RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
42160
42161 /**
42162  * The channel ID
42163  */
42164 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKChannelId val);
42165
42166 /**
42167  * The secret corresponding to the per-commitment point
42168  */
42169 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
42170
42171 /**
42172  * The secret corresponding to the per-commitment point
42173  */
42174 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42175
42176 /**
42177  * The next sender-broadcast commitment transaction's per-commitment point
42178  */
42179 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
42180
42181 /**
42182  * The next sender-broadcast commitment transaction's per-commitment point
42183  */
42184 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
42185
42186 /**
42187  * Constructs a new RevokeAndACK given each field
42188  */
42189 MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg);
42190
42191 /**
42192  * Creates a copy of the RevokeAndACK
42193  */
42194 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
42195
42196 /**
42197  * Generates a non-cryptographic 64-bit hash of the RevokeAndACK.
42198  */
42199 uint64_t RevokeAndACK_hash(const struct LDKRevokeAndACK *NONNULL_PTR o);
42200
42201 /**
42202  * Checks if two RevokeAndACKs contain equal inner contents.
42203  * This ignores pointers and is_owned flags and looks at the values in fields.
42204  * Two objects with NULL inner values will be considered "equal" here.
42205  */
42206 bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
42207
42208 /**
42209  * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
42210  */
42211 void UpdateFee_free(struct LDKUpdateFee this_obj);
42212
42213 /**
42214  * The channel ID
42215  */
42216 struct LDKChannelId UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
42217
42218 /**
42219  * The channel ID
42220  */
42221 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKChannelId val);
42222
42223 /**
42224  * Fee rate per 1000-weight of the transaction
42225  */
42226 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
42227
42228 /**
42229  * Fee rate per 1000-weight of the transaction
42230  */
42231 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
42232
42233 /**
42234  * Constructs a new UpdateFee given each field
42235  */
42236 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKChannelId channel_id_arg, uint32_t feerate_per_kw_arg);
42237
42238 /**
42239  * Creates a copy of the UpdateFee
42240  */
42241 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
42242
42243 /**
42244  * Generates a non-cryptographic 64-bit hash of the UpdateFee.
42245  */
42246 uint64_t UpdateFee_hash(const struct LDKUpdateFee *NONNULL_PTR o);
42247
42248 /**
42249  * Checks if two UpdateFees contain equal inner contents.
42250  * This ignores pointers and is_owned flags and looks at the values in fields.
42251  * Two objects with NULL inner values will be considered "equal" here.
42252  */
42253 bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
42254
42255 /**
42256  * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
42257  */
42258 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
42259
42260 /**
42261  * The channel ID
42262  */
42263 struct LDKChannelId ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
42264
42265 /**
42266  * The channel ID
42267  */
42268 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKChannelId val);
42269
42270 /**
42271  * The next commitment number for the sender
42272  */
42273 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
42274
42275 /**
42276  * The next commitment number for the sender
42277  */
42278 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
42279
42280 /**
42281  * The next commitment number for the recipient
42282  */
42283 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
42284
42285 /**
42286  * The next commitment number for the recipient
42287  */
42288 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
42289
42290 /**
42291  * Proof that the sender knows the per-commitment secret of a specific commitment transaction
42292  * belonging to the recipient
42293  */
42294 const uint8_t (*ChannelReestablish_get_your_last_per_commitment_secret(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
42295
42296 /**
42297  * Proof that the sender knows the per-commitment secret of a specific commitment transaction
42298  * belonging to the recipient
42299  */
42300 void ChannelReestablish_set_your_last_per_commitment_secret(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42301
42302 /**
42303  * The sender's per-commitment point for their current commitment transaction
42304  */
42305 struct LDKPublicKey ChannelReestablish_get_my_current_per_commitment_point(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
42306
42307 /**
42308  * The sender's per-commitment point for their current commitment transaction
42309  */
42310 void ChannelReestablish_set_my_current_per_commitment_point(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKPublicKey val);
42311
42312 /**
42313  * The next funding transaction ID
42314  */
42315 struct LDKCOption_ThirtyTwoBytesZ ChannelReestablish_get_next_funding_txid(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
42316
42317 /**
42318  * The next funding transaction ID
42319  */
42320 void ChannelReestablish_set_next_funding_txid(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
42321
42322 /**
42323  * Constructs a new ChannelReestablish given each field
42324  */
42325 MUST_USE_RES struct LDKChannelReestablish ChannelReestablish_new(struct LDKChannelId channel_id_arg, uint64_t next_local_commitment_number_arg, uint64_t next_remote_commitment_number_arg, struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg, struct LDKCOption_ThirtyTwoBytesZ next_funding_txid_arg);
42326
42327 /**
42328  * Creates a copy of the ChannelReestablish
42329  */
42330 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
42331
42332 /**
42333  * Generates a non-cryptographic 64-bit hash of the ChannelReestablish.
42334  */
42335 uint64_t ChannelReestablish_hash(const struct LDKChannelReestablish *NONNULL_PTR o);
42336
42337 /**
42338  * Checks if two ChannelReestablishs contain equal inner contents.
42339  * This ignores pointers and is_owned flags and looks at the values in fields.
42340  * Two objects with NULL inner values will be considered "equal" here.
42341  */
42342 bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
42343
42344 /**
42345  * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
42346  */
42347 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
42348
42349 /**
42350  * The channel ID
42351  */
42352 struct LDKChannelId AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
42353
42354 /**
42355  * The channel ID
42356  */
42357 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val);
42358
42359 /**
42360  * The short channel ID
42361  */
42362 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
42363
42364 /**
42365  * The short channel ID
42366  */
42367 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
42368
42369 /**
42370  * A signature by the node key
42371  */
42372 struct LDKECDSASignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
42373
42374 /**
42375  * A signature by the node key
42376  */
42377 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
42378
42379 /**
42380  * A signature by the funding key
42381  */
42382 struct LDKECDSASignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
42383
42384 /**
42385  * A signature by the funding key
42386  */
42387 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
42388
42389 /**
42390  * Constructs a new AnnouncementSignatures given each field
42391  */
42392 MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKChannelId channel_id_arg, uint64_t short_channel_id_arg, struct LDKECDSASignature node_signature_arg, struct LDKECDSASignature bitcoin_signature_arg);
42393
42394 /**
42395  * Creates a copy of the AnnouncementSignatures
42396  */
42397 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
42398
42399 /**
42400  * Generates a non-cryptographic 64-bit hash of the AnnouncementSignatures.
42401  */
42402 uint64_t AnnouncementSignatures_hash(const struct LDKAnnouncementSignatures *NONNULL_PTR o);
42403
42404 /**
42405  * Checks if two AnnouncementSignaturess contain equal inner contents.
42406  * This ignores pointers and is_owned flags and looks at the values in fields.
42407  * Two objects with NULL inner values will be considered "equal" here.
42408  */
42409 bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
42410
42411 /**
42412  * Frees any resources used by the SocketAddress
42413  */
42414 void SocketAddress_free(struct LDKSocketAddress this_ptr);
42415
42416 /**
42417  * Creates a copy of the SocketAddress
42418  */
42419 struct LDKSocketAddress SocketAddress_clone(const struct LDKSocketAddress *NONNULL_PTR orig);
42420
42421 /**
42422  * Utility method to constructs a new TcpIpV4-variant SocketAddress
42423  */
42424 struct LDKSocketAddress SocketAddress_tcp_ip_v4(struct LDKFourBytes addr, uint16_t port);
42425
42426 /**
42427  * Utility method to constructs a new TcpIpV6-variant SocketAddress
42428  */
42429 struct LDKSocketAddress SocketAddress_tcp_ip_v6(struct LDKSixteenBytes addr, uint16_t port);
42430
42431 /**
42432  * Utility method to constructs a new OnionV2-variant SocketAddress
42433  */
42434 struct LDKSocketAddress SocketAddress_onion_v2(struct LDKTwelveBytes a);
42435
42436 /**
42437  * Utility method to constructs a new OnionV3-variant SocketAddress
42438  */
42439 struct LDKSocketAddress SocketAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
42440
42441 /**
42442  * Utility method to constructs a new Hostname-variant SocketAddress
42443  */
42444 struct LDKSocketAddress SocketAddress_hostname(struct LDKHostname hostname, uint16_t port);
42445
42446 /**
42447  * Generates a non-cryptographic 64-bit hash of the SocketAddress.
42448  */
42449 uint64_t SocketAddress_hash(const struct LDKSocketAddress *NONNULL_PTR o);
42450
42451 /**
42452  * Checks if two SocketAddresss contain equal inner contents.
42453  * This ignores pointers and is_owned flags and looks at the values in fields.
42454  */
42455 bool SocketAddress_eq(const struct LDKSocketAddress *NONNULL_PTR a, const struct LDKSocketAddress *NONNULL_PTR b);
42456
42457 /**
42458  * Serialize the SocketAddress object into a byte array which can be read by SocketAddress_read
42459  */
42460 struct LDKCVec_u8Z SocketAddress_write(const struct LDKSocketAddress *NONNULL_PTR obj);
42461
42462 /**
42463  * Read a SocketAddress from a byte array, created by SocketAddress_write
42464  */
42465 struct LDKCResult_SocketAddressDecodeErrorZ SocketAddress_read(struct LDKu8slice ser);
42466
42467 /**
42468  * Creates a copy of the SocketAddressParseError
42469  */
42470 enum LDKSocketAddressParseError SocketAddressParseError_clone(const enum LDKSocketAddressParseError *NONNULL_PTR orig);
42471
42472 /**
42473  * Utility method to constructs a new SocketAddrParse-variant SocketAddressParseError
42474  */
42475 enum LDKSocketAddressParseError SocketAddressParseError_socket_addr_parse(void);
42476
42477 /**
42478  * Utility method to constructs a new InvalidInput-variant SocketAddressParseError
42479  */
42480 enum LDKSocketAddressParseError SocketAddressParseError_invalid_input(void);
42481
42482 /**
42483  * Utility method to constructs a new InvalidPort-variant SocketAddressParseError
42484  */
42485 enum LDKSocketAddressParseError SocketAddressParseError_invalid_port(void);
42486
42487 /**
42488  * Utility method to constructs a new InvalidOnionV3-variant SocketAddressParseError
42489  */
42490 enum LDKSocketAddressParseError SocketAddressParseError_invalid_onion_v3(void);
42491
42492 /**
42493  * Generates a non-cryptographic 64-bit hash of the SocketAddressParseError.
42494  */
42495 uint64_t SocketAddressParseError_hash(const enum LDKSocketAddressParseError *NONNULL_PTR o);
42496
42497 /**
42498  * Checks if two SocketAddressParseErrors contain equal inner contents.
42499  * This ignores pointers and is_owned flags and looks at the values in fields.
42500  */
42501 bool SocketAddressParseError_eq(const enum LDKSocketAddressParseError *NONNULL_PTR a, const enum LDKSocketAddressParseError *NONNULL_PTR b);
42502
42503 /**
42504  * Get the string representation of a SocketAddressParseError object
42505  */
42506 struct LDKStr SocketAddressParseError_to_str(const enum LDKSocketAddressParseError *NONNULL_PTR o);
42507
42508 /**
42509  * Parses an OnionV3 host and port into a [`SocketAddress::OnionV3`].
42510  *
42511  * The host part must end with \".onion\".
42512  */
42513 struct LDKCResult_SocketAddressSocketAddressParseErrorZ parse_onion_address(struct LDKStr host, uint16_t port);
42514
42515 /**
42516  * Get the string representation of a SocketAddress object
42517  */
42518 struct LDKStr SocketAddress_to_str(const struct LDKSocketAddress *NONNULL_PTR o);
42519
42520 /**
42521  * Read a SocketAddress object from a string
42522  */
42523 struct LDKCResult_SocketAddressSocketAddressParseErrorZ SocketAddress_from_str(struct LDKStr s);
42524
42525 /**
42526  * Frees any resources used by the UnsignedGossipMessage
42527  */
42528 void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr);
42529
42530 /**
42531  * Creates a copy of the UnsignedGossipMessage
42532  */
42533 struct LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig);
42534
42535 /**
42536  * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage
42537  */
42538 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a);
42539
42540 /**
42541  * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage
42542  */
42543 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a);
42544
42545 /**
42546  * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage
42547  */
42548 struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a);
42549
42550 /**
42551  * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read
42552  */
42553 struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj);
42554
42555 /**
42556  * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
42557  */
42558 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
42559
42560 /**
42561  * The advertised features
42562  */
42563 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
42564
42565 /**
42566  * The advertised features
42567  */
42568 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
42569
42570 /**
42571  * A strictly monotonic announcement counter, with gaps allowed
42572  */
42573 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
42574
42575 /**
42576  * A strictly monotonic announcement counter, with gaps allowed
42577  */
42578 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
42579
42580 /**
42581  * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
42582  * to this node).
42583  */
42584 struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
42585
42586 /**
42587  * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
42588  * to this node).
42589  */
42590 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
42591
42592 /**
42593  * An RGB color for UI purposes
42594  */
42595 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
42596
42597 /**
42598  * An RGB color for UI purposes
42599  */
42600 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
42601
42602 /**
42603  * An alias, for UI purposes.
42604  *
42605  * This should be sanitized before use. There is no guarantee of uniqueness.
42606  */
42607 struct LDKNodeAlias UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
42608
42609 /**
42610  * An alias, for UI purposes.
42611  *
42612  * This should be sanitized before use. There is no guarantee of uniqueness.
42613  */
42614 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
42615
42616 /**
42617  * List of addresses on which this node is reachable
42618  *
42619  * Returns a copy of the field.
42620  */
42621 struct LDKCVec_SocketAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
42622
42623 /**
42624  * List of addresses on which this node is reachable
42625  */
42626 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val);
42627
42628 /**
42629  * Excess address data which was signed as a part of the message which we do not (yet) understand how
42630  * to decode.
42631  *
42632  * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol.
42633  *
42634  * Returns a copy of the field.
42635  */
42636 struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_address_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
42637
42638 /**
42639  * Excess address data which was signed as a part of the message which we do not (yet) understand how
42640  * to decode.
42641  *
42642  * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol.
42643  */
42644 void UnsignedNodeAnnouncement_set_excess_address_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
42645
42646 /**
42647  * Excess data which was signed as a part of the message which we do not (yet) understand how
42648  * to decode.
42649  *
42650  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
42651  *
42652  * Returns a copy of the field.
42653  */
42654 struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
42655
42656 /**
42657  * Excess data which was signed as a part of the message which we do not (yet) understand how
42658  * to decode.
42659  *
42660  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
42661  */
42662 void UnsignedNodeAnnouncement_set_excess_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
42663
42664 /**
42665  * Constructs a new UnsignedNodeAnnouncement given each field
42666  */
42667 MUST_USE_RES struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_new(struct LDKNodeFeatures features_arg, uint32_t timestamp_arg, struct LDKNodeId node_id_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKCVec_SocketAddressZ addresses_arg, struct LDKCVec_u8Z excess_address_data_arg, struct LDKCVec_u8Z excess_data_arg);
42668
42669 /**
42670  * Creates a copy of the UnsignedNodeAnnouncement
42671  */
42672 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
42673
42674 /**
42675  * Generates a non-cryptographic 64-bit hash of the UnsignedNodeAnnouncement.
42676  */
42677 uint64_t UnsignedNodeAnnouncement_hash(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR o);
42678
42679 /**
42680  * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
42681  * This ignores pointers and is_owned flags and looks at the values in fields.
42682  * Two objects with NULL inner values will be considered "equal" here.
42683  */
42684 bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
42685
42686 /**
42687  * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
42688  */
42689 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
42690
42691 /**
42692  * The signature by the node key
42693  */
42694 struct LDKECDSASignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
42695
42696 /**
42697  * The signature by the node key
42698  */
42699 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
42700
42701 /**
42702  * The actual content of the announcement
42703  */
42704 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
42705
42706 /**
42707  * The actual content of the announcement
42708  */
42709 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
42710
42711 /**
42712  * Constructs a new NodeAnnouncement given each field
42713  */
42714 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
42715
42716 /**
42717  * Creates a copy of the NodeAnnouncement
42718  */
42719 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
42720
42721 /**
42722  * Generates a non-cryptographic 64-bit hash of the NodeAnnouncement.
42723  */
42724 uint64_t NodeAnnouncement_hash(const struct LDKNodeAnnouncement *NONNULL_PTR o);
42725
42726 /**
42727  * Checks if two NodeAnnouncements contain equal inner contents.
42728  * This ignores pointers and is_owned flags and looks at the values in fields.
42729  * Two objects with NULL inner values will be considered "equal" here.
42730  */
42731 bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
42732
42733 /**
42734  * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
42735  */
42736 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
42737
42738 /**
42739  * The advertised channel features
42740  */
42741 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
42742
42743 /**
42744  * The advertised channel features
42745  */
42746 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
42747
42748 /**
42749  * The genesis hash of the blockchain where the channel is to be opened
42750  */
42751 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
42752
42753 /**
42754  * The genesis hash of the blockchain where the channel is to be opened
42755  */
42756 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42757
42758 /**
42759  * The short channel ID
42760  */
42761 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
42762
42763 /**
42764  * The short channel ID
42765  */
42766 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
42767
42768 /**
42769  * One of the two `node_id`s which are endpoints of this channel
42770  */
42771 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
42772
42773 /**
42774  * One of the two `node_id`s which are endpoints of this channel
42775  */
42776 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
42777
42778 /**
42779  * The other of the two `node_id`s which are endpoints of this channel
42780  */
42781 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
42782
42783 /**
42784  * The other of the two `node_id`s which are endpoints of this channel
42785  */
42786 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
42787
42788 /**
42789  * The funding key for the first node
42790  */
42791 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
42792
42793 /**
42794  * The funding key for the first node
42795  */
42796 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
42797
42798 /**
42799  * The funding key for the second node
42800  */
42801 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
42802
42803 /**
42804  * The funding key for the second node
42805  */
42806 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
42807
42808 /**
42809  * Excess data which was signed as a part of the message which we do not (yet) understand how
42810  * to decode.
42811  *
42812  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
42813  *
42814  * Returns a copy of the field.
42815  */
42816 struct LDKCVec_u8Z UnsignedChannelAnnouncement_get_excess_data(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
42817
42818 /**
42819  * Excess data which was signed as a part of the message which we do not (yet) understand how
42820  * to decode.
42821  *
42822  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
42823  */
42824 void UnsignedChannelAnnouncement_set_excess_data(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
42825
42826 /**
42827  * Constructs a new UnsignedChannelAnnouncement given each field
42828  */
42829 MUST_USE_RES struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_new(struct LDKChannelFeatures features_arg, struct LDKThirtyTwoBytes chain_hash_arg, uint64_t short_channel_id_arg, struct LDKNodeId node_id_1_arg, struct LDKNodeId node_id_2_arg, struct LDKNodeId bitcoin_key_1_arg, struct LDKNodeId bitcoin_key_2_arg, struct LDKCVec_u8Z excess_data_arg);
42830
42831 /**
42832  * Creates a copy of the UnsignedChannelAnnouncement
42833  */
42834 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
42835
42836 /**
42837  * Generates a non-cryptographic 64-bit hash of the UnsignedChannelAnnouncement.
42838  */
42839 uint64_t UnsignedChannelAnnouncement_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR o);
42840
42841 /**
42842  * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
42843  * This ignores pointers and is_owned flags and looks at the values in fields.
42844  * Two objects with NULL inner values will be considered "equal" here.
42845  */
42846 bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
42847
42848 /**
42849  * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
42850  */
42851 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
42852
42853 /**
42854  * Authentication of the announcement by the first public node
42855  */
42856 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
42857
42858 /**
42859  * Authentication of the announcement by the first public node
42860  */
42861 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
42862
42863 /**
42864  * Authentication of the announcement by the second public node
42865  */
42866 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
42867
42868 /**
42869  * Authentication of the announcement by the second public node
42870  */
42871 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
42872
42873 /**
42874  * Proof of funding UTXO ownership by the first public node
42875  */
42876 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
42877
42878 /**
42879  * Proof of funding UTXO ownership by the first public node
42880  */
42881 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
42882
42883 /**
42884  * Proof of funding UTXO ownership by the second public node
42885  */
42886 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
42887
42888 /**
42889  * Proof of funding UTXO ownership by the second public node
42890  */
42891 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
42892
42893 /**
42894  * The actual announcement
42895  */
42896 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
42897
42898 /**
42899  * The actual announcement
42900  */
42901 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
42902
42903 /**
42904  * Constructs a new ChannelAnnouncement given each field
42905  */
42906 MUST_USE_RES struct LDKChannelAnnouncement ChannelAnnouncement_new(struct LDKECDSASignature node_signature_1_arg, struct LDKECDSASignature node_signature_2_arg, struct LDKECDSASignature bitcoin_signature_1_arg, struct LDKECDSASignature bitcoin_signature_2_arg, struct LDKUnsignedChannelAnnouncement contents_arg);
42907
42908 /**
42909  * Creates a copy of the ChannelAnnouncement
42910  */
42911 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
42912
42913 /**
42914  * Generates a non-cryptographic 64-bit hash of the ChannelAnnouncement.
42915  */
42916 uint64_t ChannelAnnouncement_hash(const struct LDKChannelAnnouncement *NONNULL_PTR o);
42917
42918 /**
42919  * Checks if two ChannelAnnouncements contain equal inner contents.
42920  * This ignores pointers and is_owned flags and looks at the values in fields.
42921  * Two objects with NULL inner values will be considered "equal" here.
42922  */
42923 bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
42924
42925 /**
42926  * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
42927  */
42928 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
42929
42930 /**
42931  * The genesis hash of the blockchain where the channel is to be opened
42932  */
42933 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
42934
42935 /**
42936  * The genesis hash of the blockchain where the channel is to be opened
42937  */
42938 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42939
42940 /**
42941  * The short channel ID
42942  */
42943 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42944
42945 /**
42946  * The short channel ID
42947  */
42948 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
42949
42950 /**
42951  * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
42952  */
42953 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42954
42955 /**
42956  * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
42957  */
42958 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
42959
42960 /**
42961  * Channel flags
42962  */
42963 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42964
42965 /**
42966  * Channel flags
42967  */
42968 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
42969
42970 /**
42971  * The number of blocks such that if:
42972  * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
42973  * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
42974  * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
42975  * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
42976  * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
42977  * forwarding. Note that the HTLC sender is the one who originally sets this value when
42978  * constructing the route.
42979  */
42980 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42981
42982 /**
42983  * The number of blocks such that if:
42984  * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
42985  * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
42986  * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
42987  * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
42988  * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
42989  * forwarding. Note that the HTLC sender is the one who originally sets this value when
42990  * constructing the route.
42991  */
42992 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
42993
42994 /**
42995  * The minimum HTLC size incoming to sender, in milli-satoshi
42996  */
42997 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42998
42999 /**
43000  * The minimum HTLC size incoming to sender, in milli-satoshi
43001  */
43002 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
43003
43004 /**
43005  * The maximum HTLC value incoming to sender, in milli-satoshi.
43006  *
43007  * This used to be optional.
43008  */
43009 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
43010
43011 /**
43012  * The maximum HTLC value incoming to sender, in milli-satoshi.
43013  *
43014  * This used to be optional.
43015  */
43016 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
43017
43018 /**
43019  * The base HTLC fee charged by sender, in milli-satoshi
43020  */
43021 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
43022
43023 /**
43024  * The base HTLC fee charged by sender, in milli-satoshi
43025  */
43026 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
43027
43028 /**
43029  * The amount to fee multiplier, in micro-satoshi
43030  */
43031 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
43032
43033 /**
43034  * The amount to fee multiplier, in micro-satoshi
43035  */
43036 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
43037
43038 /**
43039  * Excess data which was signed as a part of the message which we do not (yet) understand how
43040  * to decode.
43041  *
43042  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
43043  *
43044  * Returns a copy of the field.
43045  */
43046 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
43047
43048 /**
43049  * Excess data which was signed as a part of the message which we do not (yet) understand how
43050  * to decode.
43051  *
43052  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
43053  */
43054 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
43055
43056 /**
43057  * Constructs a new UnsignedChannelUpdate given each field
43058  */
43059 MUST_USE_RES struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_new(struct LDKThirtyTwoBytes chain_hash_arg, uint64_t short_channel_id_arg, uint32_t timestamp_arg, uint8_t flags_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, struct LDKCVec_u8Z excess_data_arg);
43060
43061 /**
43062  * Creates a copy of the UnsignedChannelUpdate
43063  */
43064 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
43065
43066 /**
43067  * Generates a non-cryptographic 64-bit hash of the UnsignedChannelUpdate.
43068  */
43069 uint64_t UnsignedChannelUpdate_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR o);
43070
43071 /**
43072  * Checks if two UnsignedChannelUpdates contain equal inner contents.
43073  * This ignores pointers and is_owned flags and looks at the values in fields.
43074  * Two objects with NULL inner values will be considered "equal" here.
43075  */
43076 bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
43077
43078 /**
43079  * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
43080  */
43081 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
43082
43083 /**
43084  * A signature of the channel update
43085  */
43086 struct LDKECDSASignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
43087
43088 /**
43089  * A signature of the channel update
43090  */
43091 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
43092
43093 /**
43094  * The actual channel update
43095  */
43096 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
43097
43098 /**
43099  * The actual channel update
43100  */
43101 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
43102
43103 /**
43104  * Constructs a new ChannelUpdate given each field
43105  */
43106 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
43107
43108 /**
43109  * Creates a copy of the ChannelUpdate
43110  */
43111 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
43112
43113 /**
43114  * Generates a non-cryptographic 64-bit hash of the ChannelUpdate.
43115  */
43116 uint64_t ChannelUpdate_hash(const struct LDKChannelUpdate *NONNULL_PTR o);
43117
43118 /**
43119  * Checks if two ChannelUpdates contain equal inner contents.
43120  * This ignores pointers and is_owned flags and looks at the values in fields.
43121  * Two objects with NULL inner values will be considered "equal" here.
43122  */
43123 bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
43124
43125 /**
43126  * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
43127  */
43128 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
43129
43130 /**
43131  * The genesis hash of the blockchain being queried
43132  */
43133 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
43134
43135 /**
43136  * The genesis hash of the blockchain being queried
43137  */
43138 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43139
43140 /**
43141  * The height of the first block for the channel UTXOs being queried
43142  */
43143 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
43144
43145 /**
43146  * The height of the first block for the channel UTXOs being queried
43147  */
43148 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
43149
43150 /**
43151  * The number of blocks to include in the query results
43152  */
43153 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
43154
43155 /**
43156  * The number of blocks to include in the query results
43157  */
43158 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
43159
43160 /**
43161  * Constructs a new QueryChannelRange given each field
43162  */
43163 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
43164
43165 /**
43166  * Creates a copy of the QueryChannelRange
43167  */
43168 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
43169
43170 /**
43171  * Generates a non-cryptographic 64-bit hash of the QueryChannelRange.
43172  */
43173 uint64_t QueryChannelRange_hash(const struct LDKQueryChannelRange *NONNULL_PTR o);
43174
43175 /**
43176  * Checks if two QueryChannelRanges contain equal inner contents.
43177  * This ignores pointers and is_owned flags and looks at the values in fields.
43178  * Two objects with NULL inner values will be considered "equal" here.
43179  */
43180 bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
43181
43182 /**
43183  * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
43184  */
43185 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
43186
43187 /**
43188  * The genesis hash of the blockchain being queried
43189  */
43190 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
43191
43192 /**
43193  * The genesis hash of the blockchain being queried
43194  */
43195 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43196
43197 /**
43198  * The height of the first block in the range of the reply
43199  */
43200 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
43201
43202 /**
43203  * The height of the first block in the range of the reply
43204  */
43205 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
43206
43207 /**
43208  * The number of blocks included in the range of the reply
43209  */
43210 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
43211
43212 /**
43213  * The number of blocks included in the range of the reply
43214  */
43215 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
43216
43217 /**
43218  * True when this is the final reply for a query
43219  */
43220 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
43221
43222 /**
43223  * True when this is the final reply for a query
43224  */
43225 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
43226
43227 /**
43228  * The `short_channel_id`s in the channel range
43229  *
43230  * Returns a copy of the field.
43231  */
43232 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
43233
43234 /**
43235  * The `short_channel_id`s in the channel range
43236  */
43237 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
43238
43239 /**
43240  * Constructs a new ReplyChannelRange given each field
43241  */
43242 MUST_USE_RES struct LDKReplyChannelRange ReplyChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg, bool sync_complete_arg, struct LDKCVec_u64Z short_channel_ids_arg);
43243
43244 /**
43245  * Creates a copy of the ReplyChannelRange
43246  */
43247 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
43248
43249 /**
43250  * Generates a non-cryptographic 64-bit hash of the ReplyChannelRange.
43251  */
43252 uint64_t ReplyChannelRange_hash(const struct LDKReplyChannelRange *NONNULL_PTR o);
43253
43254 /**
43255  * Checks if two ReplyChannelRanges contain equal inner contents.
43256  * This ignores pointers and is_owned flags and looks at the values in fields.
43257  * Two objects with NULL inner values will be considered "equal" here.
43258  */
43259 bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
43260
43261 /**
43262  * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
43263  */
43264 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
43265
43266 /**
43267  * The genesis hash of the blockchain being queried
43268  */
43269 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
43270
43271 /**
43272  * The genesis hash of the blockchain being queried
43273  */
43274 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43275
43276 /**
43277  * The short_channel_ids that are being queried
43278  *
43279  * Returns a copy of the field.
43280  */
43281 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
43282
43283 /**
43284  * The short_channel_ids that are being queried
43285  */
43286 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
43287
43288 /**
43289  * Constructs a new QueryShortChannelIds given each field
43290  */
43291 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
43292
43293 /**
43294  * Creates a copy of the QueryShortChannelIds
43295  */
43296 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
43297
43298 /**
43299  * Generates a non-cryptographic 64-bit hash of the QueryShortChannelIds.
43300  */
43301 uint64_t QueryShortChannelIds_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR o);
43302
43303 /**
43304  * Checks if two QueryShortChannelIdss contain equal inner contents.
43305  * This ignores pointers and is_owned flags and looks at the values in fields.
43306  * Two objects with NULL inner values will be considered "equal" here.
43307  */
43308 bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
43309
43310 /**
43311  * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
43312  */
43313 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
43314
43315 /**
43316  * The genesis hash of the blockchain that was queried
43317  */
43318 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
43319
43320 /**
43321  * The genesis hash of the blockchain that was queried
43322  */
43323 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43324
43325 /**
43326  * Indicates if the query recipient maintains up-to-date channel
43327  * information for the `chain_hash`
43328  */
43329 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
43330
43331 /**
43332  * Indicates if the query recipient maintains up-to-date channel
43333  * information for the `chain_hash`
43334  */
43335 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
43336
43337 /**
43338  * Constructs a new ReplyShortChannelIdsEnd given each field
43339  */
43340 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
43341
43342 /**
43343  * Creates a copy of the ReplyShortChannelIdsEnd
43344  */
43345 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
43346
43347 /**
43348  * Generates a non-cryptographic 64-bit hash of the ReplyShortChannelIdsEnd.
43349  */
43350 uint64_t ReplyShortChannelIdsEnd_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR o);
43351
43352 /**
43353  * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
43354  * This ignores pointers and is_owned flags and looks at the values in fields.
43355  * Two objects with NULL inner values will be considered "equal" here.
43356  */
43357 bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
43358
43359 /**
43360  * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
43361  */
43362 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
43363
43364 /**
43365  * The genesis hash of the blockchain for channel and node information
43366  */
43367 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
43368
43369 /**
43370  * The genesis hash of the blockchain for channel and node information
43371  */
43372 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43373
43374 /**
43375  * The starting unix timestamp
43376  */
43377 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
43378
43379 /**
43380  * The starting unix timestamp
43381  */
43382 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
43383
43384 /**
43385  * The range of information in seconds
43386  */
43387 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
43388
43389 /**
43390  * The range of information in seconds
43391  */
43392 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
43393
43394 /**
43395  * Constructs a new GossipTimestampFilter given each field
43396  */
43397 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
43398
43399 /**
43400  * Creates a copy of the GossipTimestampFilter
43401  */
43402 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
43403
43404 /**
43405  * Generates a non-cryptographic 64-bit hash of the GossipTimestampFilter.
43406  */
43407 uint64_t GossipTimestampFilter_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR o);
43408
43409 /**
43410  * Checks if two GossipTimestampFilters contain equal inner contents.
43411  * This ignores pointers and is_owned flags and looks at the values in fields.
43412  * Two objects with NULL inner values will be considered "equal" here.
43413  */
43414 bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
43415
43416 /**
43417  * Frees any resources used by the ErrorAction
43418  */
43419 void ErrorAction_free(struct LDKErrorAction this_ptr);
43420
43421 /**
43422  * Creates a copy of the ErrorAction
43423  */
43424 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
43425
43426 /**
43427  * Utility method to constructs a new DisconnectPeer-variant ErrorAction
43428  */
43429 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
43430
43431 /**
43432  * Utility method to constructs a new DisconnectPeerWithWarning-variant ErrorAction
43433  */
43434 struct LDKErrorAction ErrorAction_disconnect_peer_with_warning(struct LDKWarningMessage msg);
43435
43436 /**
43437  * Utility method to constructs a new IgnoreError-variant ErrorAction
43438  */
43439 struct LDKErrorAction ErrorAction_ignore_error(void);
43440
43441 /**
43442  * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
43443  */
43444 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
43445
43446 /**
43447  * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
43448  */
43449 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
43450
43451 /**
43452  * Utility method to constructs a new SendErrorMessage-variant ErrorAction
43453  */
43454 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
43455
43456 /**
43457  * Utility method to constructs a new SendWarningMessage-variant ErrorAction
43458  */
43459 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
43460
43461 /**
43462  * Generates a non-cryptographic 64-bit hash of the ErrorAction.
43463  */
43464 uint64_t ErrorAction_hash(const struct LDKErrorAction *NONNULL_PTR o);
43465
43466 /**
43467  * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
43468  */
43469 void LightningError_free(struct LDKLightningError this_obj);
43470
43471 /**
43472  * A human-readable message describing the error
43473  */
43474 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
43475
43476 /**
43477  * A human-readable message describing the error
43478  */
43479 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
43480
43481 /**
43482  * The action which should be taken against the offending peer.
43483  */
43484 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
43485
43486 /**
43487  * The action which should be taken against the offending peer.
43488  */
43489 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
43490
43491 /**
43492  * Constructs a new LightningError given each field
43493  */
43494 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
43495
43496 /**
43497  * Creates a copy of the LightningError
43498  */
43499 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
43500
43501 /**
43502  * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
43503  */
43504 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
43505
43506 /**
43507  * `update_add_htlc` messages which should be sent
43508  */
43509 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
43510
43511 /**
43512  * `update_add_htlc` messages which should be sent
43513  */
43514 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
43515
43516 /**
43517  * `update_fulfill_htlc` messages which should be sent
43518  */
43519 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
43520
43521 /**
43522  * `update_fulfill_htlc` messages which should be sent
43523  */
43524 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
43525
43526 /**
43527  * `update_fail_htlc` messages which should be sent
43528  */
43529 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
43530
43531 /**
43532  * `update_fail_htlc` messages which should be sent
43533  */
43534 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
43535
43536 /**
43537  * `update_fail_malformed_htlc` messages which should be sent
43538  */
43539 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
43540
43541 /**
43542  * `update_fail_malformed_htlc` messages which should be sent
43543  */
43544 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
43545
43546 /**
43547  * An `update_fee` message which should be sent
43548  *
43549  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43550  */
43551 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
43552
43553 /**
43554  * An `update_fee` message which should be sent
43555  *
43556  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
43557  */
43558 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
43559
43560 /**
43561  * A `commitment_signed` message which should be sent
43562  */
43563 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
43564
43565 /**
43566  * A `commitment_signed` message which should be sent
43567  */
43568 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
43569
43570 /**
43571  * Constructs a new CommitmentUpdate given each field
43572  *
43573  * Note that update_fee_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
43574  */
43575 MUST_USE_RES struct LDKCommitmentUpdate CommitmentUpdate_new(struct LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg, struct LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg, struct LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg, struct LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg, struct LDKUpdateFee update_fee_arg, struct LDKCommitmentSigned commitment_signed_arg);
43576
43577 /**
43578  * Creates a copy of the CommitmentUpdate
43579  */
43580 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
43581
43582 /**
43583  * Generates a non-cryptographic 64-bit hash of the CommitmentUpdate.
43584  */
43585 uint64_t CommitmentUpdate_hash(const struct LDKCommitmentUpdate *NONNULL_PTR o);
43586
43587 /**
43588  * Checks if two CommitmentUpdates contain equal inner contents.
43589  * This ignores pointers and is_owned flags and looks at the values in fields.
43590  * Two objects with NULL inner values will be considered "equal" here.
43591  */
43592 bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
43593
43594 /**
43595  * Calls the free function if one is set
43596  */
43597 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
43598
43599 /**
43600  * Calls the free function if one is set
43601  */
43602 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
43603
43604 /**
43605  * Calls the free function if one is set
43606  */
43607 void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
43608
43609 /**
43610  * Frees any resources used by the FinalOnionHopData, if is_owned is set and inner is non-NULL.
43611  */
43612 void FinalOnionHopData_free(struct LDKFinalOnionHopData this_obj);
43613
43614 /**
43615  * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
43616  * Because it is generated by the recipient and included in the invoice, it also provides
43617  * proof to the recipient that the payment was sent by someone with the generated invoice.
43618  */
43619 const uint8_t (*FinalOnionHopData_get_payment_secret(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr))[32];
43620
43621 /**
43622  * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
43623  * Because it is generated by the recipient and included in the invoice, it also provides
43624  * proof to the recipient that the payment was sent by someone with the generated invoice.
43625  */
43626 void FinalOnionHopData_set_payment_secret(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43627
43628 /**
43629  * The intended total amount that this payment is for.
43630  *
43631  * Message serialization may panic if this value is more than 21 million Bitcoin.
43632  */
43633 uint64_t FinalOnionHopData_get_total_msat(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr);
43634
43635 /**
43636  * The intended total amount that this payment is for.
43637  *
43638  * Message serialization may panic if this value is more than 21 million Bitcoin.
43639  */
43640 void FinalOnionHopData_set_total_msat(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, uint64_t val);
43641
43642 /**
43643  * Constructs a new FinalOnionHopData given each field
43644  */
43645 MUST_USE_RES struct LDKFinalOnionHopData FinalOnionHopData_new(struct LDKThirtyTwoBytes payment_secret_arg, uint64_t total_msat_arg);
43646
43647 /**
43648  * Creates a copy of the FinalOnionHopData
43649  */
43650 struct LDKFinalOnionHopData FinalOnionHopData_clone(const struct LDKFinalOnionHopData *NONNULL_PTR orig);
43651
43652 /**
43653  * Frees any resources used by the OnionPacket, if is_owned is set and inner is non-NULL.
43654  */
43655 void OnionPacket_free(struct LDKOnionPacket this_obj);
43656
43657 /**
43658  * BOLT 4 version number.
43659  */
43660 uint8_t OnionPacket_get_version(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
43661
43662 /**
43663  * BOLT 4 version number.
43664  */
43665 void OnionPacket_set_version(struct LDKOnionPacket *NONNULL_PTR this_ptr, uint8_t val);
43666
43667 /**
43668  * In order to ensure we always return an error on onion decode in compliance with [BOLT
43669  * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
43670  * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
43671  * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
43672  * like.
43673  *
43674  * Returns a copy of the field.
43675  */
43676 struct LDKCResult_PublicKeySecp256k1ErrorZ OnionPacket_get_public_key(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
43677
43678 /**
43679  * In order to ensure we always return an error on onion decode in compliance with [BOLT
43680  * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
43681  * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
43682  * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
43683  * like.
43684  */
43685 void OnionPacket_set_public_key(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKCResult_PublicKeySecp256k1ErrorZ val);
43686
43687 /**
43688  * HMAC to verify the integrity of hop_data.
43689  */
43690 const uint8_t (*OnionPacket_get_hmac(const struct LDKOnionPacket *NONNULL_PTR this_ptr))[32];
43691
43692 /**
43693  * HMAC to verify the integrity of hop_data.
43694  */
43695 void OnionPacket_set_hmac(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43696
43697 /**
43698  * Creates a copy of the OnionPacket
43699  */
43700 struct LDKOnionPacket OnionPacket_clone(const struct LDKOnionPacket *NONNULL_PTR orig);
43701
43702 /**
43703  * Generates a non-cryptographic 64-bit hash of the OnionPacket.
43704  */
43705 uint64_t OnionPacket_hash(const struct LDKOnionPacket *NONNULL_PTR o);
43706
43707 /**
43708  * Checks if two OnionPackets contain equal inner contents.
43709  * This ignores pointers and is_owned flags and looks at the values in fields.
43710  * Two objects with NULL inner values will be considered "equal" here.
43711  */
43712 bool OnionPacket_eq(const struct LDKOnionPacket *NONNULL_PTR a, const struct LDKOnionPacket *NONNULL_PTR b);
43713
43714 /**
43715  * Frees any resources used by the TrampolineOnionPacket, if is_owned is set and inner is non-NULL.
43716  */
43717 void TrampolineOnionPacket_free(struct LDKTrampolineOnionPacket this_obj);
43718
43719 /**
43720  * Bolt 04 version number
43721  */
43722 uint8_t TrampolineOnionPacket_get_version(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
43723
43724 /**
43725  * Bolt 04 version number
43726  */
43727 void TrampolineOnionPacket_set_version(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, uint8_t val);
43728
43729 /**
43730  * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
43731  */
43732 struct LDKPublicKey TrampolineOnionPacket_get_public_key(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
43733
43734 /**
43735  * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
43736  */
43737 void TrampolineOnionPacket_set_public_key(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43738
43739 /**
43740  * Encrypted payload for the next hop
43741  *
43742  * Returns a copy of the field.
43743  */
43744 struct LDKCVec_u8Z TrampolineOnionPacket_get_hop_data(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
43745
43746 /**
43747  * Encrypted payload for the next hop
43748  */
43749 void TrampolineOnionPacket_set_hop_data(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
43750
43751 /**
43752  * HMAC to verify the integrity of hop_data
43753  */
43754 const uint8_t (*TrampolineOnionPacket_get_hmac(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr))[32];
43755
43756 /**
43757  * HMAC to verify the integrity of hop_data
43758  */
43759 void TrampolineOnionPacket_set_hmac(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43760
43761 /**
43762  * Constructs a new TrampolineOnionPacket given each field
43763  */
43764 MUST_USE_RES struct LDKTrampolineOnionPacket TrampolineOnionPacket_new(uint8_t version_arg, struct LDKPublicKey public_key_arg, struct LDKCVec_u8Z hop_data_arg, struct LDKThirtyTwoBytes hmac_arg);
43765
43766 /**
43767  * Creates a copy of the TrampolineOnionPacket
43768  */
43769 struct LDKTrampolineOnionPacket TrampolineOnionPacket_clone(const struct LDKTrampolineOnionPacket *NONNULL_PTR orig);
43770
43771 /**
43772  * Generates a non-cryptographic 64-bit hash of the TrampolineOnionPacket.
43773  */
43774 uint64_t TrampolineOnionPacket_hash(const struct LDKTrampolineOnionPacket *NONNULL_PTR o);
43775
43776 /**
43777  * Checks if two TrampolineOnionPackets contain equal inner contents.
43778  * This ignores pointers and is_owned flags and looks at the values in fields.
43779  * Two objects with NULL inner values will be considered "equal" here.
43780  */
43781 bool TrampolineOnionPacket_eq(const struct LDKTrampolineOnionPacket *NONNULL_PTR a, const struct LDKTrampolineOnionPacket *NONNULL_PTR b);
43782
43783 /**
43784  * Serialize the TrampolineOnionPacket object into a byte array which can be read by TrampolineOnionPacket_read
43785  */
43786 struct LDKCVec_u8Z TrampolineOnionPacket_write(const struct LDKTrampolineOnionPacket *NONNULL_PTR obj);
43787
43788 /**
43789  * Get the string representation of a DecodeError object
43790  */
43791 struct LDKStr DecodeError_to_str(const struct LDKDecodeError *NONNULL_PTR o);
43792
43793 /**
43794  * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
43795  */
43796 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
43797
43798 /**
43799  * Read a AcceptChannel from a byte array, created by AcceptChannel_write
43800  */
43801 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
43802
43803 /**
43804  * Serialize the AcceptChannelV2 object into a byte array which can be read by AcceptChannelV2_read
43805  */
43806 struct LDKCVec_u8Z AcceptChannelV2_write(const struct LDKAcceptChannelV2 *NONNULL_PTR obj);
43807
43808 /**
43809  * Read a AcceptChannelV2 from a byte array, created by AcceptChannelV2_write
43810  */
43811 struct LDKCResult_AcceptChannelV2DecodeErrorZ AcceptChannelV2_read(struct LDKu8slice ser);
43812
43813 /**
43814  * Serialize the Stfu object into a byte array which can be read by Stfu_read
43815  */
43816 struct LDKCVec_u8Z Stfu_write(const struct LDKStfu *NONNULL_PTR obj);
43817
43818 /**
43819  * Read a Stfu from a byte array, created by Stfu_write
43820  */
43821 struct LDKCResult_StfuDecodeErrorZ Stfu_read(struct LDKu8slice ser);
43822
43823 /**
43824  * Serialize the Splice object into a byte array which can be read by Splice_read
43825  */
43826 struct LDKCVec_u8Z Splice_write(const struct LDKSplice *NONNULL_PTR obj);
43827
43828 /**
43829  * Read a Splice from a byte array, created by Splice_write
43830  */
43831 struct LDKCResult_SpliceDecodeErrorZ Splice_read(struct LDKu8slice ser);
43832
43833 /**
43834  * Serialize the SpliceAck object into a byte array which can be read by SpliceAck_read
43835  */
43836 struct LDKCVec_u8Z SpliceAck_write(const struct LDKSpliceAck *NONNULL_PTR obj);
43837
43838 /**
43839  * Read a SpliceAck from a byte array, created by SpliceAck_write
43840  */
43841 struct LDKCResult_SpliceAckDecodeErrorZ SpliceAck_read(struct LDKu8slice ser);
43842
43843 /**
43844  * Serialize the SpliceLocked object into a byte array which can be read by SpliceLocked_read
43845  */
43846 struct LDKCVec_u8Z SpliceLocked_write(const struct LDKSpliceLocked *NONNULL_PTR obj);
43847
43848 /**
43849  * Read a SpliceLocked from a byte array, created by SpliceLocked_write
43850  */
43851 struct LDKCResult_SpliceLockedDecodeErrorZ SpliceLocked_read(struct LDKu8slice ser);
43852
43853 /**
43854  * Serialize the TxAddInput object into a byte array which can be read by TxAddInput_read
43855  */
43856 struct LDKCVec_u8Z TxAddInput_write(const struct LDKTxAddInput *NONNULL_PTR obj);
43857
43858 /**
43859  * Read a TxAddInput from a byte array, created by TxAddInput_write
43860  */
43861 struct LDKCResult_TxAddInputDecodeErrorZ TxAddInput_read(struct LDKu8slice ser);
43862
43863 /**
43864  * Serialize the TxAddOutput object into a byte array which can be read by TxAddOutput_read
43865  */
43866 struct LDKCVec_u8Z TxAddOutput_write(const struct LDKTxAddOutput *NONNULL_PTR obj);
43867
43868 /**
43869  * Read a TxAddOutput from a byte array, created by TxAddOutput_write
43870  */
43871 struct LDKCResult_TxAddOutputDecodeErrorZ TxAddOutput_read(struct LDKu8slice ser);
43872
43873 /**
43874  * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
43875  */
43876 struct LDKCVec_u8Z TxRemoveInput_write(const struct LDKTxRemoveInput *NONNULL_PTR obj);
43877
43878 /**
43879  * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
43880  */
43881 struct LDKCResult_TxRemoveInputDecodeErrorZ TxRemoveInput_read(struct LDKu8slice ser);
43882
43883 /**
43884  * Serialize the TxRemoveOutput object into a byte array which can be read by TxRemoveOutput_read
43885  */
43886 struct LDKCVec_u8Z TxRemoveOutput_write(const struct LDKTxRemoveOutput *NONNULL_PTR obj);
43887
43888 /**
43889  * Read a TxRemoveOutput from a byte array, created by TxRemoveOutput_write
43890  */
43891 struct LDKCResult_TxRemoveOutputDecodeErrorZ TxRemoveOutput_read(struct LDKu8slice ser);
43892
43893 /**
43894  * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
43895  */
43896 struct LDKCVec_u8Z TxComplete_write(const struct LDKTxComplete *NONNULL_PTR obj);
43897
43898 /**
43899  * Read a TxComplete from a byte array, created by TxComplete_write
43900  */
43901 struct LDKCResult_TxCompleteDecodeErrorZ TxComplete_read(struct LDKu8slice ser);
43902
43903 /**
43904  * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read
43905  */
43906 struct LDKCVec_u8Z TxSignatures_write(const struct LDKTxSignatures *NONNULL_PTR obj);
43907
43908 /**
43909  * Read a TxSignatures from a byte array, created by TxSignatures_write
43910  */
43911 struct LDKCResult_TxSignaturesDecodeErrorZ TxSignatures_read(struct LDKu8slice ser);
43912
43913 /**
43914  * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
43915  */
43916 struct LDKCVec_u8Z TxInitRbf_write(const struct LDKTxInitRbf *NONNULL_PTR obj);
43917
43918 /**
43919  * Read a TxInitRbf from a byte array, created by TxInitRbf_write
43920  */
43921 struct LDKCResult_TxInitRbfDecodeErrorZ TxInitRbf_read(struct LDKu8slice ser);
43922
43923 /**
43924  * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
43925  */
43926 struct LDKCVec_u8Z TxAckRbf_write(const struct LDKTxAckRbf *NONNULL_PTR obj);
43927
43928 /**
43929  * Read a TxAckRbf from a byte array, created by TxAckRbf_write
43930  */
43931 struct LDKCResult_TxAckRbfDecodeErrorZ TxAckRbf_read(struct LDKu8slice ser);
43932
43933 /**
43934  * Serialize the TxAbort object into a byte array which can be read by TxAbort_read
43935  */
43936 struct LDKCVec_u8Z TxAbort_write(const struct LDKTxAbort *NONNULL_PTR obj);
43937
43938 /**
43939  * Read a TxAbort from a byte array, created by TxAbort_write
43940  */
43941 struct LDKCResult_TxAbortDecodeErrorZ TxAbort_read(struct LDKu8slice ser);
43942
43943 /**
43944  * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
43945  */
43946 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
43947
43948 /**
43949  * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
43950  */
43951 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
43952
43953 /**
43954  * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
43955  */
43956 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
43957
43958 /**
43959  * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
43960  */
43961 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
43962
43963 /**
43964  * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
43965  */
43966 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
43967
43968 /**
43969  * Read a ClosingSigned from a byte array, created by ClosingSigned_write
43970  */
43971 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
43972
43973 /**
43974  * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
43975  */
43976 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
43977
43978 /**
43979  * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
43980  */
43981 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
43982
43983 /**
43984  * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
43985  */
43986 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
43987
43988 /**
43989  * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
43990  */
43991 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
43992
43993 /**
43994  * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
43995  */
43996 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
43997
43998 /**
43999  * Read a FundingCreated from a byte array, created by FundingCreated_write
44000  */
44001 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
44002
44003 /**
44004  * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
44005  */
44006 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
44007
44008 /**
44009  * Read a FundingSigned from a byte array, created by FundingSigned_write
44010  */
44011 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
44012
44013 /**
44014  * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
44015  */
44016 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
44017
44018 /**
44019  * Read a ChannelReady from a byte array, created by ChannelReady_write
44020  */
44021 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
44022
44023 /**
44024  * Serialize the Init object into a byte array which can be read by Init_read
44025  */
44026 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
44027
44028 /**
44029  * Read a Init from a byte array, created by Init_write
44030  */
44031 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
44032
44033 /**
44034  * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
44035  */
44036 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
44037
44038 /**
44039  * Read a OpenChannel from a byte array, created by OpenChannel_write
44040  */
44041 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
44042
44043 /**
44044  * Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read
44045  */
44046 struct LDKCVec_u8Z OpenChannelV2_write(const struct LDKOpenChannelV2 *NONNULL_PTR obj);
44047
44048 /**
44049  * Read a OpenChannelV2 from a byte array, created by OpenChannelV2_write
44050  */
44051 struct LDKCResult_OpenChannelV2DecodeErrorZ OpenChannelV2_read(struct LDKu8slice ser);
44052
44053 /**
44054  * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
44055  */
44056 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
44057
44058 /**
44059  * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
44060  */
44061 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
44062
44063 /**
44064  * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
44065  */
44066 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
44067
44068 /**
44069  * Read a Shutdown from a byte array, created by Shutdown_write
44070  */
44071 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
44072
44073 /**
44074  * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
44075  */
44076 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
44077
44078 /**
44079  * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
44080  */
44081 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
44082
44083 /**
44084  * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
44085  */
44086 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
44087
44088 /**
44089  * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
44090  */
44091 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
44092
44093 /**
44094  * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
44095  */
44096 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
44097
44098 /**
44099  * Read a UpdateFee from a byte array, created by UpdateFee_write
44100  */
44101 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
44102
44103 /**
44104  * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
44105  */
44106 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
44107
44108 /**
44109  * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
44110  */
44111 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
44112
44113 /**
44114  * Serialize the OnionPacket object into a byte array which can be read by OnionPacket_read
44115  */
44116 struct LDKCVec_u8Z OnionPacket_write(const struct LDKOnionPacket *NONNULL_PTR obj);
44117
44118 /**
44119  * Read a OnionPacket from a byte array, created by OnionPacket_write
44120  */
44121 struct LDKCResult_OnionPacketDecodeErrorZ OnionPacket_read(struct LDKu8slice ser);
44122
44123 /**
44124  * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
44125  */
44126 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
44127
44128 /**
44129  * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
44130  */
44131 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
44132
44133 /**
44134  * Read a OnionMessage from a byte array, created by OnionMessage_write
44135  */
44136 struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
44137
44138 /**
44139  * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
44140  */
44141 struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
44142
44143 /**
44144  * Serialize the FinalOnionHopData object into a byte array which can be read by FinalOnionHopData_read
44145  */
44146 struct LDKCVec_u8Z FinalOnionHopData_write(const struct LDKFinalOnionHopData *NONNULL_PTR obj);
44147
44148 /**
44149  * Read a FinalOnionHopData from a byte array, created by FinalOnionHopData_write
44150  */
44151 struct LDKCResult_FinalOnionHopDataDecodeErrorZ FinalOnionHopData_read(struct LDKu8slice ser);
44152
44153 /**
44154  * Serialize the Ping object into a byte array which can be read by Ping_read
44155  */
44156 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
44157
44158 /**
44159  * Read a Ping from a byte array, created by Ping_write
44160  */
44161 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
44162
44163 /**
44164  * Serialize the Pong object into a byte array which can be read by Pong_read
44165  */
44166 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
44167
44168 /**
44169  * Read a Pong from a byte array, created by Pong_write
44170  */
44171 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
44172
44173 /**
44174  * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
44175  */
44176 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
44177
44178 /**
44179  * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
44180  */
44181 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
44182
44183 /**
44184  * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
44185  */
44186 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
44187
44188 /**
44189  * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
44190  */
44191 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
44192
44193 /**
44194  * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
44195  */
44196 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
44197
44198 /**
44199  * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
44200  */
44201 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
44202
44203 /**
44204  * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
44205  */
44206 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
44207
44208 /**
44209  * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
44210  */
44211 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
44212
44213 /**
44214  * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
44215  */
44216 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
44217
44218 /**
44219  * Read a ErrorMessage from a byte array, created by ErrorMessage_write
44220  */
44221 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
44222
44223 /**
44224  * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
44225  */
44226 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
44227
44228 /**
44229  * Read a WarningMessage from a byte array, created by WarningMessage_write
44230  */
44231 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
44232
44233 /**
44234  * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
44235  */
44236 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
44237
44238 /**
44239  * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
44240  */
44241 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
44242
44243 /**
44244  * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
44245  */
44246 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
44247
44248 /**
44249  * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
44250  */
44251 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
44252
44253 /**
44254  * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
44255  */
44256 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
44257
44258 /**
44259  * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
44260  */
44261 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
44262
44263 /**
44264  * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
44265  */
44266 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
44267
44268 /**
44269  * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
44270  */
44271 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
44272
44273 /**
44274  * Calculates the overflow safe ending block height for the query.
44275  *
44276  * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`.
44277  */
44278 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
44279
44280 /**
44281  * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
44282  */
44283 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
44284
44285 /**
44286  * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
44287  */
44288 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
44289
44290 /**
44291  * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
44292  */
44293 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
44294
44295 /**
44296  * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
44297  */
44298 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
44299
44300 /**
44301  * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
44302  */
44303 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
44304
44305 /**
44306  * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
44307  */
44308 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
44309
44310 /**
44311  * Calls the free function if one is set
44312  */
44313 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
44314
44315 /**
44316  * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
44317  */
44318 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
44319
44320 /**
44321  * Constructs a new IgnoringMessageHandler given each field
44322  */
44323 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
44324
44325 /**
44326  * Constructs a new EventsProvider which calls the relevant methods on this_arg.
44327  * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
44328  */
44329 struct LDKEventsProvider IgnoringMessageHandler_as_EventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
44330
44331 /**
44332  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
44333  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
44334  */
44335 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
44336
44337 /**
44338  * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
44339  * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
44340  */
44341 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
44342
44343 /**
44344  * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
44345  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
44346  */
44347 struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
44348
44349 /**
44350  * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
44351  * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
44352  */
44353 struct LDKOffersMessageHandler IgnoringMessageHandler_as_OffersMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
44354
44355 /**
44356  * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
44357  * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
44358  */
44359 struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
44360
44361 /**
44362  * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
44363  * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
44364  */
44365 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
44366
44367 /**
44368  * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
44369  * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
44370  */
44371 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
44372
44373 /**
44374  * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
44375  */
44376 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
44377
44378 /**
44379  * Constructs a new ErroringMessageHandler
44380  */
44381 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
44382
44383 /**
44384  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
44385  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
44386  */
44387 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
44388
44389 /**
44390  * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
44391  * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
44392  */
44393 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
44394
44395 /**
44396  * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
44397  */
44398 void MessageHandler_free(struct LDKMessageHandler this_obj);
44399
44400 /**
44401  * A message handler which handles messages specific to channels. Usually this is just a
44402  * [`ChannelManager`] object or an [`ErroringMessageHandler`].
44403  *
44404  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
44405  */
44406 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
44407
44408 /**
44409  * A message handler which handles messages specific to channels. Usually this is just a
44410  * [`ChannelManager`] object or an [`ErroringMessageHandler`].
44411  *
44412  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
44413  */
44414 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
44415
44416 /**
44417  * A message handler which handles messages updating our knowledge of the network channel
44418  * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
44419  *
44420  * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
44421  */
44422 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
44423
44424 /**
44425  * A message handler which handles messages updating our knowledge of the network channel
44426  * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
44427  *
44428  * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
44429  */
44430 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
44431
44432 /**
44433  * A message handler which handles onion messages. This should generally be an
44434  * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
44435  *
44436  * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
44437  */
44438 const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
44439
44440 /**
44441  * A message handler which handles onion messages. This should generally be an
44442  * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
44443  *
44444  * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
44445  */
44446 void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
44447
44448 /**
44449  * A message handler which handles custom messages. The only LDK-provided implementation is
44450  * [`IgnoringMessageHandler`].
44451  */
44452 const struct LDKCustomMessageHandler *MessageHandler_get_custom_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
44453
44454 /**
44455  * A message handler which handles custom messages. The only LDK-provided implementation is
44456  * [`IgnoringMessageHandler`].
44457  */
44458 void MessageHandler_set_custom_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKCustomMessageHandler val);
44459
44460 /**
44461  * Constructs a new MessageHandler given each field
44462  */
44463 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg, struct LDKOnionMessageHandler onion_message_handler_arg, struct LDKCustomMessageHandler custom_message_handler_arg);
44464
44465 /**
44466  * Creates a copy of a SocketDescriptor
44467  */
44468 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
44469
44470 /**
44471  * Calls the free function if one is set
44472  */
44473 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
44474
44475 /**
44476  * Frees any resources used by the PeerDetails, if is_owned is set and inner is non-NULL.
44477  */
44478 void PeerDetails_free(struct LDKPeerDetails this_obj);
44479
44480 /**
44481  * The node id of the peer.
44482  *
44483  * For outbound connections, this [`PublicKey`] will be the same as the `their_node_id` parameter
44484  * passed in to [`PeerManager::new_outbound_connection`].
44485  */
44486 struct LDKPublicKey PeerDetails_get_counterparty_node_id(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
44487
44488 /**
44489  * The node id of the peer.
44490  *
44491  * For outbound connections, this [`PublicKey`] will be the same as the `their_node_id` parameter
44492  * passed in to [`PeerManager::new_outbound_connection`].
44493  */
44494 void PeerDetails_set_counterparty_node_id(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44495
44496 /**
44497  * The socket address the peer provided in the initial handshake.
44498  *
44499  * Will only be `Some` if an address had been previously provided to
44500  * [`PeerManager::new_outbound_connection`] or [`PeerManager::new_inbound_connection`].
44501  *
44502  * Returns a copy of the field.
44503  */
44504 struct LDKCOption_SocketAddressZ PeerDetails_get_socket_address(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
44505
44506 /**
44507  * The socket address the peer provided in the initial handshake.
44508  *
44509  * Will only be `Some` if an address had been previously provided to
44510  * [`PeerManager::new_outbound_connection`] or [`PeerManager::new_inbound_connection`].
44511  */
44512 void PeerDetails_set_socket_address(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
44513
44514 /**
44515  * The features the peer provided in the initial handshake.
44516  */
44517 struct LDKInitFeatures PeerDetails_get_init_features(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
44518
44519 /**
44520  * The features the peer provided in the initial handshake.
44521  */
44522 void PeerDetails_set_init_features(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
44523
44524 /**
44525  * Indicates the direction of the peer connection.
44526  *
44527  * Will be `true` for inbound connections, and `false` for outbound connections.
44528  */
44529 bool PeerDetails_get_is_inbound_connection(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
44530
44531 /**
44532  * Indicates the direction of the peer connection.
44533  *
44534  * Will be `true` for inbound connections, and `false` for outbound connections.
44535  */
44536 void PeerDetails_set_is_inbound_connection(struct LDKPeerDetails *NONNULL_PTR this_ptr, bool val);
44537
44538 /**
44539  * Constructs a new PeerDetails given each field
44540  */
44541 MUST_USE_RES struct LDKPeerDetails PeerDetails_new(struct LDKPublicKey counterparty_node_id_arg, struct LDKCOption_SocketAddressZ socket_address_arg, struct LDKInitFeatures init_features_arg, bool is_inbound_connection_arg);
44542
44543 /**
44544  * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
44545  */
44546 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
44547
44548 /**
44549  * Constructs a new PeerHandleError given each field
44550  */
44551 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void);
44552
44553 /**
44554  * Creates a copy of the PeerHandleError
44555  */
44556 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
44557
44558 /**
44559  * Get the string representation of a PeerHandleError object
44560  */
44561 struct LDKStr PeerHandleError_to_str(const struct LDKPeerHandleError *NONNULL_PTR o);
44562
44563 /**
44564  * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
44565  */
44566 void PeerManager_free(struct LDKPeerManager this_obj);
44567
44568 /**
44569  * Constructs a new `PeerManager` with the given message handlers.
44570  *
44571  * `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
44572  * cryptographically secure random bytes.
44573  *
44574  * `current_time` is used as an always-increasing counter that survives across restarts and is
44575  * incremented irregularly internally. In general it is best to simply use the current UNIX
44576  * timestamp, however if it is not available a persistent counter that increases once per
44577  * minute should suffice.
44578  */
44579 MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, uint32_t current_time, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKNodeSigner node_signer);
44580
44581 /**
44582  * Returns a list of [`PeerDetails`] for connected peers that have completed the initial
44583  * handshake.
44584  */
44585 MUST_USE_RES struct LDKCVec_PeerDetailsZ PeerManager_list_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
44586
44587 /**
44588  * Returns the [`PeerDetails`] of a connected peer that has completed the initial handshake.
44589  *
44590  * Will return `None` if the peer is unknown or it hasn't completed the initial handshake.
44591  *
44592  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44593  */
44594 MUST_USE_RES struct LDKPeerDetails PeerManager_peer_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id);
44595
44596 /**
44597  * Indicates a new outbound connection has been established to a node with the given `node_id`
44598  * and an optional remote network address.
44599  *
44600  * The remote network address adds the option to report a remote IP address back to a connecting
44601  * peer using the init message.
44602  * The user should pass the remote network address of the host they are connected to.
44603  *
44604  * If an `Err` is returned here you must disconnect the connection immediately.
44605  *
44606  * Returns a small number of bytes to send to the remote node (currently always 50).
44607  *
44608  * Panics if descriptor is duplicative with some other descriptor which has not yet been
44609  * [`socket_disconnected`].
44610  *
44611  * [`socket_disconnected`]: PeerManager::socket_disconnected
44612  */
44613 MUST_USE_RES struct LDKCResult_CVec_u8ZPeerHandleErrorZ PeerManager_new_outbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKSocketDescriptor descriptor, struct LDKCOption_SocketAddressZ remote_network_address);
44614
44615 /**
44616  * Indicates a new inbound connection has been established to a node with an optional remote
44617  * network address.
44618  *
44619  * The remote network address adds the option to report a remote IP address back to a connecting
44620  * peer using the init message.
44621  * The user should pass the remote network address of the host they are connected to.
44622  *
44623  * May refuse the connection by returning an Err, but will never write bytes to the remote end
44624  * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
44625  * the connection immediately.
44626  *
44627  * Panics if descriptor is duplicative with some other descriptor which has not yet been
44628  * [`socket_disconnected`].
44629  *
44630  * [`socket_disconnected`]: PeerManager::socket_disconnected
44631  */
44632 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor, struct LDKCOption_SocketAddressZ remote_network_address);
44633
44634 /**
44635  * Indicates that there is room to write data to the given socket descriptor.
44636  *
44637  * May return an Err to indicate that the connection should be closed.
44638  *
44639  * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
44640  * returning. Thus, be very careful with reentrancy issues! The invariants around calling
44641  * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
44642  * ready to call [`write_buffer_space_avail`] again if a write call generated here isn't
44643  * sufficient!
44644  *
44645  * [`send_data`]: SocketDescriptor::send_data
44646  * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
44647  */
44648 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
44649
44650 /**
44651  * Indicates that data was read from the given socket descriptor.
44652  *
44653  * May return an Err to indicate that the connection should be closed.
44654  *
44655  * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
44656  * Thus, however, you should call [`process_events`] after any `read_event` to generate
44657  * [`send_data`] calls to handle responses.
44658  *
44659  * If `Ok(true)` is returned, further read_events should not be triggered until a
44660  * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
44661  * send buffer).
44662  *
44663  * In order to avoid processing too many messages at once per peer, `data` should be on the
44664  * order of 4KiB.
44665  *
44666  * [`send_data`]: SocketDescriptor::send_data
44667  * [`process_events`]: PeerManager::process_events
44668  */
44669 MUST_USE_RES struct LDKCResult_boolPeerHandleErrorZ PeerManager_read_event(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR peer_descriptor, struct LDKu8slice data);
44670
44671 /**
44672  * Checks for any events generated by our handlers and processes them. Includes sending most
44673  * response messages as well as messages generated by calls to handler functions directly (eg
44674  * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
44675  *
44676  * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
44677  * issues!
44678  *
44679  * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
44680  * or one of the other clients provided in our language bindings.
44681  *
44682  * Note that if there are any other calls to this function waiting on lock(s) this may return
44683  * without doing any work. All available events that need handling will be handled before the
44684  * other calls return.
44685  *
44686  * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
44687  * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
44688  * [`send_data`]: SocketDescriptor::send_data
44689  */
44690 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
44691
44692 /**
44693  * Indicates that the given socket descriptor's connection is now closed.
44694  */
44695 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
44696
44697 /**
44698  * Disconnect a peer given its node id.
44699  *
44700  * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
44701  * peer. Thus, be very careful about reentrancy issues.
44702  *
44703  * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
44704  */
44705 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
44706
44707 /**
44708  * Disconnects all currently-connected peers. This is useful on platforms where there may be
44709  * an indication that TCP sockets have stalled even if we weren't around to time them out
44710  * using regular ping/pongs.
44711  */
44712 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
44713
44714 /**
44715  * Send pings to each peer and disconnect those which did not respond to the last round of
44716  * pings.
44717  *
44718  * This may be called on any timescale you want, however, roughly once every ten seconds is
44719  * preferred. The call rate determines both how often we send a ping to our peers and how much
44720  * time they have to respond before we disconnect them.
44721  *
44722  * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
44723  * issues!
44724  *
44725  * [`send_data`]: SocketDescriptor::send_data
44726  */
44727 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
44728
44729 /**
44730  * Generates a signed node_announcement from the given arguments, sending it to all connected
44731  * peers. Note that peers will likely ignore this message unless we have at least one public
44732  * channel which has at least six confirmations on-chain.
44733  *
44734  * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
44735  * node to humans. They carry no in-protocol meaning.
44736  *
44737  * `addresses` represent the set (possibly empty) of socket addresses on which this node
44738  * accepts incoming connections. These will be included in the node_announcement, publicly
44739  * tying these addresses together and to this node. If you wish to preserve user privacy,
44740  * addresses should likely contain only Tor Onion addresses.
44741  *
44742  * Panics if `addresses` is absurdly large (more than 100).
44743  *
44744  * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
44745  */
44746 void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_SocketAddressZ addresses);
44747
44748 /**
44749  * Gets the weight for an HTLC-Success transaction.
44750  */
44751 uint64_t htlc_success_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
44752
44753 /**
44754  * Gets the weight for an HTLC-Timeout transaction.
44755  */
44756 uint64_t htlc_timeout_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
44757
44758 /**
44759  * Creates a copy of the HTLCClaim
44760  */
44761 enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig);
44762
44763 /**
44764  * Utility method to constructs a new OfferedTimeout-variant HTLCClaim
44765  */
44766 enum LDKHTLCClaim HTLCClaim_offered_timeout(void);
44767
44768 /**
44769  * Utility method to constructs a new OfferedPreimage-variant HTLCClaim
44770  */
44771 enum LDKHTLCClaim HTLCClaim_offered_preimage(void);
44772
44773 /**
44774  * Utility method to constructs a new AcceptedTimeout-variant HTLCClaim
44775  */
44776 enum LDKHTLCClaim HTLCClaim_accepted_timeout(void);
44777
44778 /**
44779  * Utility method to constructs a new AcceptedPreimage-variant HTLCClaim
44780  */
44781 enum LDKHTLCClaim HTLCClaim_accepted_preimage(void);
44782
44783 /**
44784  * Utility method to constructs a new Revocation-variant HTLCClaim
44785  */
44786 enum LDKHTLCClaim HTLCClaim_revocation(void);
44787
44788 /**
44789  * Checks if two HTLCClaims contain equal inner contents.
44790  * This ignores pointers and is_owned flags and looks at the values in fields.
44791  */
44792 bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b);
44793
44794 /**
44795  * Check if a given input witness attempts to claim a HTLC.
44796  */
44797 MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness);
44798
44799 /**
44800  * Build the commitment secret from the seed and the commitment number
44801  */
44802 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
44803
44804 /**
44805  * Build a closing transaction
44806  */
44807 struct LDKTransaction build_closing_transaction(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint);
44808
44809 /**
44810  * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
44811  */
44812 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
44813
44814 /**
44815  * Creates a copy of the CounterpartyCommitmentSecrets
44816  */
44817 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
44818
44819 /**
44820  * Creates a new empty `CounterpartyCommitmentSecrets` structure.
44821  */
44822 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
44823
44824 /**
44825  * Returns the minimum index of all stored secrets. Note that indexes start
44826  * at 1 << 48 and get decremented by one for each new secret.
44827  */
44828 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
44829
44830 /**
44831  * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
44832  * was generated in accordance with BOLT 3 and is consistent with previous secrets.
44833  */
44834 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
44835
44836 /**
44837  * Returns the secret at `idx`.
44838  * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
44839  *
44840  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44841  */
44842 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
44843
44844 /**
44845  * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
44846  */
44847 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
44848
44849 /**
44850  * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
44851  */
44852 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
44853
44854 /**
44855  * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
44856  * from the base secret and the per_commitment_point.
44857  */
44858 struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
44859
44860 /**
44861  * Derives a per-commitment-transaction revocation key from its constituent parts.
44862  *
44863  * Only the cheating participant owns a valid witness to propagate a revoked
44864  * commitment transaction, thus per_commitment_secret always come from cheater
44865  * and revocation_base_secret always come from punisher, which is the broadcaster
44866  * of the transaction spending with this key knowledge.
44867  */
44868 struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
44869
44870 /**
44871  * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
44872  */
44873 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
44874
44875 /**
44876  * The broadcaster's per-commitment public key which was used to derive the other keys.
44877  */
44878 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
44879
44880 /**
44881  * The broadcaster's per-commitment public key which was used to derive the other keys.
44882  */
44883 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44884
44885 /**
44886  * The revocation key which is used to allow the broadcaster of the commitment
44887  * transaction to provide their counterparty the ability to punish them if they broadcast
44888  * an old state.
44889  */
44890 struct LDKRevocationKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
44891
44892 /**
44893  * The revocation key which is used to allow the broadcaster of the commitment
44894  * transaction to provide their counterparty the ability to punish them if they broadcast
44895  * an old state.
44896  */
44897 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
44898
44899 /**
44900  * Broadcaster's HTLC Key
44901  */
44902 struct LDKHtlcKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
44903
44904 /**
44905  * Broadcaster's HTLC Key
44906  */
44907 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
44908
44909 /**
44910  * Countersignatory's HTLC Key
44911  */
44912 struct LDKHtlcKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
44913
44914 /**
44915  * Countersignatory's HTLC Key
44916  */
44917 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
44918
44919 /**
44920  * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
44921  */
44922 struct LDKDelayedPaymentKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
44923
44924 /**
44925  * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
44926  */
44927 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentKey val);
44928
44929 /**
44930  * Constructs a new TxCreationKeys given each field
44931  */
44932 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKRevocationKey revocation_key_arg, struct LDKHtlcKey broadcaster_htlc_key_arg, struct LDKHtlcKey countersignatory_htlc_key_arg, struct LDKDelayedPaymentKey broadcaster_delayed_payment_key_arg);
44933
44934 /**
44935  * Checks if two TxCreationKeyss contain equal inner contents.
44936  * This ignores pointers and is_owned flags and looks at the values in fields.
44937  * Two objects with NULL inner values will be considered "equal" here.
44938  */
44939 bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
44940
44941 /**
44942  * Creates a copy of the TxCreationKeys
44943  */
44944 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
44945
44946 /**
44947  * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
44948  */
44949 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
44950
44951 /**
44952  * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
44953  */
44954 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
44955
44956 /**
44957  * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
44958  */
44959 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
44960
44961 /**
44962  * The public key which is used to sign all commitment transactions, as it appears in the
44963  * on-chain channel lock-in 2-of-2 multisig output.
44964  */
44965 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
44966
44967 /**
44968  * The public key which is used to sign all commitment transactions, as it appears in the
44969  * on-chain channel lock-in 2-of-2 multisig output.
44970  */
44971 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44972
44973 /**
44974  * The base point which is used (with derive_public_revocation_key) to derive per-commitment
44975  * revocation keys. This is combined with the per-commitment-secret generated by the
44976  * counterparty to create a secret which the counterparty can reveal to revoke previous
44977  * states.
44978  */
44979 struct LDKRevocationBasepoint ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
44980
44981 /**
44982  * The base point which is used (with derive_public_revocation_key) to derive per-commitment
44983  * revocation keys. This is combined with the per-commitment-secret generated by the
44984  * counterparty to create a secret which the counterparty can reveal to revoke previous
44985  * states.
44986  */
44987 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKRevocationBasepoint val);
44988
44989 /**
44990  * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
44991  * spendable primary channel balance on the broadcaster's commitment transaction. This key is
44992  * static across every commitment transaction.
44993  */
44994 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
44995
44996 /**
44997  * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
44998  * spendable primary channel balance on the broadcaster's commitment transaction. This key is
44999  * static across every commitment transaction.
45000  */
45001 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
45002
45003 /**
45004  * The base point which is used (with derive_public_key) to derive a per-commitment payment
45005  * public key which receives non-HTLC-encumbered funds which are only available for spending
45006  * after some delay (or can be claimed via the revocation path).
45007  */
45008 struct LDKDelayedPaymentBasepoint ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
45009
45010 /**
45011  * The base point which is used (with derive_public_key) to derive a per-commitment payment
45012  * public key which receives non-HTLC-encumbered funds which are only available for spending
45013  * after some delay (or can be claimed via the revocation path).
45014  */
45015 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentBasepoint val);
45016
45017 /**
45018  * The base point which is used (with derive_public_key) to derive a per-commitment public key
45019  * which is used to encumber HTLC-in-flight outputs.
45020  */
45021 struct LDKHtlcBasepoint ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
45022
45023 /**
45024  * The base point which is used (with derive_public_key) to derive a per-commitment public key
45025  * which is used to encumber HTLC-in-flight outputs.
45026  */
45027 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKHtlcBasepoint val);
45028
45029 /**
45030  * Constructs a new ChannelPublicKeys given each field
45031  */
45032 MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKRevocationBasepoint revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKDelayedPaymentBasepoint delayed_payment_basepoint_arg, struct LDKHtlcBasepoint htlc_basepoint_arg);
45033
45034 /**
45035  * Creates a copy of the ChannelPublicKeys
45036  */
45037 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
45038
45039 /**
45040  * Generates a non-cryptographic 64-bit hash of the ChannelPublicKeys.
45041  */
45042 uint64_t ChannelPublicKeys_hash(const struct LDKChannelPublicKeys *NONNULL_PTR o);
45043
45044 /**
45045  * Checks if two ChannelPublicKeyss contain equal inner contents.
45046  * This ignores pointers and is_owned flags and looks at the values in fields.
45047  * Two objects with NULL inner values will be considered "equal" here.
45048  */
45049 bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
45050
45051 /**
45052  * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
45053  */
45054 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
45055
45056 /**
45057  * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
45058  */
45059 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
45060
45061 /**
45062  * Create per-state keys from channel base points and the per-commitment point.
45063  * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
45064  */
45065 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, const struct LDKDelayedPaymentBasepoint *NONNULL_PTR broadcaster_delayed_payment_base, const struct LDKHtlcBasepoint *NONNULL_PTR broadcaster_htlc_base, const struct LDKRevocationBasepoint *NONNULL_PTR countersignatory_revocation_base, const struct LDKHtlcBasepoint *NONNULL_PTR countersignatory_htlc_base);
45066
45067 /**
45068  * Generate per-state keys from channel static keys.
45069  * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
45070  */
45071 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys);
45072
45073 /**
45074  * A script either spendable by the revocation
45075  * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
45076  * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
45077  */
45078 struct LDKCVec_u8Z get_revokeable_redeemscript(const struct LDKRevocationKey *NONNULL_PTR revocation_key, uint16_t contest_delay, const struct LDKDelayedPaymentKey *NONNULL_PTR broadcaster_delayed_payment_key);
45079
45080 /**
45081  * Returns the script for the counterparty's output on a holder's commitment transaction based on
45082  * the channel type.
45083  */
45084 struct LDKCVec_u8Z get_counterparty_payment_script(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey payment_key);
45085
45086 /**
45087  * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
45088  */
45089 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
45090
45091 /**
45092  * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
45093  * Note that this is not the same as whether it is ountbound *from us*. To determine that you
45094  * need to compare this value to whether the commitment transaction in question is that of
45095  * the counterparty or our own.
45096  */
45097 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
45098
45099 /**
45100  * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
45101  * Note that this is not the same as whether it is ountbound *from us*. To determine that you
45102  * need to compare this value to whether the commitment transaction in question is that of
45103  * the counterparty or our own.
45104  */
45105 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
45106
45107 /**
45108  * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
45109  * this divided by 1000.
45110  */
45111 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
45112
45113 /**
45114  * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
45115  * this divided by 1000.
45116  */
45117 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
45118
45119 /**
45120  * The CLTV lock-time at which this HTLC expires.
45121  */
45122 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
45123
45124 /**
45125  * The CLTV lock-time at which this HTLC expires.
45126  */
45127 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
45128
45129 /**
45130  * The hash of the preimage which unlocks this HTLC.
45131  */
45132 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
45133
45134 /**
45135  * The hash of the preimage which unlocks this HTLC.
45136  */
45137 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
45138
45139 /**
45140  * The position within the commitment transactions' outputs. This may be None if the value is
45141  * below the dust limit (in which case no output appears in the commitment transaction and the
45142  * value is spent to additional transaction fees).
45143  */
45144 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
45145
45146 /**
45147  * The position within the commitment transactions' outputs. This may be None if the value is
45148  * below the dust limit (in which case no output appears in the commitment transaction and the
45149  * value is spent to additional transaction fees).
45150  */
45151 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
45152
45153 /**
45154  * Constructs a new HTLCOutputInCommitment given each field
45155  */
45156 MUST_USE_RES struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_new(bool offered_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_u32Z transaction_output_index_arg);
45157
45158 /**
45159  * Creates a copy of the HTLCOutputInCommitment
45160  */
45161 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
45162
45163 /**
45164  * Checks if two HTLCOutputInCommitments contain equal inner contents.
45165  * This ignores pointers and is_owned flags and looks at the values in fields.
45166  * Two objects with NULL inner values will be considered "equal" here.
45167  */
45168 bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
45169
45170 /**
45171  * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
45172  */
45173 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
45174
45175 /**
45176  * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
45177  */
45178 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
45179
45180 /**
45181  * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
45182  * does not need to have its previous_output_index filled.
45183  */
45184 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, const struct LDKTxCreationKeys *NONNULL_PTR keys);
45185
45186 /**
45187  * Gets the redeemscript for a funding output from the two funding public keys.
45188  * Note that the order of funding public keys does not matter.
45189  */
45190 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
45191
45192 /**
45193  * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
45194  * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
45195  * transaction which needs signing, and can be used to construct an HTLC transaction which is
45196  * broadcastable given a counterparty HTLC signature.
45197  *
45198  * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
45199  * commitment transaction).
45200  */
45201 struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, const struct LDKDelayedPaymentKey *NONNULL_PTR broadcaster_delayed_payment_key, const struct LDKRevocationKey *NONNULL_PTR revocation_key);
45202
45203 /**
45204  * Returns the witness required to satisfy and spend a HTLC input.
45205  */
45206 struct LDKWitness build_htlc_input_witness(struct LDKECDSASignature local_sig, struct LDKECDSASignature remote_sig, struct LDKCOption_ThirtyTwoBytesZ preimage, struct LDKu8slice redeem_script, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
45207
45208 /**
45209  * Gets the witnessScript for the to_remote output when anchors are enabled.
45210  */
45211 struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point);
45212
45213 /**
45214  * Gets the witnessScript for an anchor output from the funding public key.
45215  * The witness in the spending input must be:
45216  * <BIP 143 funding_signature>
45217  * After 16 blocks of confirmation, an alternative satisfying witness could be:
45218  * <>
45219  * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
45220  */
45221 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
45222
45223 /**
45224  * Returns the witness required to satisfy and spend an anchor input.
45225  */
45226 struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKECDSASignature funding_sig);
45227
45228 /**
45229  * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
45230  */
45231 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
45232
45233 /**
45234  * Holder public keys
45235  */
45236 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
45237
45238 /**
45239  * Holder public keys
45240  */
45241 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
45242
45243 /**
45244  * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
45245  */
45246 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
45247
45248 /**
45249  * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
45250  */
45251 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
45252
45253 /**
45254  * Whether the holder is the initiator of this channel.
45255  * This is an input to the commitment number obscure factor computation.
45256  */
45257 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
45258
45259 /**
45260  * Whether the holder is the initiator of this channel.
45261  * This is an input to the commitment number obscure factor computation.
45262  */
45263 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
45264
45265 /**
45266  * The late-bound counterparty channel transaction parameters.
45267  * These parameters are populated at the point in the protocol where the counterparty provides them.
45268  *
45269  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
45270  */
45271 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
45272
45273 /**
45274  * The late-bound counterparty channel transaction parameters.
45275  * These parameters are populated at the point in the protocol where the counterparty provides them.
45276  *
45277  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
45278  */
45279 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
45280
45281 /**
45282  * The late-bound funding outpoint
45283  *
45284  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
45285  */
45286 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
45287
45288 /**
45289  * The late-bound funding outpoint
45290  *
45291  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
45292  */
45293 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
45294
45295 /**
45296  * This channel's type, as negotiated during channel open. For old objects where this field
45297  * wasn't serialized, it will default to static_remote_key at deserialization.
45298  */
45299 struct LDKChannelTypeFeatures ChannelTransactionParameters_get_channel_type_features(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
45300
45301 /**
45302  * This channel's type, as negotiated during channel open. For old objects where this field
45303  * wasn't serialized, it will default to static_remote_key at deserialization.
45304  */
45305 void ChannelTransactionParameters_set_channel_type_features(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
45306
45307 /**
45308  * Constructs a new ChannelTransactionParameters given each field
45309  *
45310  * Note that counterparty_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
45311  * Note that funding_outpoint_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
45312  */
45313 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, struct LDKChannelTypeFeatures channel_type_features_arg);
45314
45315 /**
45316  * Creates a copy of the ChannelTransactionParameters
45317  */
45318 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
45319
45320 /**
45321  * Generates a non-cryptographic 64-bit hash of the ChannelTransactionParameters.
45322  */
45323 uint64_t ChannelTransactionParameters_hash(const struct LDKChannelTransactionParameters *NONNULL_PTR o);
45324
45325 /**
45326  * Checks if two ChannelTransactionParameterss contain equal inner contents.
45327  * This ignores pointers and is_owned flags and looks at the values in fields.
45328  * Two objects with NULL inner values will be considered "equal" here.
45329  */
45330 bool ChannelTransactionParameters_eq(const struct LDKChannelTransactionParameters *NONNULL_PTR a, const struct LDKChannelTransactionParameters *NONNULL_PTR b);
45331
45332 /**
45333  * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
45334  */
45335 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
45336
45337 /**
45338  * Counter-party public keys
45339  */
45340 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
45341
45342 /**
45343  * Counter-party public keys
45344  */
45345 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
45346
45347 /**
45348  * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
45349  */
45350 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
45351
45352 /**
45353  * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
45354  */
45355 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
45356
45357 /**
45358  * Constructs a new CounterpartyChannelTransactionParameters given each field
45359  */
45360 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
45361
45362 /**
45363  * Creates a copy of the CounterpartyChannelTransactionParameters
45364  */
45365 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
45366
45367 /**
45368  * Generates a non-cryptographic 64-bit hash of the CounterpartyChannelTransactionParameters.
45369  */
45370 uint64_t CounterpartyChannelTransactionParameters_hash(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR o);
45371
45372 /**
45373  * Checks if two CounterpartyChannelTransactionParameterss contain equal inner contents.
45374  * This ignores pointers and is_owned flags and looks at the values in fields.
45375  * Two objects with NULL inner values will be considered "equal" here.
45376  */
45377 bool CounterpartyChannelTransactionParameters_eq(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR a, const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR b);
45378
45379 /**
45380  * Whether the late bound parameters are populated.
45381  */
45382 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
45383
45384 /**
45385  * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
45386  * given that the holder is the broadcaster.
45387  *
45388  * self.is_populated() must be true before calling this function.
45389  */
45390 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
45391
45392 /**
45393  * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
45394  * given that the counterparty is the broadcaster.
45395  *
45396  * self.is_populated() must be true before calling this function.
45397  */
45398 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
45399
45400 /**
45401  * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
45402  */
45403 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
45404
45405 /**
45406  * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
45407  */
45408 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
45409
45410 /**
45411  * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
45412  */
45413 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
45414
45415 /**
45416  * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
45417  */
45418 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
45419
45420 /**
45421  * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
45422  */
45423 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
45424
45425 /**
45426  * Get the channel pubkeys for the broadcaster
45427  */
45428 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
45429
45430 /**
45431  * Get the channel pubkeys for the countersignatory
45432  */
45433 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
45434
45435 /**
45436  * Get the contest delay applicable to the transactions.
45437  * Note that the contest delay was selected by the countersignatory.
45438  */
45439 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
45440
45441 /**
45442  * Whether the channel is outbound from the broadcaster.
45443  *
45444  * The boolean representing the side that initiated the channel is
45445  * an input to the commitment number obscure factor computation.
45446  */
45447 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
45448
45449 /**
45450  * The funding outpoint
45451  */
45452 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
45453
45454 /**
45455  * Whether to use anchors for this channel
45456  */
45457 MUST_USE_RES struct LDKChannelTypeFeatures DirectedChannelTransactionParameters_channel_type_features(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
45458
45459 /**
45460  * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
45461  */
45462 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
45463
45464 /**
45465  * Our counterparty's signature for the transaction
45466  */
45467 struct LDKECDSASignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
45468
45469 /**
45470  * Our counterparty's signature for the transaction
45471  */
45472 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
45473
45474 /**
45475  * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
45476  *
45477  * Returns a copy of the field.
45478  */
45479 struct LDKCVec_ECDSASignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
45480
45481 /**
45482  * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
45483  */
45484 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
45485
45486 /**
45487  * Creates a copy of the HolderCommitmentTransaction
45488  */
45489 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
45490
45491 /**
45492  * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
45493  */
45494 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
45495
45496 /**
45497  * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
45498  */
45499 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
45500
45501 /**
45502  * Create a new holder transaction with the given counterparty signatures.
45503  * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
45504  */
45505 MUST_USE_RES struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_new(struct LDKCommitmentTransaction commitment_tx, struct LDKECDSASignature counterparty_sig, struct LDKCVec_ECDSASignatureZ counterparty_htlc_sigs, struct LDKPublicKey holder_funding_key, struct LDKPublicKey counterparty_funding_key);
45506
45507 /**
45508  * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
45509  */
45510 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
45511
45512 /**
45513  * The commitment transaction
45514  */
45515 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
45516
45517 /**
45518  * The commitment transaction
45519  */
45520 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
45521
45522 /**
45523  * The txid for the commitment transaction.
45524  *
45525  * This is provided as a performance optimization, instead of calling transaction.txid()
45526  * multiple times.
45527  */
45528 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
45529
45530 /**
45531  * The txid for the commitment transaction.
45532  *
45533  * This is provided as a performance optimization, instead of calling transaction.txid()
45534  * multiple times.
45535  */
45536 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
45537
45538 /**
45539  * Constructs a new BuiltCommitmentTransaction given each field
45540  */
45541 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
45542
45543 /**
45544  * Creates a copy of the BuiltCommitmentTransaction
45545  */
45546 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
45547
45548 /**
45549  * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
45550  */
45551 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
45552
45553 /**
45554  * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
45555  */
45556 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
45557
45558 /**
45559  * Get the SIGHASH_ALL sighash value of the transaction.
45560  *
45561  * This can be used to verify a signature.
45562  */
45563 MUST_USE_RES struct LDKThirtyTwoBytes BuiltCommitmentTransaction_get_sighash_all(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
45564
45565 /**
45566  * Signs the counterparty's commitment transaction.
45567  */
45568 MUST_USE_RES struct LDKECDSASignature BuiltCommitmentTransaction_sign_counterparty_commitment(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
45569
45570 /**
45571  * Signs the holder commitment transaction because we are about to broadcast it.
45572  */
45573 MUST_USE_RES struct LDKECDSASignature BuiltCommitmentTransaction_sign_holder_commitment(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis, const struct LDKEntropySource *NONNULL_PTR entropy_source);
45574
45575 /**
45576  * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
45577  */
45578 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
45579
45580 /**
45581  * Creates a copy of the ClosingTransaction
45582  */
45583 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
45584
45585 /**
45586  * Generates a non-cryptographic 64-bit hash of the ClosingTransaction.
45587  */
45588 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
45589
45590 /**
45591  * Checks if two ClosingTransactions contain equal inner contents.
45592  * This ignores pointers and is_owned flags and looks at the values in fields.
45593  * Two objects with NULL inner values will be considered "equal" here.
45594  */
45595 bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
45596
45597 /**
45598  * Construct an object of the class
45599  */
45600 MUST_USE_RES struct LDKClosingTransaction ClosingTransaction_new(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint);
45601
45602 /**
45603  * Trust our pre-built transaction.
45604  *
45605  * Applies a wrapper which allows access to the transaction.
45606  *
45607  * This should only be used if you fully trust the builder of this object. It should not
45608  * be used by an external signer - instead use the verify function.
45609  */
45610 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
45611
45612 /**
45613  * Verify our pre-built transaction.
45614  *
45615  * Applies a wrapper which allows access to the transaction.
45616  *
45617  * An external validating signer must call this method before signing
45618  * or using the built transaction.
45619  */
45620 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
45621
45622 /**
45623  * The value to be sent to the holder, or zero if the output will be omitted
45624  */
45625 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
45626
45627 /**
45628  * The value to be sent to the counterparty, or zero if the output will be omitted
45629  */
45630 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
45631
45632 /**
45633  * The destination of the holder's output
45634  */
45635 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
45636
45637 /**
45638  * The destination of the counterparty's output
45639  */
45640 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
45641
45642 /**
45643  * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
45644  */
45645 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
45646
45647 /**
45648  * The pre-built Bitcoin commitment transaction
45649  */
45650 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
45651
45652 /**
45653  * Get the SIGHASH_ALL sighash value of the transaction.
45654  *
45655  * This can be used to verify a signature.
45656  */
45657 MUST_USE_RES struct LDKThirtyTwoBytes TrustedClosingTransaction_get_sighash_all(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
45658
45659 /**
45660  * Sign a transaction, either because we are counter-signing the counterparty's transaction or
45661  * because we are about to broadcast a holder transaction.
45662  */
45663 MUST_USE_RES struct LDKECDSASignature TrustedClosingTransaction_sign(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
45664
45665 /**
45666  * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
45667  */
45668 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
45669
45670 /**
45671  * Creates a copy of the CommitmentTransaction
45672  */
45673 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
45674
45675 /**
45676  * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
45677  */
45678 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
45679
45680 /**
45681  * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
45682  */
45683 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
45684
45685 /**
45686  * The backwards-counting commitment number
45687  */
45688 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
45689
45690 /**
45691  * The per commitment point used by the broadcaster.
45692  */
45693 MUST_USE_RES struct LDKPublicKey CommitmentTransaction_per_commitment_point(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
45694
45695 /**
45696  * The value to be sent to the broadcaster
45697  */
45698 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
45699
45700 /**
45701  * The value to be sent to the counterparty
45702  */
45703 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
45704
45705 /**
45706  * The feerate paid per 1000-weight-unit in this commitment transaction.
45707  */
45708 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
45709
45710 /**
45711  * Trust our pre-built transaction and derived transaction creation public keys.
45712  *
45713  * Applies a wrapper which allows access to these fields.
45714  *
45715  * This should only be used if you fully trust the builder of this object.  It should not
45716  * be used by an external signer - instead use the verify function.
45717  */
45718 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
45719
45720 /**
45721  * Verify our pre-built transaction and derived transaction creation public keys.
45722  *
45723  * Applies a wrapper which allows access to these fields.
45724  *
45725  * An external validating signer must call this method before signing
45726  * or using the built transaction.
45727  */
45728 MUST_USE_RES struct LDKCResult_TrustedCommitmentTransactionNoneZ CommitmentTransaction_verify(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg, const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys);
45729
45730 /**
45731  * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
45732  */
45733 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
45734
45735 /**
45736  * The transaction ID of the built Bitcoin transaction
45737  */
45738 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
45739
45740 /**
45741  * The pre-built Bitcoin commitment transaction
45742  */
45743 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
45744
45745 /**
45746  * The pre-calculated transaction creation public keys.
45747  */
45748 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
45749
45750 /**
45751  * Should anchors be used.
45752  */
45753 MUST_USE_RES struct LDKChannelTypeFeatures TrustedCommitmentTransaction_channel_type_features(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
45754
45755 /**
45756  * Get a signature for each HTLC which was included in the commitment transaction (ie for
45757  * which HTLCOutputInCommitment::transaction_output_index.is_some()).
45758  *
45759  * The returned Vec has one entry for each HTLC, and in the same order.
45760  *
45761  * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
45762  */
45763 MUST_USE_RES struct LDKCResult_CVec_ECDSASignatureZNoneZ TrustedCommitmentTransaction_get_htlc_sigs(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*htlc_base_key)[32], const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters, const struct LDKEntropySource *NONNULL_PTR entropy_source);
45764
45765 /**
45766  * Returns the index of the revokeable output, i.e. the `to_local` output sending funds to
45767  * the broadcaster, in the built transaction, if any exists.
45768  *
45769  * There are two cases where this may return `None`:
45770  * - The balance of the revokeable output is below the dust limit (only found on commitments
45771  * early in the channel's lifetime, i.e. before the channel reserve is met).
45772  * - This commitment was created before LDK 0.0.117. In this case, the
45773  * commitment transaction previously didn't contain enough information to locate the
45774  * revokeable output.
45775  */
45776 MUST_USE_RES struct LDKCOption_usizeZ TrustedCommitmentTransaction_revokeable_output_index(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
45777
45778 /**
45779  * Helper method to build an unsigned justice transaction spending the revokeable
45780  * `to_local` output to a destination script. Fee estimation accounts for the expected
45781  * revocation witness data that will be added when signed.
45782  *
45783  * This method will error if the given fee rate results in a fee greater than the value
45784  * of the output being spent, or if there exists no revokeable `to_local` output on this
45785  * commitment transaction. See [`Self::revokeable_output_index`] for more details.
45786  *
45787  * The built transaction will allow fee bumping with RBF, and this method takes
45788  * `feerate_per_kw` as an input such that multiple copies of a justice transaction at different
45789  * fee rates may be built.
45790  */
45791 MUST_USE_RES struct LDKCResult_TransactionNoneZ TrustedCommitmentTransaction_build_to_local_justice_tx(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, uint64_t feerate_per_kw, struct LDKCVec_u8Z destination_script);
45792
45793 /**
45794  * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
45795  * shared secret first. This prevents on-chain observers from discovering how many commitment
45796  * transactions occurred in a channel before it was closed.
45797  *
45798  * This function gets the shared secret from relevant channel public keys and can be used to
45799  * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
45800  */
45801 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
45802
45803 /**
45804  * Checks if two InitFeaturess contain equal inner contents.
45805  * This ignores pointers and is_owned flags and looks at the values in fields.
45806  * Two objects with NULL inner values will be considered "equal" here.
45807  */
45808 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
45809
45810 /**
45811  * Checks if two NodeFeaturess contain equal inner contents.
45812  * This ignores pointers and is_owned flags and looks at the values in fields.
45813  * Two objects with NULL inner values will be considered "equal" here.
45814  */
45815 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
45816
45817 /**
45818  * Checks if two ChannelFeaturess contain equal inner contents.
45819  * This ignores pointers and is_owned flags and looks at the values in fields.
45820  * Two objects with NULL inner values will be considered "equal" here.
45821  */
45822 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
45823
45824 /**
45825  * Checks if two Bolt11InvoiceFeaturess contain equal inner contents.
45826  * This ignores pointers and is_owned flags and looks at the values in fields.
45827  * Two objects with NULL inner values will be considered "equal" here.
45828  */
45829 bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b);
45830
45831 /**
45832  * Checks if two OfferFeaturess contain equal inner contents.
45833  * This ignores pointers and is_owned flags and looks at the values in fields.
45834  * Two objects with NULL inner values will be considered "equal" here.
45835  */
45836 bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b);
45837
45838 /**
45839  * Checks if two InvoiceRequestFeaturess contain equal inner contents.
45840  * This ignores pointers and is_owned flags and looks at the values in fields.
45841  * Two objects with NULL inner values will be considered "equal" here.
45842  */
45843 bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b);
45844
45845 /**
45846  * Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
45847  * This ignores pointers and is_owned flags and looks at the values in fields.
45848  * Two objects with NULL inner values will be considered "equal" here.
45849  */
45850 bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b);
45851
45852 /**
45853  * Checks if two BlindedHopFeaturess contain equal inner contents.
45854  * This ignores pointers and is_owned flags and looks at the values in fields.
45855  * Two objects with NULL inner values will be considered "equal" here.
45856  */
45857 bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b);
45858
45859 /**
45860  * Checks if two ChannelTypeFeaturess contain equal inner contents.
45861  * This ignores pointers and is_owned flags and looks at the values in fields.
45862  * Two objects with NULL inner values will be considered "equal" here.
45863  */
45864 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
45865
45866 /**
45867  * Creates a copy of the InitFeatures
45868  */
45869 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
45870
45871 /**
45872  * Creates a copy of the NodeFeatures
45873  */
45874 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
45875
45876 /**
45877  * Creates a copy of the ChannelFeatures
45878  */
45879 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
45880
45881 /**
45882  * Creates a copy of the Bolt11InvoiceFeatures
45883  */
45884 struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig);
45885
45886 /**
45887  * Creates a copy of the OfferFeatures
45888  */
45889 struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig);
45890
45891 /**
45892  * Creates a copy of the InvoiceRequestFeatures
45893  */
45894 struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig);
45895
45896 /**
45897  * Creates a copy of the Bolt12InvoiceFeatures
45898  */
45899 struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig);
45900
45901 /**
45902  * Creates a copy of the BlindedHopFeatures
45903  */
45904 struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig);
45905
45906 /**
45907  * Creates a copy of the ChannelTypeFeatures
45908  */
45909 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
45910
45911 /**
45912  * Generates a non-cryptographic 64-bit hash of the InitFeatures.
45913  */
45914 uint64_t InitFeatures_hash(const struct LDKInitFeatures *NONNULL_PTR o);
45915
45916 /**
45917  * Generates a non-cryptographic 64-bit hash of the NodeFeatures.
45918  */
45919 uint64_t NodeFeatures_hash(const struct LDKNodeFeatures *NONNULL_PTR o);
45920
45921 /**
45922  * Generates a non-cryptographic 64-bit hash of the ChannelFeatures.
45923  */
45924 uint64_t ChannelFeatures_hash(const struct LDKChannelFeatures *NONNULL_PTR o);
45925
45926 /**
45927  * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceFeatures.
45928  */
45929 uint64_t Bolt11InvoiceFeatures_hash(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR o);
45930
45931 /**
45932  * Generates a non-cryptographic 64-bit hash of the OfferFeatures.
45933  */
45934 uint64_t OfferFeatures_hash(const struct LDKOfferFeatures *NONNULL_PTR o);
45935
45936 /**
45937  * Generates a non-cryptographic 64-bit hash of the InvoiceRequestFeatures.
45938  */
45939 uint64_t InvoiceRequestFeatures_hash(const struct LDKInvoiceRequestFeatures *NONNULL_PTR o);
45940
45941 /**
45942  * Generates a non-cryptographic 64-bit hash of the Bolt12InvoiceFeatures.
45943  */
45944 uint64_t Bolt12InvoiceFeatures_hash(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR o);
45945
45946 /**
45947  * Generates a non-cryptographic 64-bit hash of the BlindedHopFeatures.
45948  */
45949 uint64_t BlindedHopFeatures_hash(const struct LDKBlindedHopFeatures *NONNULL_PTR o);
45950
45951 /**
45952  * Generates a non-cryptographic 64-bit hash of the ChannelTypeFeatures.
45953  */
45954 uint64_t ChannelTypeFeatures_hash(const struct LDKChannelTypeFeatures *NONNULL_PTR o);
45955
45956 /**
45957  * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
45958  */
45959 void InitFeatures_free(struct LDKInitFeatures this_obj);
45960
45961 /**
45962  * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
45963  */
45964 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
45965
45966 /**
45967  * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
45968  */
45969 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
45970
45971 /**
45972  * Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
45973  */
45974 void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj);
45975
45976 /**
45977  * Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
45978  */
45979 void OfferFeatures_free(struct LDKOfferFeatures this_obj);
45980
45981 /**
45982  * Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
45983  */
45984 void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj);
45985
45986 /**
45987  * Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
45988  */
45989 void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj);
45990
45991 /**
45992  * Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
45993  */
45994 void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj);
45995
45996 /**
45997  * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
45998  */
45999 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
46000
46001 /**
46002  * Create a blank Features with no features set
46003  */
46004 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
46005
46006 /**
46007  * Returns true if this `Features` object contains required features unknown by `other`.
46008  */
46009 MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other);
46010
46011 /**
46012  * Returns true if this `Features` object contains unknown feature flags which are set as
46013  * \"required\".
46014  */
46015 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46016
46017 /**
46018  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46019  * by [BOLT 9].
46020  *
46021  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46022  * be set instead (i.e., `bit - 1`).
46023  *
46024  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46025  */
46026 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46027
46028 /**
46029  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46030  * by [BOLT 9].
46031  *
46032  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46033  * set instead (i.e., `bit + 1`).
46034  *
46035  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46036  */
46037 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46038
46039 /**
46040  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46041  * by [bLIP 2] or if it is a known `T` feature.
46042  *
46043  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46044  * be set instead (i.e., `bit - 1`).
46045  *
46046  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46047  */
46048 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46049
46050 /**
46051  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46052  * by [bLIP 2] or if it is a known `T` feature.
46053  *
46054  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46055  * set instead (i.e., `bit + 1`).
46056  *
46057  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46058  */
46059 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46060
46061 /**
46062  * Create a blank Features with no features set
46063  */
46064 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
46065
46066 /**
46067  * Returns true if this `Features` object contains required features unknown by `other`.
46068  */
46069 MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other);
46070
46071 /**
46072  * Returns true if this `Features` object contains unknown feature flags which are set as
46073  * \"required\".
46074  */
46075 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46076
46077 /**
46078  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46079  * by [BOLT 9].
46080  *
46081  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46082  * be set instead (i.e., `bit - 1`).
46083  *
46084  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46085  */
46086 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46087
46088 /**
46089  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46090  * by [BOLT 9].
46091  *
46092  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46093  * set instead (i.e., `bit + 1`).
46094  *
46095  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46096  */
46097 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46098
46099 /**
46100  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46101  * by [bLIP 2] or if it is a known `T` feature.
46102  *
46103  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46104  * be set instead (i.e., `bit - 1`).
46105  *
46106  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46107  */
46108 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46109
46110 /**
46111  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46112  * by [bLIP 2] or if it is a known `T` feature.
46113  *
46114  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46115  * set instead (i.e., `bit + 1`).
46116  *
46117  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46118  */
46119 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46120
46121 /**
46122  * Create a blank Features with no features set
46123  */
46124 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
46125
46126 /**
46127  * Returns true if this `Features` object contains required features unknown by `other`.
46128  */
46129 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other);
46130
46131 /**
46132  * Returns true if this `Features` object contains unknown feature flags which are set as
46133  * \"required\".
46134  */
46135 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
46136
46137 /**
46138  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46139  * by [BOLT 9].
46140  *
46141  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46142  * be set instead (i.e., `bit - 1`).
46143  *
46144  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46145  */
46146 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46147
46148 /**
46149  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46150  * by [BOLT 9].
46151  *
46152  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46153  * set instead (i.e., `bit + 1`).
46154  *
46155  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46156  */
46157 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46158
46159 /**
46160  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46161  * by [bLIP 2] or if it is a known `T` feature.
46162  *
46163  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46164  * be set instead (i.e., `bit - 1`).
46165  *
46166  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46167  */
46168 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46169
46170 /**
46171  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46172  * by [bLIP 2] or if it is a known `T` feature.
46173  *
46174  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46175  * set instead (i.e., `bit + 1`).
46176  *
46177  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46178  */
46179 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46180
46181 /**
46182  * Create a blank Features with no features set
46183  */
46184 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void);
46185
46186 /**
46187  * Returns true if this `Features` object contains required features unknown by `other`.
46188  */
46189 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other);
46190
46191 /**
46192  * Returns true if this `Features` object contains unknown feature flags which are set as
46193  * \"required\".
46194  */
46195 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46196
46197 /**
46198  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46199  * by [BOLT 9].
46200  *
46201  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46202  * be set instead (i.e., `bit - 1`).
46203  *
46204  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46205  */
46206 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46207
46208 /**
46209  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46210  * by [BOLT 9].
46211  *
46212  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46213  * set instead (i.e., `bit + 1`).
46214  *
46215  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46216  */
46217 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46218
46219 /**
46220  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46221  * by [bLIP 2] or if it is a known `T` feature.
46222  *
46223  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46224  * be set instead (i.e., `bit - 1`).
46225  *
46226  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46227  */
46228 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46229
46230 /**
46231  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46232  * by [bLIP 2] or if it is a known `T` feature.
46233  *
46234  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46235  * set instead (i.e., `bit + 1`).
46236  *
46237  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46238  */
46239 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46240
46241 /**
46242  * Create a blank Features with no features set
46243  */
46244 MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void);
46245
46246 /**
46247  * Returns true if this `Features` object contains required features unknown by `other`.
46248  */
46249 MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other);
46250
46251 /**
46252  * Returns true if this `Features` object contains unknown feature flags which are set as
46253  * \"required\".
46254  */
46255 MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
46256
46257 /**
46258  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46259  * by [BOLT 9].
46260  *
46261  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46262  * be set instead (i.e., `bit - 1`).
46263  *
46264  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46265  */
46266 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46267
46268 /**
46269  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46270  * by [BOLT 9].
46271  *
46272  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46273  * set instead (i.e., `bit + 1`).
46274  *
46275  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46276  */
46277 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46278
46279 /**
46280  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46281  * by [bLIP 2] or if it is a known `T` feature.
46282  *
46283  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46284  * be set instead (i.e., `bit - 1`).
46285  *
46286  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46287  */
46288 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46289
46290 /**
46291  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46292  * by [bLIP 2] or if it is a known `T` feature.
46293  *
46294  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46295  * set instead (i.e., `bit + 1`).
46296  *
46297  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46298  */
46299 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46300
46301 /**
46302  * Create a blank Features with no features set
46303  */
46304 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void);
46305
46306 /**
46307  * Returns true if this `Features` object contains required features unknown by `other`.
46308  */
46309 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other);
46310
46311 /**
46312  * Returns true if this `Features` object contains unknown feature flags which are set as
46313  * \"required\".
46314  */
46315 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
46316
46317 /**
46318  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46319  * by [BOLT 9].
46320  *
46321  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46322  * be set instead (i.e., `bit - 1`).
46323  *
46324  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46325  */
46326 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46327
46328 /**
46329  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46330  * by [BOLT 9].
46331  *
46332  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46333  * set instead (i.e., `bit + 1`).
46334  *
46335  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46336  */
46337 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46338
46339 /**
46340  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46341  * by [bLIP 2] or if it is a known `T` feature.
46342  *
46343  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46344  * be set instead (i.e., `bit - 1`).
46345  *
46346  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46347  */
46348 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46349
46350 /**
46351  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46352  * by [bLIP 2] or if it is a known `T` feature.
46353  *
46354  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46355  * set instead (i.e., `bit + 1`).
46356  *
46357  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46358  */
46359 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46360
46361 /**
46362  * Create a blank Features with no features set
46363  */
46364 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void);
46365
46366 /**
46367  * Returns true if this `Features` object contains required features unknown by `other`.
46368  */
46369 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other);
46370
46371 /**
46372  * Returns true if this `Features` object contains unknown feature flags which are set as
46373  * \"required\".
46374  */
46375 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
46376
46377 /**
46378  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46379  * by [BOLT 9].
46380  *
46381  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46382  * be set instead (i.e., `bit - 1`).
46383  *
46384  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46385  */
46386 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46387
46388 /**
46389  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46390  * by [BOLT 9].
46391  *
46392  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46393  * set instead (i.e., `bit + 1`).
46394  *
46395  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46396  */
46397 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46398
46399 /**
46400  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46401  * by [bLIP 2] or if it is a known `T` feature.
46402  *
46403  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46404  * be set instead (i.e., `bit - 1`).
46405  *
46406  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46407  */
46408 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46409
46410 /**
46411  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46412  * by [bLIP 2] or if it is a known `T` feature.
46413  *
46414  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46415  * set instead (i.e., `bit + 1`).
46416  *
46417  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46418  */
46419 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46420
46421 /**
46422  * Create a blank Features with no features set
46423  */
46424 MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void);
46425
46426 /**
46427  * Returns true if this `Features` object contains required features unknown by `other`.
46428  */
46429 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other);
46430
46431 /**
46432  * Returns true if this `Features` object contains unknown feature flags which are set as
46433  * \"required\".
46434  */
46435 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
46436
46437 /**
46438  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46439  * by [BOLT 9].
46440  *
46441  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46442  * be set instead (i.e., `bit - 1`).
46443  *
46444  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46445  */
46446 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46447
46448 /**
46449  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46450  * by [BOLT 9].
46451  *
46452  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46453  * set instead (i.e., `bit + 1`).
46454  *
46455  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46456  */
46457 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46458
46459 /**
46460  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46461  * by [bLIP 2] or if it is a known `T` feature.
46462  *
46463  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46464  * be set instead (i.e., `bit - 1`).
46465  *
46466  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46467  */
46468 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46469
46470 /**
46471  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46472  * by [bLIP 2] or if it is a known `T` feature.
46473  *
46474  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46475  * set instead (i.e., `bit + 1`).
46476  *
46477  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46478  */
46479 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46480
46481 /**
46482  * Create a blank Features with no features set
46483  */
46484 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
46485
46486 /**
46487  * Returns true if this `Features` object contains required features unknown by `other`.
46488  */
46489 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other);
46490
46491 /**
46492  * Returns true if this `Features` object contains unknown feature flags which are set as
46493  * \"required\".
46494  */
46495 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46496
46497 /**
46498  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
46499  * by [BOLT 9].
46500  *
46501  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46502  * be set instead (i.e., `bit - 1`).
46503  *
46504  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46505  */
46506 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46507
46508 /**
46509  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
46510  * by [BOLT 9].
46511  *
46512  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46513  * set instead (i.e., `bit + 1`).
46514  *
46515  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
46516  */
46517 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46518
46519 /**
46520  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
46521  * by [bLIP 2] or if it is a known `T` feature.
46522  *
46523  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
46524  * be set instead (i.e., `bit - 1`).
46525  *
46526  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46527  */
46528 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46529
46530 /**
46531  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
46532  * by [bLIP 2] or if it is a known `T` feature.
46533  *
46534  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
46535  * set instead (i.e., `bit + 1`).
46536  *
46537  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
46538  */
46539 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
46540
46541 /**
46542  * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
46543  */
46544 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
46545
46546 /**
46547  * Read a InitFeatures from a byte array, created by InitFeatures_write
46548  */
46549 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
46550
46551 /**
46552  * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
46553  */
46554 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
46555
46556 /**
46557  * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
46558  */
46559 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
46560
46561 /**
46562  * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
46563  */
46564 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
46565
46566 /**
46567  * Read a NodeFeatures from a byte array, created by NodeFeatures_write
46568  */
46569 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
46570
46571 /**
46572  * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
46573  */
46574 struct LDKCVec_u8Z Bolt11InvoiceFeatures_write(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR obj);
46575
46576 /**
46577  * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
46578  */
46579 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ Bolt11InvoiceFeatures_read(struct LDKu8slice ser);
46580
46581 /**
46582  * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
46583  */
46584 struct LDKCVec_u8Z Bolt12InvoiceFeatures_write(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR obj);
46585
46586 /**
46587  * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
46588  */
46589 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ Bolt12InvoiceFeatures_read(struct LDKu8slice ser);
46590
46591 /**
46592  * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
46593  */
46594 struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj);
46595
46596 /**
46597  * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
46598  */
46599 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser);
46600
46601 /**
46602  * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
46603  */
46604 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
46605
46606 /**
46607  * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
46608  */
46609 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
46610
46611 /**
46612  * Set this feature as optional.
46613  */
46614 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46615
46616 /**
46617  * Set this feature as required.
46618  */
46619 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46620
46621 /**
46622  * Checks if this feature is supported.
46623  */
46624 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46625
46626 /**
46627  * Set this feature as optional.
46628  */
46629 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46630
46631 /**
46632  * Set this feature as required.
46633  */
46634 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46635
46636 /**
46637  * Checks if this feature is supported.
46638  */
46639 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46640
46641 /**
46642  * Checks if this feature is required.
46643  */
46644 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46645
46646 /**
46647  * Checks if this feature is required.
46648  */
46649 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46650
46651 /**
46652  * Set this feature as optional.
46653  */
46654 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46655
46656 /**
46657  * Set this feature as required.
46658  */
46659 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46660
46661 /**
46662  * Checks if this feature is supported.
46663  */
46664 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46665
46666 /**
46667  * Set this feature as optional.
46668  */
46669 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46670
46671 /**
46672  * Set this feature as required.
46673  */
46674 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46675
46676 /**
46677  * Checks if this feature is supported.
46678  */
46679 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46680
46681 /**
46682  * Set this feature as optional.
46683  */
46684 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46685
46686 /**
46687  * Set this feature as required.
46688  */
46689 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46690
46691 /**
46692  * Checks if this feature is supported.
46693  */
46694 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46695
46696 /**
46697  * Checks if this feature is required.
46698  */
46699 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46700
46701 /**
46702  * Checks if this feature is required.
46703  */
46704 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46705
46706 /**
46707  * Set this feature as optional.
46708  */
46709 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46710
46711 /**
46712  * Set this feature as required.
46713  */
46714 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46715
46716 /**
46717  * Checks if this feature is supported.
46718  */
46719 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46720
46721 /**
46722  * Set this feature as optional.
46723  */
46724 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46725
46726 /**
46727  * Set this feature as required.
46728  */
46729 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46730
46731 /**
46732  * Checks if this feature is supported.
46733  */
46734 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46735
46736 /**
46737  * Checks if this feature is required.
46738  */
46739 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46740
46741 /**
46742  * Checks if this feature is required.
46743  */
46744 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46745
46746 /**
46747  * Set this feature as optional.
46748  */
46749 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46750
46751 /**
46752  * Set this feature as required.
46753  */
46754 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46755
46756 /**
46757  * Checks if this feature is supported.
46758  */
46759 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46760
46761 /**
46762  * Set this feature as optional.
46763  */
46764 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46765
46766 /**
46767  * Set this feature as required.
46768  */
46769 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46770
46771 /**
46772  * Checks if this feature is supported.
46773  */
46774 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46775
46776 /**
46777  * Set this feature as optional.
46778  */
46779 void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46780
46781 /**
46782  * Set this feature as required.
46783  */
46784 void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46785
46786 /**
46787  * Checks if this feature is supported.
46788  */
46789 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46790
46791 /**
46792  * Checks if this feature is required.
46793  */
46794 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46795
46796 /**
46797  * Checks if this feature is required.
46798  */
46799 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46800
46801 /**
46802  * Checks if this feature is required.
46803  */
46804 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46805
46806 /**
46807  * Set this feature as optional.
46808  */
46809 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46810
46811 /**
46812  * Set this feature as required.
46813  */
46814 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46815
46816 /**
46817  * Checks if this feature is supported.
46818  */
46819 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46820
46821 /**
46822  * Set this feature as optional.
46823  */
46824 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46825
46826 /**
46827  * Set this feature as required.
46828  */
46829 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46830
46831 /**
46832  * Checks if this feature is supported.
46833  */
46834 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46835
46836 /**
46837  * Set this feature as optional.
46838  */
46839 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46840
46841 /**
46842  * Set this feature as required.
46843  */
46844 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46845
46846 /**
46847  * Checks if this feature is supported.
46848  */
46849 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46850
46851 /**
46852  * Checks if this feature is required.
46853  */
46854 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46855
46856 /**
46857  * Checks if this feature is required.
46858  */
46859 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46860
46861 /**
46862  * Checks if this feature is required.
46863  */
46864 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46865
46866 /**
46867  * Set this feature as optional.
46868  */
46869 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46870
46871 /**
46872  * Set this feature as required.
46873  */
46874 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46875
46876 /**
46877  * Checks if this feature is supported.
46878  */
46879 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46880
46881 /**
46882  * Set this feature as optional.
46883  */
46884 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46885
46886 /**
46887  * Set this feature as required.
46888  */
46889 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46890
46891 /**
46892  * Checks if this feature is supported.
46893  */
46894 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46895
46896 /**
46897  * Set this feature as optional.
46898  */
46899 void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46900
46901 /**
46902  * Set this feature as required.
46903  */
46904 void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46905
46906 /**
46907  * Checks if this feature is supported.
46908  */
46909 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46910
46911 /**
46912  * Checks if this feature is required.
46913  */
46914 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46915
46916 /**
46917  * Checks if this feature is required.
46918  */
46919 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46920
46921 /**
46922  * Checks if this feature is required.
46923  */
46924 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46925
46926 /**
46927  * Set this feature as optional.
46928  */
46929 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46930
46931 /**
46932  * Set this feature as required.
46933  */
46934 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46935
46936 /**
46937  * Checks if this feature is supported.
46938  */
46939 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46940
46941 /**
46942  * Set this feature as optional.
46943  */
46944 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46945
46946 /**
46947  * Set this feature as required.
46948  */
46949 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46950
46951 /**
46952  * Checks if this feature is supported.
46953  */
46954 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46955
46956 /**
46957  * Set this feature as optional.
46958  */
46959 void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46960
46961 /**
46962  * Set this feature as required.
46963  */
46964 void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46965
46966 /**
46967  * Checks if this feature is supported.
46968  */
46969 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46970
46971 /**
46972  * Set this feature as optional.
46973  */
46974 void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
46975
46976 /**
46977  * Set this feature as required.
46978  */
46979 void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
46980
46981 /**
46982  * Checks if this feature is supported.
46983  */
46984 MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
46985
46986 /**
46987  * Checks if this feature is required.
46988  */
46989 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46990
46991 /**
46992  * Checks if this feature is required.
46993  */
46994 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46995
46996 /**
46997  * Checks if this feature is required.
46998  */
46999 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47000
47001 /**
47002  * Checks if this feature is required.
47003  */
47004 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
47005
47006 /**
47007  * Set this feature as optional.
47008  */
47009 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47010
47011 /**
47012  * Set this feature as required.
47013  */
47014 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47015
47016 /**
47017  * Checks if this feature is supported.
47018  */
47019 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47020
47021 /**
47022  * Set this feature as optional.
47023  */
47024 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47025
47026 /**
47027  * Set this feature as required.
47028  */
47029 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47030
47031 /**
47032  * Checks if this feature is supported.
47033  */
47034 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47035
47036 /**
47037  * Checks if this feature is required.
47038  */
47039 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47040
47041 /**
47042  * Checks if this feature is required.
47043  */
47044 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47045
47046 /**
47047  * Set this feature as optional.
47048  */
47049 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47050
47051 /**
47052  * Set this feature as required.
47053  */
47054 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47055
47056 /**
47057  * Checks if this feature is supported.
47058  */
47059 MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47060
47061 /**
47062  * Set this feature as optional.
47063  */
47064 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47065
47066 /**
47067  * Set this feature as required.
47068  */
47069 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47070
47071 /**
47072  * Checks if this feature is supported.
47073  */
47074 MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47075
47076 /**
47077  * Set this feature as optional.
47078  */
47079 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47080
47081 /**
47082  * Set this feature as required.
47083  */
47084 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47085
47086 /**
47087  * Checks if this feature is supported.
47088  */
47089 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47090
47091 /**
47092  * Checks if this feature is required.
47093  */
47094 MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47095
47096 /**
47097  * Checks if this feature is required.
47098  */
47099 MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47100
47101 /**
47102  * Checks if this feature is required.
47103  */
47104 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47105
47106 /**
47107  * Set this feature as optional.
47108  */
47109 void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47110
47111 /**
47112  * Set this feature as required.
47113  */
47114 void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47115
47116 /**
47117  * Checks if this feature is supported.
47118  */
47119 MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47120
47121 /**
47122  * Set this feature as optional.
47123  */
47124 void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47125
47126 /**
47127  * Set this feature as required.
47128  */
47129 void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47130
47131 /**
47132  * Checks if this feature is supported.
47133  */
47134 MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47135
47136 /**
47137  * Set this feature as optional.
47138  */
47139 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47140
47141 /**
47142  * Set this feature as required.
47143  */
47144 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47145
47146 /**
47147  * Checks if this feature is supported.
47148  */
47149 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47150
47151 /**
47152  * Checks if this feature is required.
47153  */
47154 MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47155
47156 /**
47157  * Checks if this feature is required.
47158  */
47159 MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47160
47161 /**
47162  * Checks if this feature is required.
47163  */
47164 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47165
47166 /**
47167  * Set this feature as optional.
47168  */
47169 void InitFeatures_set_route_blinding_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47170
47171 /**
47172  * Set this feature as required.
47173  */
47174 void InitFeatures_set_route_blinding_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47175
47176 /**
47177  * Checks if this feature is supported.
47178  */
47179 MUST_USE_RES bool InitFeatures_supports_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47180
47181 /**
47182  * Set this feature as optional.
47183  */
47184 void NodeFeatures_set_route_blinding_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47185
47186 /**
47187  * Set this feature as required.
47188  */
47189 void NodeFeatures_set_route_blinding_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47190
47191 /**
47192  * Checks if this feature is supported.
47193  */
47194 MUST_USE_RES bool NodeFeatures_supports_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47195
47196 /**
47197  * Checks if this feature is required.
47198  */
47199 MUST_USE_RES bool InitFeatures_requires_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47200
47201 /**
47202  * Checks if this feature is required.
47203  */
47204 MUST_USE_RES bool NodeFeatures_requires_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47205
47206 /**
47207  * Set this feature as optional.
47208  */
47209 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47210
47211 /**
47212  * Set this feature as required.
47213  */
47214 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47215
47216 /**
47217  * Checks if this feature is supported.
47218  */
47219 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47220
47221 /**
47222  * Set this feature as optional.
47223  */
47224 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47225
47226 /**
47227  * Set this feature as required.
47228  */
47229 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47230
47231 /**
47232  * Checks if this feature is supported.
47233  */
47234 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47235
47236 /**
47237  * Checks if this feature is required.
47238  */
47239 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47240
47241 /**
47242  * Checks if this feature is required.
47243  */
47244 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47245
47246 /**
47247  * Set this feature as optional.
47248  */
47249 void InitFeatures_set_taproot_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47250
47251 /**
47252  * Set this feature as required.
47253  */
47254 void InitFeatures_set_taproot_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47255
47256 /**
47257  * Checks if this feature is supported.
47258  */
47259 MUST_USE_RES bool InitFeatures_supports_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47260
47261 /**
47262  * Set this feature as optional.
47263  */
47264 void NodeFeatures_set_taproot_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47265
47266 /**
47267  * Set this feature as required.
47268  */
47269 void NodeFeatures_set_taproot_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47270
47271 /**
47272  * Checks if this feature is supported.
47273  */
47274 MUST_USE_RES bool NodeFeatures_supports_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47275
47276 /**
47277  * Set this feature as optional.
47278  */
47279 void ChannelTypeFeatures_set_taproot_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47280
47281 /**
47282  * Set this feature as required.
47283  */
47284 void ChannelTypeFeatures_set_taproot_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47285
47286 /**
47287  * Checks if this feature is supported.
47288  */
47289 MUST_USE_RES bool ChannelTypeFeatures_supports_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47290
47291 /**
47292  * Checks if this feature is required.
47293  */
47294 MUST_USE_RES bool InitFeatures_requires_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47295
47296 /**
47297  * Checks if this feature is required.
47298  */
47299 MUST_USE_RES bool NodeFeatures_requires_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47300
47301 /**
47302  * Checks if this feature is required.
47303  */
47304 MUST_USE_RES bool ChannelTypeFeatures_requires_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47305
47306 /**
47307  * Set this feature as optional.
47308  */
47309 void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47310
47311 /**
47312  * Set this feature as required.
47313  */
47314 void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47315
47316 /**
47317  * Checks if this feature is supported.
47318  */
47319 MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47320
47321 /**
47322  * Set this feature as optional.
47323  */
47324 void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47325
47326 /**
47327  * Set this feature as required.
47328  */
47329 void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47330
47331 /**
47332  * Checks if this feature is supported.
47333  */
47334 MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47335
47336 /**
47337  * Checks if this feature is required.
47338  */
47339 MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47340
47341 /**
47342  * Checks if this feature is required.
47343  */
47344 MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47345
47346 /**
47347  * Set this feature as optional.
47348  */
47349 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47350
47351 /**
47352  * Set this feature as required.
47353  */
47354 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47355
47356 /**
47357  * Checks if this feature is supported.
47358  */
47359 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47360
47361 /**
47362  * Set this feature as optional.
47363  */
47364 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47365
47366 /**
47367  * Set this feature as required.
47368  */
47369 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47370
47371 /**
47372  * Checks if this feature is supported.
47373  */
47374 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47375
47376 /**
47377  * Checks if this feature is required.
47378  */
47379 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47380
47381 /**
47382  * Checks if this feature is required.
47383  */
47384 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47385
47386 /**
47387  * Set this feature as optional.
47388  */
47389 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47390
47391 /**
47392  * Set this feature as required.
47393  */
47394 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47395
47396 /**
47397  * Checks if this feature is supported.
47398  */
47399 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47400
47401 /**
47402  * Set this feature as optional.
47403  */
47404 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47405
47406 /**
47407  * Set this feature as required.
47408  */
47409 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47410
47411 /**
47412  * Checks if this feature is supported.
47413  */
47414 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47415
47416 /**
47417  * Set this feature as optional.
47418  */
47419 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47420
47421 /**
47422  * Set this feature as required.
47423  */
47424 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47425
47426 /**
47427  * Checks if this feature is supported.
47428  */
47429 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47430
47431 /**
47432  * Checks if this feature is required.
47433  */
47434 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47435
47436 /**
47437  * Checks if this feature is required.
47438  */
47439 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47440
47441 /**
47442  * Checks if this feature is required.
47443  */
47444 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47445
47446 /**
47447  * Set this feature as optional.
47448  */
47449 void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47450
47451 /**
47452  * Set this feature as required.
47453  */
47454 void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47455
47456 /**
47457  * Checks if this feature is supported.
47458  */
47459 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47460
47461 /**
47462  * Checks if this feature is required.
47463  */
47464 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47465
47466 /**
47467  * Set this feature as optional.
47468  */
47469 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47470
47471 /**
47472  * Set this feature as required.
47473  */
47474 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47475
47476 /**
47477  * Checks if this feature is supported.
47478  */
47479 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47480
47481 /**
47482  * Set this feature as optional.
47483  */
47484 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47485
47486 /**
47487  * Set this feature as required.
47488  */
47489 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47490
47491 /**
47492  * Checks if this feature is supported.
47493  */
47494 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47495
47496 /**
47497  * Set this feature as optional.
47498  */
47499 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47500
47501 /**
47502  * Set this feature as required.
47503  */
47504 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47505
47506 /**
47507  * Checks if this feature is supported.
47508  */
47509 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47510
47511 /**
47512  * Checks if this feature is required.
47513  */
47514 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47515
47516 /**
47517  * Checks if this feature is required.
47518  */
47519 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47520
47521 /**
47522  * Checks if this feature is required.
47523  */
47524 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
47525
47526 /**
47527  * Set this feature as optional.
47528  */
47529 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47530
47531 /**
47532  * Set this feature as required.
47533  */
47534 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47535
47536 /**
47537  * Checks if this feature is supported.
47538  */
47539 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47540
47541 /**
47542  * Checks if this feature is required.
47543  */
47544 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47545
47546 /**
47547  * Set this feature as optional.
47548  */
47549 void InitFeatures_set_trampoline_routing_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
47550
47551 /**
47552  * Set this feature as required.
47553  */
47554 void InitFeatures_set_trampoline_routing_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
47555
47556 /**
47557  * Checks if this feature is supported.
47558  */
47559 MUST_USE_RES bool InitFeatures_supports_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47560
47561 /**
47562  * Set this feature as optional.
47563  */
47564 void NodeFeatures_set_trampoline_routing_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47565
47566 /**
47567  * Set this feature as required.
47568  */
47569 void NodeFeatures_set_trampoline_routing_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
47570
47571 /**
47572  * Checks if this feature is supported.
47573  */
47574 MUST_USE_RES bool NodeFeatures_supports_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47575
47576 /**
47577  * Set this feature as optional.
47578  */
47579 void Bolt11InvoiceFeatures_set_trampoline_routing_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47580
47581 /**
47582  * Set this feature as required.
47583  */
47584 void Bolt11InvoiceFeatures_set_trampoline_routing_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47585
47586 /**
47587  * Checks if this feature is supported.
47588  */
47589 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47590
47591 /**
47592  * Checks if this feature is required.
47593  */
47594 MUST_USE_RES bool InitFeatures_requires_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg);
47595
47596 /**
47597  * Checks if this feature is required.
47598  */
47599 MUST_USE_RES bool NodeFeatures_requires_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
47600
47601 /**
47602  * Checks if this feature is required.
47603  */
47604 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
47605
47606 /**
47607  * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
47608  */
47609 void ShutdownScript_free(struct LDKShutdownScript this_obj);
47610
47611 /**
47612  * Creates a copy of the ShutdownScript
47613  */
47614 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
47615
47616 /**
47617  * Checks if two ShutdownScripts contain equal inner contents.
47618  * This ignores pointers and is_owned flags and looks at the values in fields.
47619  * Two objects with NULL inner values will be considered "equal" here.
47620  */
47621 bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
47622
47623 /**
47624  * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
47625  */
47626 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
47627
47628 /**
47629  * The script that did not meet the requirements from [BOLT #2].
47630  *
47631  * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
47632  */
47633 struct LDKCVec_u8Z InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
47634
47635 /**
47636  * The script that did not meet the requirements from [BOLT #2].
47637  *
47638  * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
47639  */
47640 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
47641
47642 /**
47643  * Constructs a new InvalidShutdownScript given each field
47644  */
47645 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
47646
47647 /**
47648  * Creates a copy of the InvalidShutdownScript
47649  */
47650 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
47651
47652 /**
47653  * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
47654  */
47655 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
47656
47657 /**
47658  * Read a ShutdownScript from a byte array, created by ShutdownScript_write
47659  */
47660 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
47661
47662 /**
47663  * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
47664  */
47665 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
47666
47667 /**
47668  * Generates a P2WSH script pubkey from the given [`WScriptHash`].
47669  */
47670 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
47671
47672 /**
47673  * Generates a witness script pubkey from the given segwit version and program.
47674  *
47675  * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
47676  * [`ShutdownScript::new_p2wsh`] instead.
47677  *
47678  * # Errors
47679  *
47680  * This function may return an error if `program` is invalid for the segwit `version`.
47681  */
47682 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessProgram witness_program);
47683
47684 /**
47685  * Converts the shutdown script into the underlying [`ScriptBuf`].
47686  */
47687 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
47688
47689 /**
47690  * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
47691  *
47692  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47693  */
47694 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
47695
47696 /**
47697  * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
47698  *
47699  * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
47700  */
47701 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
47702
47703 /**
47704  * Get the string representation of a ShutdownScript object
47705  */
47706 struct LDKStr ShutdownScript_to_str(const struct LDKShutdownScript *NONNULL_PTR o);
47707
47708 /**
47709  * Frees any resources used by the ChannelId, if is_owned is set and inner is non-NULL.
47710  */
47711 void ChannelId_free(struct LDKChannelId this_obj);
47712
47713 const uint8_t (*ChannelId_get_a(const struct LDKChannelId *NONNULL_PTR this_ptr))[32];
47714
47715 void ChannelId_set_a(struct LDKChannelId *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
47716
47717 /**
47718  * Constructs a new ChannelId given each field
47719  */
47720 MUST_USE_RES struct LDKChannelId ChannelId_new(struct LDKThirtyTwoBytes a_arg);
47721
47722 /**
47723  * Creates a copy of the ChannelId
47724  */
47725 struct LDKChannelId ChannelId_clone(const struct LDKChannelId *NONNULL_PTR orig);
47726
47727 /**
47728  * Checks if two ChannelIds contain equal inner contents.
47729  * This ignores pointers and is_owned flags and looks at the values in fields.
47730  * Two objects with NULL inner values will be considered "equal" here.
47731  */
47732 bool ChannelId_eq(const struct LDKChannelId *NONNULL_PTR a, const struct LDKChannelId *NONNULL_PTR b);
47733
47734 /**
47735  * Generates a non-cryptographic 64-bit hash of the ChannelId.
47736  */
47737 uint64_t ChannelId_hash(const struct LDKChannelId *NONNULL_PTR o);
47738
47739 /**
47740  * Create _v1_ channel ID based on a funding TX ID and output index
47741  */
47742 MUST_USE_RES struct LDKChannelId ChannelId_v1_from_funding_txid(const uint8_t (*txid)[32], uint16_t output_index);
47743
47744 /**
47745  * Create _v1_ channel ID from a funding tx outpoint
47746  */
47747 MUST_USE_RES struct LDKChannelId ChannelId_v1_from_funding_outpoint(struct LDKOutPoint outpoint);
47748
47749 /**
47750  * Create a _temporary_ channel ID randomly, based on an entropy source.
47751  */
47752 MUST_USE_RES struct LDKChannelId ChannelId_temporary_from_entropy_source(const struct LDKEntropySource *NONNULL_PTR entropy_source);
47753
47754 /**
47755  * Generic constructor; create a new channel ID from the provided data.
47756  * Use a more specific `*_from_*` constructor when possible.
47757  */
47758 MUST_USE_RES struct LDKChannelId ChannelId_from_bytes(struct LDKThirtyTwoBytes data);
47759
47760 /**
47761  * Create a channel ID consisting of all-zeros data (e.g. when uninitialized or a placeholder).
47762  */
47763 MUST_USE_RES struct LDKChannelId ChannelId_new_zero(void);
47764
47765 /**
47766  * Check whether ID is consisting of all zeros (uninitialized)
47767  */
47768 MUST_USE_RES bool ChannelId_is_zero(const struct LDKChannelId *NONNULL_PTR this_arg);
47769
47770 /**
47771  * Create _v2_ channel ID by concatenating the holder revocation basepoint with the counterparty
47772  * revocation basepoint and hashing the result. The basepoints will be concatenated in increasing
47773  * sorted order.
47774  */
47775 MUST_USE_RES struct LDKChannelId ChannelId_v2_from_revocation_basepoints(const struct LDKRevocationBasepoint *NONNULL_PTR ours, const struct LDKRevocationBasepoint *NONNULL_PTR theirs);
47776
47777 /**
47778  * Create temporary _v2_ channel ID by concatenating a zeroed out basepoint with the holder
47779  * revocation basepoint and hashing the result.
47780  */
47781 MUST_USE_RES struct LDKChannelId ChannelId_temporary_v2_from_revocation_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR our_revocation_basepoint);
47782
47783 /**
47784  * Serialize the ChannelId object into a byte array which can be read by ChannelId_read
47785  */
47786 struct LDKCVec_u8Z ChannelId_write(const struct LDKChannelId *NONNULL_PTR obj);
47787
47788 /**
47789  * Read a ChannelId from a byte array, created by ChannelId_write
47790  */
47791 struct LDKCResult_ChannelIdDecodeErrorZ ChannelId_read(struct LDKu8slice ser);
47792
47793 /**
47794  * Get the string representation of a ChannelId object
47795  */
47796 struct LDKStr ChannelId_to_str(const struct LDKChannelId *NONNULL_PTR o);
47797
47798 /**
47799  * Frees any resources used by the Retry
47800  */
47801 void Retry_free(struct LDKRetry this_ptr);
47802
47803 /**
47804  * Creates a copy of the Retry
47805  */
47806 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
47807
47808 /**
47809  * Utility method to constructs a new Attempts-variant Retry
47810  */
47811 struct LDKRetry Retry_attempts(uint32_t a);
47812
47813 /**
47814  * Utility method to constructs a new Timeout-variant Retry
47815  */
47816 struct LDKRetry Retry_timeout(uint64_t a);
47817
47818 /**
47819  * Checks if two Retrys contain equal inner contents.
47820  * This ignores pointers and is_owned flags and looks at the values in fields.
47821  */
47822 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
47823
47824 /**
47825  * Generates a non-cryptographic 64-bit hash of the Retry.
47826  */
47827 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
47828
47829 /**
47830  * Serialize the Retry object into a byte array which can be read by Retry_read
47831  */
47832 struct LDKCVec_u8Z Retry_write(const struct LDKRetry *NONNULL_PTR obj);
47833
47834 /**
47835  * Read a Retry from a byte array, created by Retry_write
47836  */
47837 struct LDKCResult_RetryDecodeErrorZ Retry_read(struct LDKu8slice ser);
47838
47839 /**
47840  * Creates a copy of the RetryableSendFailure
47841  */
47842 enum LDKRetryableSendFailure RetryableSendFailure_clone(const enum LDKRetryableSendFailure *NONNULL_PTR orig);
47843
47844 /**
47845  * Utility method to constructs a new PaymentExpired-variant RetryableSendFailure
47846  */
47847 enum LDKRetryableSendFailure RetryableSendFailure_payment_expired(void);
47848
47849 /**
47850  * Utility method to constructs a new RouteNotFound-variant RetryableSendFailure
47851  */
47852 enum LDKRetryableSendFailure RetryableSendFailure_route_not_found(void);
47853
47854 /**
47855  * Utility method to constructs a new DuplicatePayment-variant RetryableSendFailure
47856  */
47857 enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void);
47858
47859 /**
47860  * Checks if two RetryableSendFailures contain equal inner contents.
47861  * This ignores pointers and is_owned flags and looks at the values in fields.
47862  */
47863 bool RetryableSendFailure_eq(const enum LDKRetryableSendFailure *NONNULL_PTR a, const enum LDKRetryableSendFailure *NONNULL_PTR b);
47864
47865 /**
47866  * Frees any resources used by the PaymentSendFailure
47867  */
47868 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
47869
47870 /**
47871  * Creates a copy of the PaymentSendFailure
47872  */
47873 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
47874
47875 /**
47876  * Utility method to constructs a new ParameterError-variant PaymentSendFailure
47877  */
47878 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
47879
47880 /**
47881  * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
47882  */
47883 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
47884
47885 /**
47886  * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
47887  */
47888 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a);
47889
47890 /**
47891  * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
47892  */
47893 struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void);
47894
47895 /**
47896  * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
47897  */
47898 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
47899
47900 /**
47901  * Checks if two PaymentSendFailures contain equal inner contents.
47902  * This ignores pointers and is_owned flags and looks at the values in fields.
47903  */
47904 bool PaymentSendFailure_eq(const struct LDKPaymentSendFailure *NONNULL_PTR a, const struct LDKPaymentSendFailure *NONNULL_PTR b);
47905
47906 /**
47907  * Frees any resources used by the ProbeSendFailure
47908  */
47909 void ProbeSendFailure_free(struct LDKProbeSendFailure this_ptr);
47910
47911 /**
47912  * Creates a copy of the ProbeSendFailure
47913  */
47914 struct LDKProbeSendFailure ProbeSendFailure_clone(const struct LDKProbeSendFailure *NONNULL_PTR orig);
47915
47916 /**
47917  * Utility method to constructs a new RouteNotFound-variant ProbeSendFailure
47918  */
47919 struct LDKProbeSendFailure ProbeSendFailure_route_not_found(void);
47920
47921 /**
47922  * Utility method to constructs a new SendingFailed-variant ProbeSendFailure
47923  */
47924 struct LDKProbeSendFailure ProbeSendFailure_sending_failed(struct LDKPaymentSendFailure a);
47925
47926 /**
47927  * Checks if two ProbeSendFailures contain equal inner contents.
47928  * This ignores pointers and is_owned flags and looks at the values in fields.
47929  */
47930 bool ProbeSendFailure_eq(const struct LDKProbeSendFailure *NONNULL_PTR a, const struct LDKProbeSendFailure *NONNULL_PTR b);
47931
47932 /**
47933  * Frees any resources used by the RecipientOnionFields, if is_owned is set and inner is non-NULL.
47934  */
47935 void RecipientOnionFields_free(struct LDKRecipientOnionFields this_obj);
47936
47937 /**
47938  * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
47939  * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
47940  * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
47941  * attacks.
47942  *
47943  * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
47944  * multi-path payments require a recipient-provided secret.
47945  *
47946  * Some implementations may reject spontaneous payments with payment secrets, so you may only
47947  * want to provide a secret for a spontaneous payment if MPP is needed and you know your
47948  * recipient will not reject it.
47949  */
47950 struct LDKCOption_ThirtyTwoBytesZ RecipientOnionFields_get_payment_secret(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
47951
47952 /**
47953  * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
47954  * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
47955  * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
47956  * attacks.
47957  *
47958  * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
47959  * multi-path payments require a recipient-provided secret.
47960  *
47961  * Some implementations may reject spontaneous payments with payment secrets, so you may only
47962  * want to provide a secret for a spontaneous payment if MPP is needed and you know your
47963  * recipient will not reject it.
47964  */
47965 void RecipientOnionFields_set_payment_secret(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
47966
47967 /**
47968  * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
47969  * arbitrary length. This gives recipients substantially more flexibility to receive
47970  * additional data.
47971  *
47972  * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
47973  * scheme to authenticate received payments against expected payments and invoices, this field
47974  * is not used in LDK for received payments, and can be used to store arbitrary data in
47975  * invoices which will be received with the payment.
47976  *
47977  * Note that this field was added to the lightning specification more recently than
47978  * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
47979  * may not be supported as universally.
47980  *
47981  * Returns a copy of the field.
47982  */
47983 struct LDKCOption_CVec_u8ZZ RecipientOnionFields_get_payment_metadata(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
47984
47985 /**
47986  * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
47987  * arbitrary length. This gives recipients substantially more flexibility to receive
47988  * additional data.
47989  *
47990  * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
47991  * scheme to authenticate received payments against expected payments and invoices, this field
47992  * is not used in LDK for received payments, and can be used to store arbitrary data in
47993  * invoices which will be received with the payment.
47994  *
47995  * Note that this field was added to the lightning specification more recently than
47996  * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
47997  * may not be supported as universally.
47998  */
47999 void RecipientOnionFields_set_payment_metadata(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
48000
48001 /**
48002  * Creates a copy of the RecipientOnionFields
48003  */
48004 struct LDKRecipientOnionFields RecipientOnionFields_clone(const struct LDKRecipientOnionFields *NONNULL_PTR orig);
48005
48006 /**
48007  * Checks if two RecipientOnionFieldss contain equal inner contents.
48008  * This ignores pointers and is_owned flags and looks at the values in fields.
48009  * Two objects with NULL inner values will be considered "equal" here.
48010  */
48011 bool RecipientOnionFields_eq(const struct LDKRecipientOnionFields *NONNULL_PTR a, const struct LDKRecipientOnionFields *NONNULL_PTR b);
48012
48013 /**
48014  * Serialize the RecipientOnionFields object into a byte array which can be read by RecipientOnionFields_read
48015  */
48016 struct LDKCVec_u8Z RecipientOnionFields_write(const struct LDKRecipientOnionFields *NONNULL_PTR obj);
48017
48018 /**
48019  * Read a RecipientOnionFields from a byte array, created by RecipientOnionFields_write
48020  */
48021 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ RecipientOnionFields_read(struct LDKu8slice ser);
48022
48023 /**
48024  * Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common
48025  * set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`]
48026  * but do not require or provide any further data.
48027  */
48028 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_secret_only(struct LDKThirtyTwoBytes payment_secret);
48029
48030 /**
48031  * Creates a new [`RecipientOnionFields`] with no fields. This generally does not create
48032  * payable HTLCs except for single-path spontaneous payments, i.e. this should generally
48033  * only be used for calls to [`ChannelManager::send_spontaneous_payment`]. If you are sending
48034  * a spontaneous MPP this will not work as all MPP require payment secrets; you may
48035  * instead want to use [`RecipientOnionFields::secret_only`].
48036  *
48037  * [`ChannelManager::send_spontaneous_payment`]: super::channelmanager::ChannelManager::send_spontaneous_payment
48038  * [`RecipientOnionFields::secret_only`]: RecipientOnionFields::secret_only
48039  */
48040 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_spontaneous_empty(void);
48041
48042 /**
48043  * Creates a new [`RecipientOnionFields`] from an existing one, adding custom TLVs. Each
48044  * TLV is provided as a `(u64, Vec<u8>)` for the type number and serialized value
48045  * respectively. TLV type numbers must be unique and within the range
48046  * reserved for custom types, i.e. >= 2^16, otherwise this method will return `Err(())`.
48047  *
48048  * This method will also error for types in the experimental range which have been
48049  * standardized within the protocol, which only includes 5482373484 (keysend) for now.
48050  *
48051  * See [`Self::custom_tlvs`] for more info.
48052  */
48053 MUST_USE_RES struct LDKCResult_RecipientOnionFieldsNoneZ RecipientOnionFields_with_custom_tlvs(struct LDKRecipientOnionFields this_arg, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs);
48054
48055 /**
48056  * Gets the custom TLVs that will be sent or have been received.
48057  *
48058  * Custom TLVs allow sending extra application-specific data with a payment. They provide
48059  * additional flexibility on top of payment metadata, as while other implementations may
48060  * require `payment_metadata` to reflect metadata provided in an invoice, custom TLVs
48061  * do not have this restriction.
48062  *
48063  * Note that if this field is non-empty, it will contain strictly increasing TLVs, each
48064  * represented by a `(u64, Vec<u8>)` for its type number and serialized value respectively.
48065  * This is validated when setting this field using [`Self::with_custom_tlvs`].
48066  */
48067 MUST_USE_RES struct LDKCVec_C2Tuple_u64CVec_u8ZZZ RecipientOnionFields_custom_tlvs(const struct LDKRecipientOnionFields *NONNULL_PTR this_arg);
48068
48069 /**
48070  * Calls the free function if one is set
48071  */
48072 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
48073
48074 /**
48075  * Creates a copy of a Type
48076  */
48077 struct LDKType Type_clone(const struct LDKType *NONNULL_PTR orig);
48078
48079 /**
48080  * Calls the free function if one is set
48081  */
48082 void Type_free(struct LDKType this_ptr);
48083
48084 /**
48085  * Frees any resources used by the OfferId, if is_owned is set and inner is non-NULL.
48086  */
48087 void OfferId_free(struct LDKOfferId this_obj);
48088
48089 const uint8_t (*OfferId_get_a(const struct LDKOfferId *NONNULL_PTR this_ptr))[32];
48090
48091 void OfferId_set_a(struct LDKOfferId *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
48092
48093 /**
48094  * Constructs a new OfferId given each field
48095  */
48096 MUST_USE_RES struct LDKOfferId OfferId_new(struct LDKThirtyTwoBytes a_arg);
48097
48098 /**
48099  * Creates a copy of the OfferId
48100  */
48101 struct LDKOfferId OfferId_clone(const struct LDKOfferId *NONNULL_PTR orig);
48102
48103 /**
48104  * Checks if two OfferIds contain equal inner contents.
48105  * This ignores pointers and is_owned flags and looks at the values in fields.
48106  * Two objects with NULL inner values will be considered "equal" here.
48107  */
48108 bool OfferId_eq(const struct LDKOfferId *NONNULL_PTR a, const struct LDKOfferId *NONNULL_PTR b);
48109
48110 /**
48111  * Serialize the OfferId object into a byte array which can be read by OfferId_read
48112  */
48113 struct LDKCVec_u8Z OfferId_write(const struct LDKOfferId *NONNULL_PTR obj);
48114
48115 /**
48116  * Read a OfferId from a byte array, created by OfferId_write
48117  */
48118 struct LDKCResult_OfferIdDecodeErrorZ OfferId_read(struct LDKu8slice ser);
48119
48120 /**
48121  * Frees any resources used by the OfferWithExplicitMetadataBuilder, if is_owned is set and inner is non-NULL.
48122  */
48123 void OfferWithExplicitMetadataBuilder_free(struct LDKOfferWithExplicitMetadataBuilder this_obj);
48124
48125 /**
48126  * Creates a copy of the OfferWithExplicitMetadataBuilder
48127  */
48128 struct LDKOfferWithExplicitMetadataBuilder OfferWithExplicitMetadataBuilder_clone(const struct LDKOfferWithExplicitMetadataBuilder *NONNULL_PTR orig);
48129
48130 /**
48131  * Frees any resources used by the OfferWithDerivedMetadataBuilder, if is_owned is set and inner is non-NULL.
48132  */
48133 void OfferWithDerivedMetadataBuilder_free(struct LDKOfferWithDerivedMetadataBuilder this_obj);
48134
48135 /**
48136  * Creates a copy of the OfferWithDerivedMetadataBuilder
48137  */
48138 struct LDKOfferWithDerivedMetadataBuilder OfferWithDerivedMetadataBuilder_clone(const struct LDKOfferWithDerivedMetadataBuilder *NONNULL_PTR orig);
48139
48140 /**
48141  * Creates a new builder for an offer using the [`Offer::signing_pubkey`] for signing invoices.
48142  * The associated secret key must be remembered while the offer is valid.
48143  *
48144  * Use a different pubkey per offer to avoid correlating offers.
48145  *
48146  * # Note
48147  *
48148  * If constructing an [`Offer`] for use with a [`ChannelManager`], use
48149  * [`ChannelManager::create_offer_builder`] instead of [`OfferBuilder::new`].
48150  *
48151  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
48152  * [`ChannelManager::create_offer_builder`]: crate::ln::channelmanager::ChannelManager::create_offer_builder
48153  */
48154 MUST_USE_RES struct LDKOfferWithExplicitMetadataBuilder OfferWithExplicitMetadataBuilder_new(struct LDKPublicKey signing_pubkey);
48155
48156 /**
48157  * Sets the [`Offer::metadata`] to the given bytes.
48158  *
48159  * Successive calls to this method will override the previous setting.
48160  */
48161 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ OfferWithExplicitMetadataBuilder_metadata(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKCVec_u8Z metadata);
48162
48163 /**
48164  * Adds the chain hash of the given [`Network`] to [`Offer::chains`]. If not called,
48165  * the chain hash of [`Network::Bitcoin`] is assumed to be the only one supported.
48166  *
48167  * See [`Offer::chains`] on how this relates to the payment currency.
48168  *
48169  * Successive calls to this method will add another chain hash.
48170  */
48171 MUST_USE_RES void OfferWithExplicitMetadataBuilder_chain(struct LDKOfferWithExplicitMetadataBuilder this_arg, enum LDKNetwork network);
48172
48173 /**
48174  * Sets the [`Offer::amount`] as an [`Amount::Bitcoin`].
48175  *
48176  * Successive calls to this method will override the previous setting.
48177  */
48178 MUST_USE_RES void OfferWithExplicitMetadataBuilder_amount_msats(struct LDKOfferWithExplicitMetadataBuilder this_arg, uint64_t amount_msats);
48179
48180 /**
48181  * Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
48182  * already passed is valid and can be checked for using [`Offer::is_expired`].
48183  *
48184  * Successive calls to this method will override the previous setting.
48185  */
48186 MUST_USE_RES void OfferWithExplicitMetadataBuilder_absolute_expiry(struct LDKOfferWithExplicitMetadataBuilder this_arg, uint64_t absolute_expiry);
48187
48188 /**
48189  * Sets the [`Offer::description`].
48190  *
48191  * Successive calls to this method will override the previous setting.
48192  */
48193 MUST_USE_RES void OfferWithExplicitMetadataBuilder_description(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKStr description);
48194
48195 /**
48196  * Sets the [`Offer::issuer`].
48197  *
48198  * Successive calls to this method will override the previous setting.
48199  */
48200 MUST_USE_RES void OfferWithExplicitMetadataBuilder_issuer(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKStr issuer);
48201
48202 /**
48203  * Adds a blinded path to [`Offer::paths`]. Must include at least one path if only connected by
48204  * private channels or if [`Offer::signing_pubkey`] is not a public node id.
48205  *
48206  * Successive calls to this method will add another blinded path. Caller is responsible for not
48207  * adding duplicate paths.
48208  */
48209 MUST_USE_RES void OfferWithExplicitMetadataBuilder_path(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKBlindedPath path);
48210
48211 /**
48212  * Sets the quantity of items for [`Offer::supported_quantity`]. If not called, defaults to
48213  * [`Quantity::One`].
48214  *
48215  * Successive calls to this method will override the previous setting.
48216  */
48217 MUST_USE_RES void OfferWithExplicitMetadataBuilder_supported_quantity(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKQuantity quantity);
48218
48219 /**
48220  * Builds an [`Offer`] from the builder's settings.
48221  */
48222 MUST_USE_RES struct LDKCResult_OfferBolt12SemanticErrorZ OfferWithExplicitMetadataBuilder_build(struct LDKOfferWithExplicitMetadataBuilder this_arg);
48223
48224 /**
48225  * Similar to [`OfferBuilder::new`] except, if [`OfferBuilder::path`] is called, the signing
48226  * pubkey is derived from the given [`ExpandedKey`] and [`EntropySource`]. This provides
48227  * recipient privacy by using a different signing pubkey for each offer. Otherwise, the
48228  * provided `node_id` is used for the signing pubkey.
48229  *
48230  * Also, sets the metadata when [`OfferBuilder::build`] is called such that it can be used by
48231  * [`InvoiceRequest::verify`] to determine if the request was produced for the offer given an
48232  * [`ExpandedKey`].
48233  *
48234  * [`InvoiceRequest::verify`]: crate::offers::invoice_request::InvoiceRequest::verify
48235  * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
48236  */
48237 MUST_USE_RES struct LDKOfferWithDerivedMetadataBuilder OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(struct LDKPublicKey node_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source);
48238
48239 /**
48240  * Adds the chain hash of the given [`Network`] to [`Offer::chains`]. If not called,
48241  * the chain hash of [`Network::Bitcoin`] is assumed to be the only one supported.
48242  *
48243  * See [`Offer::chains`] on how this relates to the payment currency.
48244  *
48245  * Successive calls to this method will add another chain hash.
48246  */
48247 MUST_USE_RES void OfferWithDerivedMetadataBuilder_chain(struct LDKOfferWithDerivedMetadataBuilder this_arg, enum LDKNetwork network);
48248
48249 /**
48250  * Sets the [`Offer::amount`] as an [`Amount::Bitcoin`].
48251  *
48252  * Successive calls to this method will override the previous setting.
48253  */
48254 MUST_USE_RES void OfferWithDerivedMetadataBuilder_amount_msats(struct LDKOfferWithDerivedMetadataBuilder this_arg, uint64_t amount_msats);
48255
48256 /**
48257  * Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
48258  * already passed is valid and can be checked for using [`Offer::is_expired`].
48259  *
48260  * Successive calls to this method will override the previous setting.
48261  */
48262 MUST_USE_RES void OfferWithDerivedMetadataBuilder_absolute_expiry(struct LDKOfferWithDerivedMetadataBuilder this_arg, uint64_t absolute_expiry);
48263
48264 /**
48265  * Sets the [`Offer::description`].
48266  *
48267  * Successive calls to this method will override the previous setting.
48268  */
48269 MUST_USE_RES void OfferWithDerivedMetadataBuilder_description(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKStr description);
48270
48271 /**
48272  * Sets the [`Offer::issuer`].
48273  *
48274  * Successive calls to this method will override the previous setting.
48275  */
48276 MUST_USE_RES void OfferWithDerivedMetadataBuilder_issuer(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKStr issuer);
48277
48278 /**
48279  * Adds a blinded path to [`Offer::paths`]. Must include at least one path if only connected by
48280  * private channels or if [`Offer::signing_pubkey`] is not a public node id.
48281  *
48282  * Successive calls to this method will add another blinded path. Caller is responsible for not
48283  * adding duplicate paths.
48284  */
48285 MUST_USE_RES void OfferWithDerivedMetadataBuilder_path(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKBlindedPath path);
48286
48287 /**
48288  * Sets the quantity of items for [`Offer::supported_quantity`]. If not called, defaults to
48289  * [`Quantity::One`].
48290  *
48291  * Successive calls to this method will override the previous setting.
48292  */
48293 MUST_USE_RES void OfferWithDerivedMetadataBuilder_supported_quantity(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKQuantity quantity);
48294
48295 /**
48296  * Builds an [`Offer`] from the builder's settings.
48297  */
48298 MUST_USE_RES struct LDKCResult_OfferBolt12SemanticErrorZ OfferWithDerivedMetadataBuilder_build(struct LDKOfferWithDerivedMetadataBuilder this_arg);
48299
48300 /**
48301  * Frees any resources used by the Offer, if is_owned is set and inner is non-NULL.
48302  */
48303 void Offer_free(struct LDKOffer this_obj);
48304
48305 /**
48306  * Creates a copy of the Offer
48307  */
48308 struct LDKOffer Offer_clone(const struct LDKOffer *NONNULL_PTR orig);
48309
48310 /**
48311  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
48312  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
48313  * for the selected chain.
48314  */
48315 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ Offer_chains(const struct LDKOffer *NONNULL_PTR this_arg);
48316
48317 /**
48318  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
48319  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
48320  */
48321 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Offer_metadata(const struct LDKOffer *NONNULL_PTR this_arg);
48322
48323 /**
48324  * The minimum amount required for a successful payment of a single item.
48325  */
48326 MUST_USE_RES struct LDKCOption_AmountZ Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg);
48327
48328 /**
48329  * A complete description of the purpose of the payment. Intended to be displayed to the user
48330  * but with the caveat that it has not been verified in any way.
48331  *
48332  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48333  */
48334 MUST_USE_RES struct LDKPrintableString Offer_description(const struct LDKOffer *NONNULL_PTR this_arg);
48335
48336 /**
48337  * Features pertaining to the offer.
48338  */
48339 MUST_USE_RES struct LDKOfferFeatures Offer_offer_features(const struct LDKOffer *NONNULL_PTR this_arg);
48340
48341 /**
48342  * Duration since the Unix epoch when an invoice should no longer be requested.
48343  *
48344  * If `None`, the offer does not expire.
48345  */
48346 MUST_USE_RES struct LDKCOption_u64Z Offer_absolute_expiry(const struct LDKOffer *NONNULL_PTR this_arg);
48347
48348 /**
48349  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
48350  * displayed to the user but with the caveat that it has not been verified in any way.
48351  *
48352  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48353  */
48354 MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg);
48355
48356 /**
48357  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
48358  * recipient privacy by obfuscating its node id.
48359  */
48360 MUST_USE_RES struct LDKCVec_BlindedPathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg);
48361
48362 /**
48363  * The quantity of items supported.
48364  */
48365 MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
48366
48367 /**
48368  * The public key used by the recipient to sign invoices.
48369  *
48370  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48371  */
48372 MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg);
48373
48374 /**
48375  * Returns the id of the offer.
48376  */
48377 MUST_USE_RES struct LDKOfferId Offer_id(const struct LDKOffer *NONNULL_PTR this_arg);
48378
48379 /**
48380  * Returns whether the given chain is supported by the offer.
48381  */
48382 MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain);
48383
48384 /**
48385  * Whether the offer has expired.
48386  */
48387 MUST_USE_RES bool Offer_is_expired(const struct LDKOffer *NONNULL_PTR this_arg);
48388
48389 /**
48390  * Whether the offer has expired given the duration since the Unix epoch.
48391  */
48392 MUST_USE_RES bool Offer_is_expired_no_std(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
48393
48394 /**
48395  * Returns whether the given quantity is valid for the offer.
48396  */
48397 MUST_USE_RES bool Offer_is_valid_quantity(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t quantity);
48398
48399 /**
48400  * Returns whether a quantity is expected in an [`InvoiceRequest`] for the offer.
48401  *
48402  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
48403  */
48404 MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
48405
48406 /**
48407  * Similar to [`Offer::request_invoice`] except it:
48408  * - derives the [`InvoiceRequest::payer_id`] such that a different key can be used for each
48409  *   request,
48410  * - sets [`InvoiceRequest::payer_metadata`] when [`InvoiceRequestBuilder::build`] is called
48411  *   such that it can be used by [`Bolt12Invoice::verify`] to determine if the invoice was
48412  *   requested using a base [`ExpandedKey`] from which the payer id was derived, and
48413  * - includes the [`PaymentId`] encrypted in [`InvoiceRequest::payer_metadata`] so that it can
48414  *   be used when sending the payment for the requested invoice.
48415  *
48416  * Useful to protect the sender's privacy.
48417  *
48418  * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id
48419  * [`InvoiceRequest::payer_metadata`]: crate::offers::invoice_request::InvoiceRequest::payer_metadata
48420  * [`Bolt12Invoice::verify`]: crate::offers::invoice::Bolt12Invoice::verify
48421  * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
48422  */
48423 MUST_USE_RES struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice_deriving_payer_id(const struct LDKOffer *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source, struct LDKThirtyTwoBytes payment_id);
48424
48425 /**
48426  * Similar to [`Offer::request_invoice_deriving_payer_id`] except uses `payer_id` for the
48427  * [`InvoiceRequest::payer_id`] instead of deriving a different key for each request.
48428  *
48429  * Useful for recurring payments using the same `payer_id` with different invoices.
48430  *
48431  * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id
48432  */
48433 MUST_USE_RES struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice_deriving_metadata(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKPublicKey payer_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source, struct LDKThirtyTwoBytes payment_id);
48434
48435 /**
48436  * Creates an [`InvoiceRequestBuilder`] for the offer with the given `metadata` and `payer_id`,
48437  * which will be reflected in the `Bolt12Invoice` response.
48438  *
48439  * The `metadata` is useful for including information about the derivation of `payer_id` such
48440  * that invoice response handling can be stateless. Also serves as payer-provided entropy while
48441  * hashing in the signature calculation.
48442  *
48443  * This should not leak any information such as by using a simple BIP-32 derivation path.
48444  * Otherwise, payments may be correlated.
48445  *
48446  * Errors if the offer contains unknown required features.
48447  *
48448  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
48449  */
48450 MUST_USE_RES struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id);
48451
48452 /**
48453  * Generates a non-cryptographic 64-bit hash of the Offer.
48454  */
48455 uint64_t Offer_hash(const struct LDKOffer *NONNULL_PTR o);
48456
48457 /**
48458  * Serialize the Offer object into a byte array which can be read by Offer_read
48459  */
48460 struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj);
48461
48462 /**
48463  * Frees any resources used by the Amount
48464  */
48465 void Amount_free(struct LDKAmount this_ptr);
48466
48467 /**
48468  * Creates a copy of the Amount
48469  */
48470 struct LDKAmount Amount_clone(const struct LDKAmount *NONNULL_PTR orig);
48471
48472 /**
48473  * Utility method to constructs a new Bitcoin-variant Amount
48474  */
48475 struct LDKAmount Amount_bitcoin(uint64_t amount_msats);
48476
48477 /**
48478  * Utility method to constructs a new Currency-variant Amount
48479  */
48480 struct LDKAmount Amount_currency(struct LDKThreeBytes iso4217_code, uint64_t amount);
48481
48482 /**
48483  * Frees any resources used by the Quantity
48484  */
48485 void Quantity_free(struct LDKQuantity this_ptr);
48486
48487 /**
48488  * Creates a copy of the Quantity
48489  */
48490 struct LDKQuantity Quantity_clone(const struct LDKQuantity *NONNULL_PTR orig);
48491
48492 /**
48493  * Utility method to constructs a new Bounded-variant Quantity
48494  */
48495 struct LDKQuantity Quantity_bounded(uint64_t a);
48496
48497 /**
48498  * Utility method to constructs a new Unbounded-variant Quantity
48499  */
48500 struct LDKQuantity Quantity_unbounded(void);
48501
48502 /**
48503  * Utility method to constructs a new One-variant Quantity
48504  */
48505 struct LDKQuantity Quantity_one(void);
48506
48507 /**
48508  * Read a Offer object from a string
48509  */
48510 struct LDKCResult_OfferBolt12ParseErrorZ Offer_from_str(struct LDKStr s);
48511
48512 /**
48513  * Get the string representation of a Offer object
48514  */
48515 struct LDKStr Offer_to_str(const struct LDKOffer *NONNULL_PTR o);
48516
48517 /**
48518  * Frees any resources used by the InvoiceWithExplicitSigningPubkeyBuilder, if is_owned is set and inner is non-NULL.
48519  */
48520 void InvoiceWithExplicitSigningPubkeyBuilder_free(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_obj);
48521
48522 /**
48523  * Frees any resources used by the InvoiceWithDerivedSigningPubkeyBuilder, if is_owned is set and inner is non-NULL.
48524  */
48525 void InvoiceWithDerivedSigningPubkeyBuilder_free(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_obj);
48526
48527 /**
48528  * Builds an unsigned [`Bolt12Invoice`] after checking for valid semantics. It can be signed by
48529  * [`UnsignedBolt12Invoice::sign`].
48530  */
48531 MUST_USE_RES struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ InvoiceWithExplicitSigningPubkeyBuilder_build(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg);
48532
48533 /**
48534  * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`].
48535  * Any expiry that has already passed is valid and can be checked for using
48536  * [`Bolt12Invoice::is_expired`].
48537  *
48538  * Successive calls to this method will override the previous setting.
48539  */
48540 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, uint32_t relative_expiry_secs);
48541
48542 /**
48543  * Adds a P2WSH address to [`Bolt12Invoice::fallbacks`].
48544  *
48545  * Successive calls to this method will add another address. Caller is responsible for not
48546  * adding duplicate addresses and only calling if capable of receiving to P2WSH addresses.
48547  */
48548 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, const uint8_t (*script_hash)[32]);
48549
48550 /**
48551  * Adds a P2WPKH address to [`Bolt12Invoice::fallbacks`].
48552  *
48553  * Successive calls to this method will add another address. Caller is responsible for not
48554  * adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses.
48555  */
48556 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, const uint8_t (*pubkey_hash)[20]);
48557
48558 /**
48559  * Adds a P2TR address to [`Bolt12Invoice::fallbacks`].
48560  *
48561  * Successive calls to this method will add another address. Caller is responsible for not
48562  * adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
48563  */
48564 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, struct LDKTweakedPublicKey output_key);
48565
48566 /**
48567  * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is
48568  * disallowed.
48569  */
48570 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg);
48571
48572 /**
48573  * Builds a signed [`Bolt12Invoice`] after checking for valid semantics.
48574  */
48575 MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg);
48576
48577 /**
48578  * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`].
48579  * Any expiry that has already passed is valid and can be checked for using
48580  * [`Bolt12Invoice::is_expired`].
48581  *
48582  * Successive calls to this method will override the previous setting.
48583  */
48584 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, uint32_t relative_expiry_secs);
48585
48586 /**
48587  * Adds a P2WSH address to [`Bolt12Invoice::fallbacks`].
48588  *
48589  * Successive calls to this method will add another address. Caller is responsible for not
48590  * adding duplicate addresses and only calling if capable of receiving to P2WSH addresses.
48591  */
48592 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, const uint8_t (*script_hash)[32]);
48593
48594 /**
48595  * Adds a P2WPKH address to [`Bolt12Invoice::fallbacks`].
48596  *
48597  * Successive calls to this method will add another address. Caller is responsible for not
48598  * adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses.
48599  */
48600 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, const uint8_t (*pubkey_hash)[20]);
48601
48602 /**
48603  * Adds a P2TR address to [`Bolt12Invoice::fallbacks`].
48604  *
48605  * Successive calls to this method will add another address. Caller is responsible for not
48606  * adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
48607  */
48608 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, struct LDKTweakedPublicKey output_key);
48609
48610 /**
48611  * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is
48612  * disallowed.
48613  */
48614 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg);
48615
48616 /**
48617  * Frees any resources used by the UnsignedBolt12Invoice, if is_owned is set and inner is non-NULL.
48618  */
48619 void UnsignedBolt12Invoice_free(struct LDKUnsignedBolt12Invoice this_obj);
48620
48621 /**
48622  * Creates a copy of the UnsignedBolt12Invoice
48623  */
48624 struct LDKUnsignedBolt12Invoice UnsignedBolt12Invoice_clone(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR orig);
48625
48626 /**
48627  * Calls the free function if one is set
48628  */
48629 void SignBolt12InvoiceFn_free(struct LDKSignBolt12InvoiceFn this_ptr);
48630
48631 /**
48632  * Returns the [`TaggedHash`] of the invoice to sign.
48633  */
48634 MUST_USE_RES struct LDKTaggedHash UnsignedBolt12Invoice_tagged_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48635
48636 /**
48637  * Frees any resources used by the Bolt12Invoice, if is_owned is set and inner is non-NULL.
48638  */
48639 void Bolt12Invoice_free(struct LDKBolt12Invoice this_obj);
48640
48641 /**
48642  * Creates a copy of the Bolt12Invoice
48643  */
48644 struct LDKBolt12Invoice Bolt12Invoice_clone(const struct LDKBolt12Invoice *NONNULL_PTR orig);
48645
48646 /**
48647  * The chains that may be used when paying a requested invoice.
48648  *
48649  * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
48650  *
48651  * [`Offer::chains`]: crate::offers::offer::Offer::chains
48652  */
48653 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ UnsignedBolt12Invoice_offer_chains(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48654
48655 /**
48656  * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
48657  * invoice originated from an offer.
48658  *
48659  * From [`InvoiceRequest::chain`] or [`Refund::chain`].
48660  *
48661  * [`offer_chains`]: Self::offer_chains
48662  * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
48663  */
48664 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_chain(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48665
48666 /**
48667  * Opaque bytes set by the originating [`Offer`].
48668  *
48669  * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
48670  * if the [`Offer`] did not set it.
48671  *
48672  * [`Offer`]: crate::offers::offer::Offer
48673  * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
48674  */
48675 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedBolt12Invoice_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48676
48677 /**
48678  * The minimum amount required for a successful payment of a single item.
48679  *
48680  * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
48681  * the [`Offer`] did not set it.
48682  *
48683  * [`Offer`]: crate::offers::offer::Offer
48684  * [`Offer::amount`]: crate::offers::offer::Offer::amount
48685  */
48686 MUST_USE_RES struct LDKCOption_AmountZ UnsignedBolt12Invoice_amount(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48687
48688 /**
48689  * Features pertaining to the originating [`Offer`].
48690  *
48691  * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
48692  * [`Refund`].
48693  *
48694  * [`Offer`]: crate::offers::offer::Offer
48695  * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
48696  *
48697  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48698  */
48699 MUST_USE_RES struct LDKOfferFeatures UnsignedBolt12Invoice_offer_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48700
48701 /**
48702  * A complete description of the purpose of the originating offer or refund.
48703  *
48704  * From [`Offer::description`] or [`Refund::description`].
48705  *
48706  * [`Offer::description`]: crate::offers::offer::Offer::description
48707  *
48708  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48709  */
48710 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_description(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48711
48712 /**
48713  * Duration since the Unix epoch when an invoice should no longer be requested.
48714  *
48715  * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
48716  *
48717  * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
48718  */
48719 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_absolute_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48720
48721 /**
48722  * The issuer of the offer or refund.
48723  *
48724  * From [`Offer::issuer`] or [`Refund::issuer`].
48725  *
48726  * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
48727  *
48728  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48729  */
48730 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_issuer(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48731
48732 /**
48733  * Paths to the recipient originating from publicly reachable nodes.
48734  *
48735  * From [`Offer::paths`] or [`Refund::paths`].
48736  *
48737  * [`Offer::paths`]: crate::offers::offer::Offer::paths
48738  */
48739 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedBolt12Invoice_message_paths(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48740
48741 /**
48742  * The quantity of items supported.
48743  *
48744  * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
48745  * [`Refund`].
48746  *
48747  * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
48748  */
48749 MUST_USE_RES struct LDKCOption_QuantityZ UnsignedBolt12Invoice_supported_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48750
48751 /**
48752  * An unpredictable series of bytes from the payer.
48753  *
48754  * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
48755  */
48756 MUST_USE_RES struct LDKu8slice UnsignedBolt12Invoice_payer_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48757
48758 /**
48759  * Features pertaining to requesting an invoice.
48760  *
48761  * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
48762  */
48763 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedBolt12Invoice_invoice_request_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48764
48765 /**
48766  * The quantity of items requested or refunded for.
48767  *
48768  * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
48769  */
48770 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48771
48772 /**
48773  * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
48774  * refund in case there are no [`message_paths`].
48775  *
48776  * [`message_paths`]: Self::message_paths
48777  */
48778 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_payer_id(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48779
48780 /**
48781  * A payer-provided note reflected back in the invoice.
48782  *
48783  * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
48784  *
48785  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48786  */
48787 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_payer_note(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48788
48789 /**
48790  * Duration since the Unix epoch when the invoice was created.
48791  */
48792 MUST_USE_RES uint64_t UnsignedBolt12Invoice_created_at(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48793
48794 /**
48795  * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
48796  * should no longer be paid.
48797  */
48798 MUST_USE_RES uint64_t UnsignedBolt12Invoice_relative_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48799
48800 /**
48801  * Whether the invoice has expired.
48802  */
48803 MUST_USE_RES bool UnsignedBolt12Invoice_is_expired(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48804
48805 /**
48806  * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
48807  */
48808 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_payment_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48809
48810 /**
48811  * The minimum amount required for a successful payment of the invoice.
48812  */
48813 MUST_USE_RES uint64_t UnsignedBolt12Invoice_amount_msats(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48814
48815 /**
48816  * Features pertaining to paying an invoice.
48817  */
48818 MUST_USE_RES struct LDKBolt12InvoiceFeatures UnsignedBolt12Invoice_invoice_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48819
48820 /**
48821  * The public key corresponding to the key used to sign the invoice.
48822  */
48823 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
48824
48825 /**
48826  * The chains that may be used when paying a requested invoice.
48827  *
48828  * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
48829  *
48830  * [`Offer::chains`]: crate::offers::offer::Offer::chains
48831  */
48832 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ Bolt12Invoice_offer_chains(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48833
48834 /**
48835  * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
48836  * invoice originated from an offer.
48837  *
48838  * From [`InvoiceRequest::chain`] or [`Refund::chain`].
48839  *
48840  * [`offer_chains`]: Self::offer_chains
48841  * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
48842  */
48843 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_chain(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48844
48845 /**
48846  * Opaque bytes set by the originating [`Offer`].
48847  *
48848  * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
48849  * if the [`Offer`] did not set it.
48850  *
48851  * [`Offer`]: crate::offers::offer::Offer
48852  * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
48853  */
48854 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt12Invoice_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48855
48856 /**
48857  * The minimum amount required for a successful payment of a single item.
48858  *
48859  * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
48860  * the [`Offer`] did not set it.
48861  *
48862  * [`Offer`]: crate::offers::offer::Offer
48863  * [`Offer::amount`]: crate::offers::offer::Offer::amount
48864  */
48865 MUST_USE_RES struct LDKCOption_AmountZ Bolt12Invoice_amount(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48866
48867 /**
48868  * Features pertaining to the originating [`Offer`].
48869  *
48870  * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
48871  * [`Refund`].
48872  *
48873  * [`Offer`]: crate::offers::offer::Offer
48874  * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
48875  *
48876  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48877  */
48878 MUST_USE_RES struct LDKOfferFeatures Bolt12Invoice_offer_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48879
48880 /**
48881  * A complete description of the purpose of the originating offer or refund.
48882  *
48883  * From [`Offer::description`] or [`Refund::description`].
48884  *
48885  * [`Offer::description`]: crate::offers::offer::Offer::description
48886  *
48887  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48888  */
48889 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_description(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48890
48891 /**
48892  * Duration since the Unix epoch when an invoice should no longer be requested.
48893  *
48894  * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
48895  *
48896  * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
48897  */
48898 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_absolute_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48899
48900 /**
48901  * The issuer of the offer or refund.
48902  *
48903  * From [`Offer::issuer`] or [`Refund::issuer`].
48904  *
48905  * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
48906  *
48907  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48908  */
48909 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_issuer(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48910
48911 /**
48912  * Paths to the recipient originating from publicly reachable nodes.
48913  *
48914  * From [`Offer::paths`] or [`Refund::paths`].
48915  *
48916  * [`Offer::paths`]: crate::offers::offer::Offer::paths
48917  */
48918 MUST_USE_RES struct LDKCVec_BlindedPathZ Bolt12Invoice_message_paths(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48919
48920 /**
48921  * The quantity of items supported.
48922  *
48923  * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
48924  * [`Refund`].
48925  *
48926  * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
48927  */
48928 MUST_USE_RES struct LDKCOption_QuantityZ Bolt12Invoice_supported_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48929
48930 /**
48931  * An unpredictable series of bytes from the payer.
48932  *
48933  * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
48934  */
48935 MUST_USE_RES struct LDKu8slice Bolt12Invoice_payer_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48936
48937 /**
48938  * Features pertaining to requesting an invoice.
48939  *
48940  * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
48941  */
48942 MUST_USE_RES struct LDKInvoiceRequestFeatures Bolt12Invoice_invoice_request_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48943
48944 /**
48945  * The quantity of items requested or refunded for.
48946  *
48947  * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
48948  */
48949 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48950
48951 /**
48952  * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
48953  * refund in case there are no [`message_paths`].
48954  *
48955  * [`message_paths`]: Self::message_paths
48956  */
48957 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_payer_id(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48958
48959 /**
48960  * A payer-provided note reflected back in the invoice.
48961  *
48962  * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
48963  *
48964  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48965  */
48966 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_payer_note(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48967
48968 /**
48969  * Duration since the Unix epoch when the invoice was created.
48970  */
48971 MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48972
48973 /**
48974  * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
48975  * should no longer be paid.
48976  */
48977 MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48978
48979 /**
48980  * Whether the invoice has expired.
48981  */
48982 MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48983
48984 /**
48985  * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
48986  */
48987 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48988
48989 /**
48990  * The minimum amount required for a successful payment of the invoice.
48991  */
48992 MUST_USE_RES uint64_t Bolt12Invoice_amount_msats(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48993
48994 /**
48995  * Features pertaining to paying an invoice.
48996  */
48997 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48998
48999 /**
49000  * The public key corresponding to the key used to sign the invoice.
49001  */
49002 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
49003
49004 /**
49005  * Signature of the invoice verified using [`Bolt12Invoice::signing_pubkey`].
49006  */
49007 MUST_USE_RES struct LDKSchnorrSignature Bolt12Invoice_signature(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
49008
49009 /**
49010  * Hash that was used for signing the invoice.
49011  */
49012 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_signable_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
49013
49014 /**
49015  * Verifies that the invoice was for a request or refund created using the given key. Returns
49016  * the associated [`PaymentId`] to use when sending the payment.
49017  */
49018 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
49019
49020 /**
49021  * Generates a non-cryptographic 64-bit hash of the Bolt12Invoice.
49022  */
49023 uint64_t Bolt12Invoice_hash(const struct LDKBolt12Invoice *NONNULL_PTR o);
49024
49025 /**
49026  * Serialize the UnsignedBolt12Invoice object into a byte array which can be read by UnsignedBolt12Invoice_read
49027  */
49028 struct LDKCVec_u8Z UnsignedBolt12Invoice_write(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR obj);
49029
49030 /**
49031  * Serialize the Bolt12Invoice object into a byte array which can be read by Bolt12Invoice_read
49032  */
49033 struct LDKCVec_u8Z Bolt12Invoice_write(const struct LDKBolt12Invoice *NONNULL_PTR obj);
49034
49035 /**
49036  * Frees any resources used by the BlindedPayInfo, if is_owned is set and inner is non-NULL.
49037  */
49038 void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj);
49039
49040 /**
49041  * Base fee charged (in millisatoshi) for the entire blinded path.
49042  */
49043 uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
49044
49045 /**
49046  * Base fee charged (in millisatoshi) for the entire blinded path.
49047  */
49048 void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
49049
49050 /**
49051  * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
49052  * (i.e., 10,000 is 1%).
49053  */
49054 uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
49055
49056 /**
49057  * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
49058  * (i.e., 10,000 is 1%).
49059  */
49060 void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
49061
49062 /**
49063  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
49064  * path.
49065  */
49066 uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
49067
49068 /**
49069  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
49070  * path.
49071  */
49072 void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val);
49073
49074 /**
49075  * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
49076  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
49077  * seen by the recipient.
49078  */
49079 uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
49080
49081 /**
49082  * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
49083  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
49084  * seen by the recipient.
49085  */
49086 void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
49087
49088 /**
49089  * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
49090  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
49091  * seen by the recipient.
49092  */
49093 uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
49094
49095 /**
49096  * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
49097  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
49098  * seen by the recipient.
49099  */
49100 void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
49101
49102 /**
49103  * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
49104  * onion payload.
49105  */
49106 struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
49107
49108 /**
49109  * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
49110  * onion payload.
49111  */
49112 void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
49113
49114 /**
49115  * Constructs a new BlindedPayInfo given each field
49116  */
49117 MUST_USE_RES struct LDKBlindedPayInfo BlindedPayInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, struct LDKBlindedHopFeatures features_arg);
49118
49119 /**
49120  * Creates a copy of the BlindedPayInfo
49121  */
49122 struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig);
49123
49124 /**
49125  * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo.
49126  */
49127 uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o);
49128
49129 /**
49130  * Checks if two BlindedPayInfos contain equal inner contents.
49131  * This ignores pointers and is_owned flags and looks at the values in fields.
49132  * Two objects with NULL inner values will be considered "equal" here.
49133  */
49134 bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b);
49135
49136 /**
49137  * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read
49138  */
49139 struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj);
49140
49141 /**
49142  * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write
49143  */
49144 struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser);
49145
49146 /**
49147  * Frees any resources used by the InvoiceError, if is_owned is set and inner is non-NULL.
49148  */
49149 void InvoiceError_free(struct LDKInvoiceError this_obj);
49150
49151 /**
49152  * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
49153  *
49154  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
49155  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
49156  *
49157  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49158  */
49159 struct LDKErroneousField InvoiceError_get_erroneous_field(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
49160
49161 /**
49162  * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
49163  *
49164  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
49165  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
49166  *
49167  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49168  */
49169 void InvoiceError_set_erroneous_field(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKErroneousField val);
49170
49171 /**
49172  * An explanation of the error.
49173  */
49174 struct LDKUntrustedString InvoiceError_get_message(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
49175
49176 /**
49177  * An explanation of the error.
49178  */
49179 void InvoiceError_set_message(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
49180
49181 /**
49182  * Constructs a new InvoiceError given each field
49183  *
49184  * Note that erroneous_field_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
49185  */
49186 MUST_USE_RES struct LDKInvoiceError InvoiceError_new(struct LDKErroneousField erroneous_field_arg, struct LDKUntrustedString message_arg);
49187
49188 /**
49189  * Creates a copy of the InvoiceError
49190  */
49191 struct LDKInvoiceError InvoiceError_clone(const struct LDKInvoiceError *NONNULL_PTR orig);
49192
49193 /**
49194  * Frees any resources used by the ErroneousField, if is_owned is set and inner is non-NULL.
49195  */
49196 void ErroneousField_free(struct LDKErroneousField this_obj);
49197
49198 /**
49199  * The type number of the TLV field containing the error.
49200  */
49201 uint64_t ErroneousField_get_tlv_fieldnum(const struct LDKErroneousField *NONNULL_PTR this_ptr);
49202
49203 /**
49204  * The type number of the TLV field containing the error.
49205  */
49206 void ErroneousField_set_tlv_fieldnum(struct LDKErroneousField *NONNULL_PTR this_ptr, uint64_t val);
49207
49208 /**
49209  * A value to use for the TLV field to avoid the error.
49210  *
49211  * Returns a copy of the field.
49212  */
49213 struct LDKCOption_CVec_u8ZZ ErroneousField_get_suggested_value(const struct LDKErroneousField *NONNULL_PTR this_ptr);
49214
49215 /**
49216  * A value to use for the TLV field to avoid the error.
49217  */
49218 void ErroneousField_set_suggested_value(struct LDKErroneousField *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
49219
49220 /**
49221  * Constructs a new ErroneousField given each field
49222  */
49223 MUST_USE_RES struct LDKErroneousField ErroneousField_new(uint64_t tlv_fieldnum_arg, struct LDKCOption_CVec_u8ZZ suggested_value_arg);
49224
49225 /**
49226  * Creates a copy of the ErroneousField
49227  */
49228 struct LDKErroneousField ErroneousField_clone(const struct LDKErroneousField *NONNULL_PTR orig);
49229
49230 /**
49231  * Creates an [`InvoiceError`] with the given message.
49232  */
49233 MUST_USE_RES struct LDKInvoiceError InvoiceError_from_string(struct LDKStr s);
49234
49235 /**
49236  * Get the string representation of a InvoiceError object
49237  */
49238 struct LDKStr InvoiceError_to_str(const struct LDKInvoiceError *NONNULL_PTR o);
49239
49240 /**
49241  * Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read
49242  */
49243 struct LDKCVec_u8Z InvoiceError_write(const struct LDKInvoiceError *NONNULL_PTR obj);
49244
49245 /**
49246  * Read a InvoiceError from a byte array, created by InvoiceError_write
49247  */
49248 struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser);
49249
49250 /**
49251  * Frees any resources used by the InvoiceRequestWithExplicitPayerIdBuilder, if is_owned is set and inner is non-NULL.
49252  */
49253 void InvoiceRequestWithExplicitPayerIdBuilder_free(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_obj);
49254
49255 /**
49256  * Frees any resources used by the InvoiceRequestWithDerivedPayerIdBuilder, if is_owned is set and inner is non-NULL.
49257  */
49258 void InvoiceRequestWithDerivedPayerIdBuilder_free(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_obj);
49259
49260 /**
49261  * Builds an unsigned [`InvoiceRequest`] after checking for valid semantics. It can be signed
49262  * by [`UnsignedInvoiceRequest::sign`].
49263  */
49264 MUST_USE_RES struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_build(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg);
49265
49266 /**
49267  * Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not
49268  * called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported
49269  * by the offer.
49270  *
49271  * Successive calls to this method will override the previous setting.
49272  */
49273 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_chain(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, enum LDKNetwork network);
49274
49275 /**
49276  * Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is
49277  * not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]).
49278  *
49279  * Successive calls to this method will override the previous setting.
49280  *
49281  * [`quantity`]: Self::quantity
49282  */
49283 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t amount_msats);
49284
49285 /**
49286  * Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity`
49287  * does not conform to [`Offer::is_valid_quantity`].
49288  *
49289  * Successive calls to this method will override the previous setting.
49290  */
49291 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_quantity(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t quantity);
49292
49293 /**
49294  * Sets the [`InvoiceRequest::payer_note`].
49295  *
49296  * Successive calls to this method will override the previous setting.
49297  */
49298 MUST_USE_RES void InvoiceRequestWithExplicitPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, struct LDKStr payer_note);
49299
49300 /**
49301  * Builds a signed [`InvoiceRequest`] after checking for valid semantics.
49302  */
49303 MUST_USE_RES struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg);
49304
49305 /**
49306  * Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not
49307  * called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported
49308  * by the offer.
49309  *
49310  * Successive calls to this method will override the previous setting.
49311  */
49312 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_chain(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, enum LDKNetwork network);
49313
49314 /**
49315  * Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is
49316  * not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]).
49317  *
49318  * Successive calls to this method will override the previous setting.
49319  *
49320  * [`quantity`]: Self::quantity
49321  */
49322 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t amount_msats);
49323
49324 /**
49325  * Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity`
49326  * does not conform to [`Offer::is_valid_quantity`].
49327  *
49328  * Successive calls to this method will override the previous setting.
49329  */
49330 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_quantity(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t quantity);
49331
49332 /**
49333  * Sets the [`InvoiceRequest::payer_note`].
49334  *
49335  * Successive calls to this method will override the previous setting.
49336  */
49337 MUST_USE_RES void InvoiceRequestWithDerivedPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, struct LDKStr payer_note);
49338
49339 /**
49340  * Frees any resources used by the UnsignedInvoiceRequest, if is_owned is set and inner is non-NULL.
49341  */
49342 void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj);
49343
49344 /**
49345  * Creates a copy of the UnsignedInvoiceRequest
49346  */
49347 struct LDKUnsignedInvoiceRequest UnsignedInvoiceRequest_clone(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR orig);
49348
49349 /**
49350  * Calls the free function if one is set
49351  */
49352 void SignInvoiceRequestFn_free(struct LDKSignInvoiceRequestFn this_ptr);
49353
49354 /**
49355  * Returns the [`TaggedHash`] of the invoice to sign.
49356  */
49357 MUST_USE_RES struct LDKTaggedHash UnsignedInvoiceRequest_tagged_hash(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49358
49359 /**
49360  * Frees any resources used by the InvoiceRequest, if is_owned is set and inner is non-NULL.
49361  */
49362 void InvoiceRequest_free(struct LDKInvoiceRequest this_obj);
49363
49364 /**
49365  * Creates a copy of the InvoiceRequest
49366  */
49367 struct LDKInvoiceRequest InvoiceRequest_clone(const struct LDKInvoiceRequest *NONNULL_PTR orig);
49368
49369 /**
49370  * Frees any resources used by the VerifiedInvoiceRequest, if is_owned is set and inner is non-NULL.
49371  */
49372 void VerifiedInvoiceRequest_free(struct LDKVerifiedInvoiceRequest this_obj);
49373
49374 /**
49375  * The identifier of the [`Offer`] for which the [`InvoiceRequest`] was made.
49376  */
49377 struct LDKOfferId VerifiedInvoiceRequest_get_offer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
49378
49379 /**
49380  * The identifier of the [`Offer`] for which the [`InvoiceRequest`] was made.
49381  */
49382 void VerifiedInvoiceRequest_set_offer_id(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKOfferId val);
49383
49384 /**
49385  * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
49386  *
49387  * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
49388  * [`respond_with`].
49389  *
49390  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
49391  * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
49392  * [`respond_with`]: Self::respond_with
49393  */
49394 struct LDKCOption_SecretKeyZ VerifiedInvoiceRequest_get_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
49395
49396 /**
49397  * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
49398  *
49399  * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
49400  * [`respond_with`].
49401  *
49402  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
49403  * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
49404  * [`respond_with`]: Self::respond_with
49405  */
49406 void VerifiedInvoiceRequest_set_keys(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKCOption_SecretKeyZ val);
49407
49408 /**
49409  * Creates a copy of the VerifiedInvoiceRequest
49410  */
49411 struct LDKVerifiedInvoiceRequest VerifiedInvoiceRequest_clone(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR orig);
49412
49413 /**
49414  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
49415  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
49416  * for the selected chain.
49417  */
49418 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ UnsignedInvoiceRequest_chains(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49419
49420 /**
49421  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
49422  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
49423  */
49424 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedInvoiceRequest_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49425
49426 /**
49427  * The minimum amount required for a successful payment of a single item.
49428  */
49429 MUST_USE_RES struct LDKCOption_AmountZ UnsignedInvoiceRequest_amount(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49430
49431 /**
49432  * A complete description of the purpose of the payment. Intended to be displayed to the user
49433  * but with the caveat that it has not been verified in any way.
49434  *
49435  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49436  */
49437 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_description(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49438
49439 /**
49440  * Features pertaining to the offer.
49441  */
49442 MUST_USE_RES struct LDKOfferFeatures UnsignedInvoiceRequest_offer_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49443
49444 /**
49445  * Duration since the Unix epoch when an invoice should no longer be requested.
49446  *
49447  * If `None`, the offer does not expire.
49448  */
49449 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_absolute_expiry(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49450
49451 /**
49452  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
49453  * displayed to the user but with the caveat that it has not been verified in any way.
49454  *
49455  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49456  */
49457 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_issuer(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49458
49459 /**
49460  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
49461  * recipient privacy by obfuscating its node id.
49462  */
49463 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedInvoiceRequest_paths(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49464
49465 /**
49466  * The quantity of items supported.
49467  */
49468 MUST_USE_RES struct LDKQuantity UnsignedInvoiceRequest_supported_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49469
49470 /**
49471  * The public key used by the recipient to sign invoices.
49472  *
49473  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49474  */
49475 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_signing_pubkey(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49476
49477 /**
49478  * An unpredictable series of bytes, typically containing information about the derivation of
49479  * [`payer_id`].
49480  *
49481  * [`payer_id`]: Self::payer_id
49482  */
49483 MUST_USE_RES struct LDKu8slice UnsignedInvoiceRequest_payer_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49484
49485 /**
49486  * A chain from [`Offer::chains`] that the offer is valid for.
49487  */
49488 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedInvoiceRequest_chain(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49489
49490 /**
49491  * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
49492  * must be greater than or equal to [`Offer::amount`], converted if necessary.
49493  *
49494  * [`chain`]: Self::chain
49495  */
49496 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_amount_msats(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49497
49498 /**
49499  * Features pertaining to requesting an invoice.
49500  */
49501 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedInvoiceRequest_invoice_request_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49502
49503 /**
49504  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
49505  */
49506 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49507
49508 /**
49509  * A possibly transient pubkey used to sign the invoice request.
49510  */
49511 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_payer_id(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49512
49513 /**
49514  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
49515  * response.
49516  *
49517  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49518  */
49519 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_payer_note(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
49520
49521 /**
49522  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
49523  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
49524  * for the selected chain.
49525  */
49526 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ InvoiceRequest_chains(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49527
49528 /**
49529  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
49530  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
49531  */
49532 MUST_USE_RES struct LDKCOption_CVec_u8ZZ InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49533
49534 /**
49535  * The minimum amount required for a successful payment of a single item.
49536  */
49537 MUST_USE_RES struct LDKCOption_AmountZ InvoiceRequest_amount(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49538
49539 /**
49540  * A complete description of the purpose of the payment. Intended to be displayed to the user
49541  * but with the caveat that it has not been verified in any way.
49542  *
49543  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49544  */
49545 MUST_USE_RES struct LDKPrintableString InvoiceRequest_description(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49546
49547 /**
49548  * Features pertaining to the offer.
49549  */
49550 MUST_USE_RES struct LDKOfferFeatures InvoiceRequest_offer_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49551
49552 /**
49553  * Duration since the Unix epoch when an invoice should no longer be requested.
49554  *
49555  * If `None`, the offer does not expire.
49556  */
49557 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_absolute_expiry(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49558
49559 /**
49560  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
49561  * displayed to the user but with the caveat that it has not been verified in any way.
49562  *
49563  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49564  */
49565 MUST_USE_RES struct LDKPrintableString InvoiceRequest_issuer(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49566
49567 /**
49568  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
49569  * recipient privacy by obfuscating its node id.
49570  */
49571 MUST_USE_RES struct LDKCVec_BlindedPathZ InvoiceRequest_paths(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49572
49573 /**
49574  * The quantity of items supported.
49575  */
49576 MUST_USE_RES struct LDKQuantity InvoiceRequest_supported_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49577
49578 /**
49579  * The public key used by the recipient to sign invoices.
49580  *
49581  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49582  */
49583 MUST_USE_RES struct LDKPublicKey InvoiceRequest_signing_pubkey(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49584
49585 /**
49586  * An unpredictable series of bytes, typically containing information about the derivation of
49587  * [`payer_id`].
49588  *
49589  * [`payer_id`]: Self::payer_id
49590  */
49591 MUST_USE_RES struct LDKu8slice InvoiceRequest_payer_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49592
49593 /**
49594  * A chain from [`Offer::chains`] that the offer is valid for.
49595  */
49596 MUST_USE_RES struct LDKThirtyTwoBytes InvoiceRequest_chain(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49597
49598 /**
49599  * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
49600  * must be greater than or equal to [`Offer::amount`], converted if necessary.
49601  *
49602  * [`chain`]: Self::chain
49603  */
49604 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49605
49606 /**
49607  * Features pertaining to requesting an invoice.
49608  */
49609 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequest_invoice_request_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49610
49611 /**
49612  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
49613  */
49614 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49615
49616 /**
49617  * A possibly transient pubkey used to sign the invoice request.
49618  */
49619 MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_id(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49620
49621 /**
49622  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
49623  * response.
49624  *
49625  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49626  */
49627 MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49628
49629 /**
49630  * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the
49631  * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time.
49632  *
49633  * See [`InvoiceRequest::respond_with_no_std`] for further details where the aforementioned
49634  * creation time is used for the `created_at` parameter.
49635  *
49636  * [`Duration`]: core::time::Duration
49637  */
49638 MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ InvoiceRequest_respond_with(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash);
49639
49640 /**
49641  * Creates an [`InvoiceBuilder`] for the request with the given required fields.
49642  *
49643  * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after
49644  * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds
49645  * where [`std::time::SystemTime`] is not available.
49646  *
49647  * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment
49648  * for the invoice.
49649  *
49650  * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It
49651  * must contain one or more elements ordered from most-preferred to least-preferred, if there's
49652  * a preference. Note, however, that any privacy is lost if a public node id was used for
49653  * [`Offer::signing_pubkey`].
49654  *
49655  * Errors if the request contains unknown required features.
49656  *
49657  * # Note
49658  *
49659  * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`],
49660  * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead.
49661  *
49662  * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at
49663  * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey
49664  */
49665 MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ InvoiceRequest_respond_with_no_std(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at);
49666
49667 /**
49668  * Verifies that the request was for an offer created using the given key. Returns the verified
49669  * request which contains the derived keys needed to sign a [`Bolt12Invoice`] for the request
49670  * if they could be extracted from the metadata.
49671  *
49672  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
49673  */
49674 MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify(struct LDKInvoiceRequest this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
49675
49676 /**
49677  * Signature of the invoice request using [`payer_id`].
49678  *
49679  * [`payer_id`]: Self::payer_id
49680  */
49681 MUST_USE_RES struct LDKSchnorrSignature InvoiceRequest_signature(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
49682
49683 /**
49684  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
49685  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
49686  * for the selected chain.
49687  */
49688 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ VerifiedInvoiceRequest_chains(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49689
49690 /**
49691  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
49692  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
49693  */
49694 MUST_USE_RES struct LDKCOption_CVec_u8ZZ VerifiedInvoiceRequest_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49695
49696 /**
49697  * The minimum amount required for a successful payment of a single item.
49698  */
49699 MUST_USE_RES struct LDKCOption_AmountZ VerifiedInvoiceRequest_amount(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49700
49701 /**
49702  * A complete description of the purpose of the payment. Intended to be displayed to the user
49703  * but with the caveat that it has not been verified in any way.
49704  *
49705  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49706  */
49707 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_description(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49708
49709 /**
49710  * Features pertaining to the offer.
49711  */
49712 MUST_USE_RES struct LDKOfferFeatures VerifiedInvoiceRequest_offer_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49713
49714 /**
49715  * Duration since the Unix epoch when an invoice should no longer be requested.
49716  *
49717  * If `None`, the offer does not expire.
49718  */
49719 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_absolute_expiry(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49720
49721 /**
49722  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
49723  * displayed to the user but with the caveat that it has not been verified in any way.
49724  *
49725  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49726  */
49727 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_issuer(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49728
49729 /**
49730  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
49731  * recipient privacy by obfuscating its node id.
49732  */
49733 MUST_USE_RES struct LDKCVec_BlindedPathZ VerifiedInvoiceRequest_paths(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49734
49735 /**
49736  * The quantity of items supported.
49737  */
49738 MUST_USE_RES struct LDKQuantity VerifiedInvoiceRequest_supported_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49739
49740 /**
49741  * The public key used by the recipient to sign invoices.
49742  *
49743  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49744  */
49745 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_signing_pubkey(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49746
49747 /**
49748  * An unpredictable series of bytes, typically containing information about the derivation of
49749  * [`payer_id`].
49750  *
49751  * [`payer_id`]: Self::payer_id
49752  */
49753 MUST_USE_RES struct LDKu8slice VerifiedInvoiceRequest_payer_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49754
49755 /**
49756  * A chain from [`Offer::chains`] that the offer is valid for.
49757  */
49758 MUST_USE_RES struct LDKThirtyTwoBytes VerifiedInvoiceRequest_chain(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49759
49760 /**
49761  * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
49762  * must be greater than or equal to [`Offer::amount`], converted if necessary.
49763  *
49764  * [`chain`]: Self::chain
49765  */
49766 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_amount_msats(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49767
49768 /**
49769  * Features pertaining to requesting an invoice.
49770  */
49771 MUST_USE_RES struct LDKInvoiceRequestFeatures VerifiedInvoiceRequest_invoice_request_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49772
49773 /**
49774  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
49775  */
49776 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49777
49778 /**
49779  * A possibly transient pubkey used to sign the invoice request.
49780  */
49781 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_payer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49782
49783 /**
49784  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
49785  * response.
49786  *
49787  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49788  */
49789 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_payer_note(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
49790
49791 /**
49792  * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the
49793  * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time.
49794  *
49795  * See [`InvoiceRequest::respond_with_no_std`] for further details where the aforementioned
49796  * creation time is used for the `created_at` parameter.
49797  *
49798  * [`Duration`]: core::time::Duration
49799  */
49800 MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_with(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash);
49801
49802 /**
49803  * Creates an [`InvoiceBuilder`] for the request with the given required fields.
49804  *
49805  * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after
49806  * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds
49807  * where [`std::time::SystemTime`] is not available.
49808  *
49809  * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment
49810  * for the invoice.
49811  *
49812  * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It
49813  * must contain one or more elements ordered from most-preferred to least-preferred, if there's
49814  * a preference. Note, however, that any privacy is lost if a public node id was used for
49815  * [`Offer::signing_pubkey`].
49816  *
49817  * Errors if the request contains unknown required features.
49818  *
49819  * # Note
49820  *
49821  * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`],
49822  * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead.
49823  *
49824  * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at
49825  * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey
49826  */
49827 MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_with_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at);
49828
49829 /**
49830  * Creates an [`InvoiceBuilder`] for the request using the given required fields and that uses
49831  * derived signing keys from the originating [`Offer`] to sign the [`Bolt12Invoice`]. Must use
49832  * the same [`ExpandedKey`] as the one used to create the offer.
49833  *
49834  * See [`InvoiceRequest::respond_with`] for further details.
49835  *
49836  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
49837  */
49838 MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash);
49839
49840 /**
49841  * Creates an [`InvoiceBuilder`] for the request using the given required fields and that uses
49842  * derived signing keys from the originating [`Offer`] to sign the [`Bolt12Invoice`]. Must use
49843  * the same [`ExpandedKey`] as the one used to create the offer.
49844  *
49845  * See [`InvoiceRequest::respond_with_no_std`] for further details.
49846  *
49847  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
49848  */
49849 MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at);
49850
49851 /**
49852  * Serialize the UnsignedInvoiceRequest object into a byte array which can be read by UnsignedInvoiceRequest_read
49853  */
49854 struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj);
49855
49856 /**
49857  * Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read
49858  */
49859 struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj);
49860
49861 /**
49862  * Frees any resources used by the InvoiceRequestFields, if is_owned is set and inner is non-NULL.
49863  */
49864 void InvoiceRequestFields_free(struct LDKInvoiceRequestFields this_obj);
49865
49866 /**
49867  * A possibly transient pubkey used to sign the invoice request.
49868  */
49869 struct LDKPublicKey InvoiceRequestFields_get_payer_id(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
49870
49871 /**
49872  * A possibly transient pubkey used to sign the invoice request.
49873  */
49874 void InvoiceRequestFields_set_payer_id(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
49875
49876 /**
49877  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
49878  */
49879 struct LDKCOption_u64Z InvoiceRequestFields_get_quantity(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
49880
49881 /**
49882  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
49883  */
49884 void InvoiceRequestFields_set_quantity(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
49885
49886 /**
49887  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
49888  * response. Truncated to [`PAYER_NOTE_LIMIT`] characters.
49889  *
49890  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49891  */
49892 struct LDKUntrustedString InvoiceRequestFields_get_payer_note_truncated(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
49893
49894 /**
49895  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
49896  * response. Truncated to [`PAYER_NOTE_LIMIT`] characters.
49897  *
49898  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49899  */
49900 void InvoiceRequestFields_set_payer_note_truncated(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
49901
49902 /**
49903  * Constructs a new InvoiceRequestFields given each field
49904  *
49905  * Note that payer_note_truncated_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
49906  */
49907 MUST_USE_RES struct LDKInvoiceRequestFields InvoiceRequestFields_new(struct LDKPublicKey payer_id_arg, struct LDKCOption_u64Z quantity_arg, struct LDKUntrustedString payer_note_truncated_arg);
49908
49909 /**
49910  * Creates a copy of the InvoiceRequestFields
49911  */
49912 struct LDKInvoiceRequestFields InvoiceRequestFields_clone(const struct LDKInvoiceRequestFields *NONNULL_PTR orig);
49913
49914 /**
49915  * Checks if two InvoiceRequestFieldss contain equal inner contents.
49916  * This ignores pointers and is_owned flags and looks at the values in fields.
49917  * Two objects with NULL inner values will be considered "equal" here.
49918  */
49919 bool InvoiceRequestFields_eq(const struct LDKInvoiceRequestFields *NONNULL_PTR a, const struct LDKInvoiceRequestFields *NONNULL_PTR b);
49920
49921 /**
49922  * Serialize the InvoiceRequestFields object into a byte array which can be read by InvoiceRequestFields_read
49923  */
49924 struct LDKCVec_u8Z InvoiceRequestFields_write(const struct LDKInvoiceRequestFields *NONNULL_PTR obj);
49925
49926 /**
49927  * Read a InvoiceRequestFields from a byte array, created by InvoiceRequestFields_write
49928  */
49929 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ InvoiceRequestFields_read(struct LDKu8slice ser);
49930
49931 /**
49932  * Frees any resources used by the TaggedHash, if is_owned is set and inner is non-NULL.
49933  */
49934 void TaggedHash_free(struct LDKTaggedHash this_obj);
49935
49936 /**
49937  * Creates a copy of the TaggedHash
49938  */
49939 struct LDKTaggedHash TaggedHash_clone(const struct LDKTaggedHash *NONNULL_PTR orig);
49940
49941 /**
49942  * Returns the digest to sign.
49943  */
49944 MUST_USE_RES const uint8_t (*TaggedHash_as_digest(const struct LDKTaggedHash *NONNULL_PTR this_arg))[32];
49945
49946 /**
49947  * Returns the tag used in the tagged hash.
49948  */
49949 MUST_USE_RES struct LDKStr TaggedHash_tag(const struct LDKTaggedHash *NONNULL_PTR this_arg);
49950
49951 /**
49952  * Returns the merkle root used in the tagged hash.
49953  */
49954 MUST_USE_RES struct LDKThirtyTwoBytes TaggedHash_merkle_root(const struct LDKTaggedHash *NONNULL_PTR this_arg);
49955
49956 /**
49957  * Frees any resources used by the SignError
49958  */
49959 void SignError_free(struct LDKSignError this_ptr);
49960
49961 /**
49962  * Creates a copy of the SignError
49963  */
49964 struct LDKSignError SignError_clone(const struct LDKSignError *NONNULL_PTR orig);
49965
49966 /**
49967  * Utility method to constructs a new Signing-variant SignError
49968  */
49969 struct LDKSignError SignError_signing(void);
49970
49971 /**
49972  * Utility method to constructs a new Verification-variant SignError
49973  */
49974 struct LDKSignError SignError_verification(enum LDKSecp256k1Error a);
49975
49976 /**
49977  * Frees any resources used by the Bolt12ParseError, if is_owned is set and inner is non-NULL.
49978  */
49979 void Bolt12ParseError_free(struct LDKBolt12ParseError this_obj);
49980
49981 /**
49982  * Creates a copy of the Bolt12ParseError
49983  */
49984 struct LDKBolt12ParseError Bolt12ParseError_clone(const struct LDKBolt12ParseError *NONNULL_PTR orig);
49985
49986 /**
49987  * Creates a copy of the Bolt12SemanticError
49988  */
49989 enum LDKBolt12SemanticError Bolt12SemanticError_clone(const enum LDKBolt12SemanticError *NONNULL_PTR orig);
49990
49991 /**
49992  * Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError
49993  */
49994 enum LDKBolt12SemanticError Bolt12SemanticError_already_expired(void);
49995
49996 /**
49997  * Utility method to constructs a new UnsupportedChain-variant Bolt12SemanticError
49998  */
49999 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_chain(void);
50000
50001 /**
50002  * Utility method to constructs a new UnexpectedChain-variant Bolt12SemanticError
50003  */
50004 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_chain(void);
50005
50006 /**
50007  * Utility method to constructs a new MissingAmount-variant Bolt12SemanticError
50008  */
50009 enum LDKBolt12SemanticError Bolt12SemanticError_missing_amount(void);
50010
50011 /**
50012  * Utility method to constructs a new InvalidAmount-variant Bolt12SemanticError
50013  */
50014 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_amount(void);
50015
50016 /**
50017  * Utility method to constructs a new InsufficientAmount-variant Bolt12SemanticError
50018  */
50019 enum LDKBolt12SemanticError Bolt12SemanticError_insufficient_amount(void);
50020
50021 /**
50022  * Utility method to constructs a new UnexpectedAmount-variant Bolt12SemanticError
50023  */
50024 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_amount(void);
50025
50026 /**
50027  * Utility method to constructs a new UnsupportedCurrency-variant Bolt12SemanticError
50028  */
50029 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_currency(void);
50030
50031 /**
50032  * Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12SemanticError
50033  */
50034 enum LDKBolt12SemanticError Bolt12SemanticError_unknown_required_features(void);
50035
50036 /**
50037  * Utility method to constructs a new UnexpectedFeatures-variant Bolt12SemanticError
50038  */
50039 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_features(void);
50040
50041 /**
50042  * Utility method to constructs a new MissingDescription-variant Bolt12SemanticError
50043  */
50044 enum LDKBolt12SemanticError Bolt12SemanticError_missing_description(void);
50045
50046 /**
50047  * Utility method to constructs a new MissingSigningPubkey-variant Bolt12SemanticError
50048  */
50049 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(void);
50050
50051 /**
50052  * Utility method to constructs a new InvalidSigningPubkey-variant Bolt12SemanticError
50053  */
50054 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(void);
50055
50056 /**
50057  * Utility method to constructs a new UnexpectedSigningPubkey-variant Bolt12SemanticError
50058  */
50059 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(void);
50060
50061 /**
50062  * Utility method to constructs a new MissingQuantity-variant Bolt12SemanticError
50063  */
50064 enum LDKBolt12SemanticError Bolt12SemanticError_missing_quantity(void);
50065
50066 /**
50067  * Utility method to constructs a new InvalidQuantity-variant Bolt12SemanticError
50068  */
50069 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_quantity(void);
50070
50071 /**
50072  * Utility method to constructs a new UnexpectedQuantity-variant Bolt12SemanticError
50073  */
50074 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_quantity(void);
50075
50076 /**
50077  * Utility method to constructs a new InvalidMetadata-variant Bolt12SemanticError
50078  */
50079 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_metadata(void);
50080
50081 /**
50082  * Utility method to constructs a new UnexpectedMetadata-variant Bolt12SemanticError
50083  */
50084 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_metadata(void);
50085
50086 /**
50087  * Utility method to constructs a new MissingPayerMetadata-variant Bolt12SemanticError
50088  */
50089 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_metadata(void);
50090
50091 /**
50092  * Utility method to constructs a new MissingPayerId-variant Bolt12SemanticError
50093  */
50094 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_id(void);
50095
50096 /**
50097  * Utility method to constructs a new DuplicatePaymentId-variant Bolt12SemanticError
50098  */
50099 enum LDKBolt12SemanticError Bolt12SemanticError_duplicate_payment_id(void);
50100
50101 /**
50102  * Utility method to constructs a new MissingPaths-variant Bolt12SemanticError
50103  */
50104 enum LDKBolt12SemanticError Bolt12SemanticError_missing_paths(void);
50105
50106 /**
50107  * Utility method to constructs a new UnexpectedPaths-variant Bolt12SemanticError
50108  */
50109 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_paths(void);
50110
50111 /**
50112  * Utility method to constructs a new InvalidPayInfo-variant Bolt12SemanticError
50113  */
50114 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_pay_info(void);
50115
50116 /**
50117  * Utility method to constructs a new MissingCreationTime-variant Bolt12SemanticError
50118  */
50119 enum LDKBolt12SemanticError Bolt12SemanticError_missing_creation_time(void);
50120
50121 /**
50122  * Utility method to constructs a new MissingPaymentHash-variant Bolt12SemanticError
50123  */
50124 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payment_hash(void);
50125
50126 /**
50127  * Utility method to constructs a new MissingSignature-variant Bolt12SemanticError
50128  */
50129 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void);
50130
50131 /**
50132  * Frees any resources used by the RefundMaybeWithDerivedMetadataBuilder, if is_owned is set and inner is non-NULL.
50133  */
50134 void RefundMaybeWithDerivedMetadataBuilder_free(struct LDKRefundMaybeWithDerivedMetadataBuilder this_obj);
50135
50136 /**
50137  * Creates a copy of the RefundMaybeWithDerivedMetadataBuilder
50138  */
50139 struct LDKRefundMaybeWithDerivedMetadataBuilder RefundMaybeWithDerivedMetadataBuilder_clone(const struct LDKRefundMaybeWithDerivedMetadataBuilder *NONNULL_PTR orig);
50140
50141 /**
50142  * Creates a new builder for a refund using the [`Refund::payer_id`] for the public node id to
50143  * send to if no [`Refund::paths`] are set. Otherwise, it may be a transient pubkey.
50144  *
50145  * Additionally, sets the required (empty) [`Refund::description`], [`Refund::payer_metadata`],
50146  * and [`Refund::amount_msats`].
50147  *
50148  * # Note
50149  *
50150  * If constructing a [`Refund`] for use with a [`ChannelManager`], use
50151  * [`ChannelManager::create_refund_builder`] instead of [`RefundBuilder::new`].
50152  *
50153  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
50154  * [`ChannelManager::create_refund_builder`]: crate::ln::channelmanager::ChannelManager::create_refund_builder
50155  */
50156 MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_new(struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id, uint64_t amount_msats);
50157
50158 /**
50159  * Similar to [`RefundBuilder::new`] except, if [`RefundBuilder::path`] is called, the payer id
50160  * is derived from the given [`ExpandedKey`] and nonce. This provides sender privacy by using a
50161  * different payer id for each refund, assuming a different nonce is used.  Otherwise, the
50162  * provided `node_id` is used for the payer id.
50163  *
50164  * Also, sets the metadata when [`RefundBuilder::build`] is called such that it can be used to
50165  * verify that an [`InvoiceRequest`] was produced for the refund given an [`ExpandedKey`].
50166  *
50167  * The `payment_id` is encrypted in the metadata and should be unique. This ensures that only
50168  * one invoice will be paid for the refund and that payments can be uniquely identified.
50169  *
50170  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
50171  * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
50172  */
50173 MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(struct LDKPublicKey node_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id);
50174
50175 /**
50176  * Sets the [`Refund::description`].
50177  *
50178  * Successive calls to this method will override the previous setting.
50179  */
50180 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_description(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr description);
50181
50182 /**
50183  * Sets the [`Refund::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
50184  * already passed is valid and can be checked for using [`Refund::is_expired`].
50185  *
50186  * Successive calls to this method will override the previous setting.
50187  */
50188 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, uint64_t absolute_expiry);
50189
50190 /**
50191  * Sets the [`Refund::issuer`].
50192  *
50193  * Successive calls to this method will override the previous setting.
50194  */
50195 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_issuer(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr issuer);
50196
50197 /**
50198  * Adds a blinded path to [`Refund::paths`]. Must include at least one path if only connected
50199  * by private channels or if [`Refund::payer_id`] is not a public node id.
50200  *
50201  * Successive calls to this method will add another blinded path. Caller is responsible for not
50202  * adding duplicate paths.
50203  */
50204 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_path(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKBlindedPath path);
50205
50206 /**
50207  * Sets the [`Refund::chain`] of the given [`Network`] for paying an invoice. If not
50208  * called, [`Network::Bitcoin`] is assumed.
50209  *
50210  * Successive calls to this method will override the previous setting.
50211  */
50212 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_chain(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, enum LDKNetwork network);
50213
50214 /**
50215  * Sets [`Refund::quantity`] of items. This is purely for informational purposes. It is useful
50216  * when the refund pertains to a [`Bolt12Invoice`] that paid for more than one item from an
50217  * [`Offer`] as specified by [`InvoiceRequest::quantity`].
50218  *
50219  * Successive calls to this method will override the previous setting.
50220  *
50221  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
50222  * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
50223  * [`Offer`]: crate::offers::offer::Offer
50224  */
50225 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_quantity(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, uint64_t quantity);
50226
50227 /**
50228  * Sets the [`Refund::payer_note`].
50229  *
50230  * Successive calls to this method will override the previous setting.
50231  */
50232 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_payer_note(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr payer_note);
50233
50234 /**
50235  * Builds a [`Refund`] after checking for valid semantics.
50236  */
50237 MUST_USE_RES struct LDKCResult_RefundBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_build(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg);
50238
50239 /**
50240  * Frees any resources used by the Refund, if is_owned is set and inner is non-NULL.
50241  */
50242 void Refund_free(struct LDKRefund this_obj);
50243
50244 /**
50245  * Creates a copy of the Refund
50246  */
50247 struct LDKRefund Refund_clone(const struct LDKRefund *NONNULL_PTR orig);
50248
50249 /**
50250  * A complete description of the purpose of the refund. Intended to be displayed to the user
50251  * but with the caveat that it has not been verified in any way.
50252  */
50253 MUST_USE_RES struct LDKPrintableString Refund_description(const struct LDKRefund *NONNULL_PTR this_arg);
50254
50255 /**
50256  * Duration since the Unix epoch when an invoice should no longer be sent.
50257  *
50258  * If `None`, the refund does not expire.
50259  */
50260 MUST_USE_RES struct LDKCOption_u64Z Refund_absolute_expiry(const struct LDKRefund *NONNULL_PTR this_arg);
50261
50262 /**
50263  * Whether the refund has expired.
50264  */
50265 MUST_USE_RES bool Refund_is_expired(const struct LDKRefund *NONNULL_PTR this_arg);
50266
50267 /**
50268  * Whether the refund has expired given the duration since the Unix epoch.
50269  */
50270 MUST_USE_RES bool Refund_is_expired_no_std(const struct LDKRefund *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
50271
50272 /**
50273  * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be
50274  * displayed to the user but with the caveat that it has not been verified in any way.
50275  *
50276  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50277  */
50278 MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg);
50279
50280 /**
50281  * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender
50282  * privacy by obfuscating its node id.
50283  */
50284 MUST_USE_RES struct LDKCVec_BlindedPathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg);
50285
50286 /**
50287  * An unpredictable series of bytes, typically containing information about the derivation of
50288  * [`payer_id`].
50289  *
50290  * [`payer_id`]: Self::payer_id
50291  */
50292 MUST_USE_RES struct LDKu8slice Refund_payer_metadata(const struct LDKRefund *NONNULL_PTR this_arg);
50293
50294 /**
50295  * A chain that the refund is valid for.
50296  */
50297 MUST_USE_RES struct LDKThirtyTwoBytes Refund_chain(const struct LDKRefund *NONNULL_PTR this_arg);
50298
50299 /**
50300  * The amount to refund in msats (i.e., the minimum lightning-payable unit for [`chain`]).
50301  *
50302  * [`chain`]: Self::chain
50303  */
50304 MUST_USE_RES uint64_t Refund_amount_msats(const struct LDKRefund *NONNULL_PTR this_arg);
50305
50306 /**
50307  * Features pertaining to requesting an invoice.
50308  */
50309 MUST_USE_RES struct LDKInvoiceRequestFeatures Refund_features(const struct LDKRefund *NONNULL_PTR this_arg);
50310
50311 /**
50312  * The quantity of an item that refund is for.
50313  */
50314 MUST_USE_RES struct LDKCOption_u64Z Refund_quantity(const struct LDKRefund *NONNULL_PTR this_arg);
50315
50316 /**
50317  * A public node id to send to in the case where there are no [`paths`]. Otherwise, a possibly
50318  * transient pubkey.
50319  *
50320  * [`paths`]: Self::paths
50321  */
50322 MUST_USE_RES struct LDKPublicKey Refund_payer_id(const struct LDKRefund *NONNULL_PTR this_arg);
50323
50324 /**
50325  * Payer provided note to include in the invoice.
50326  *
50327  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50328  */
50329 MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg);
50330
50331 /**
50332  * Generates a non-cryptographic 64-bit hash of the Refund.
50333  */
50334 uint64_t Refund_hash(const struct LDKRefund *NONNULL_PTR o);
50335
50336 /**
50337  * Serialize the Refund object into a byte array which can be read by Refund_read
50338  */
50339 struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj);
50340
50341 /**
50342  * Read a Refund object from a string
50343  */
50344 struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s);
50345
50346 /**
50347  * Get the string representation of a Refund object
50348  */
50349 struct LDKStr Refund_to_str(const struct LDKRefund *NONNULL_PTR o);
50350
50351 /**
50352  * Creates a copy of the UtxoLookupError
50353  */
50354 enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig);
50355
50356 /**
50357  * Utility method to constructs a new UnknownChain-variant UtxoLookupError
50358  */
50359 enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void);
50360
50361 /**
50362  * Utility method to constructs a new UnknownTx-variant UtxoLookupError
50363  */
50364 enum LDKUtxoLookupError UtxoLookupError_unknown_tx(void);
50365
50366 /**
50367  * Frees any resources used by the UtxoResult
50368  */
50369 void UtxoResult_free(struct LDKUtxoResult this_ptr);
50370
50371 /**
50372  * Creates a copy of the UtxoResult
50373  */
50374 struct LDKUtxoResult UtxoResult_clone(const struct LDKUtxoResult *NONNULL_PTR orig);
50375
50376 /**
50377  * Utility method to constructs a new Sync-variant UtxoResult
50378  */
50379 struct LDKUtxoResult UtxoResult_sync(struct LDKCResult_TxOutUtxoLookupErrorZ a);
50380
50381 /**
50382  * Utility method to constructs a new Async-variant UtxoResult
50383  */
50384 struct LDKUtxoResult UtxoResult_async(struct LDKUtxoFuture a);
50385
50386 /**
50387  * Calls the free function if one is set
50388  */
50389 void UtxoLookup_free(struct LDKUtxoLookup this_ptr);
50390
50391 /**
50392  * Frees any resources used by the UtxoFuture, if is_owned is set and inner is non-NULL.
50393  */
50394 void UtxoFuture_free(struct LDKUtxoFuture this_obj);
50395
50396 /**
50397  * Creates a copy of the UtxoFuture
50398  */
50399 struct LDKUtxoFuture UtxoFuture_clone(const struct LDKUtxoFuture *NONNULL_PTR orig);
50400
50401 /**
50402  * Builds a new future for later resolution.
50403  */
50404 MUST_USE_RES struct LDKUtxoFuture UtxoFuture_new(void);
50405
50406 /**
50407  * Resolves this future against the given `graph` and with the given `result`.
50408  *
50409  * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
50410  * forwarding the validated gossip message onwards to peers.
50411  *
50412  * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
50413  * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
50414  * after this.
50415  *
50416  * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
50417  * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
50418  */
50419 void UtxoFuture_resolve_without_forwarding(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, struct LDKCResult_TxOutUtxoLookupErrorZ result);
50420
50421 /**
50422  * Resolves this future against the given `graph` and with the given `result`.
50423  *
50424  * The given `gossip` is used to broadcast any validated messages onwards to all peers which
50425  * have available buffer space.
50426  *
50427  * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
50428  * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
50429  * after this.
50430  *
50431  * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
50432  * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
50433  */
50434 void UtxoFuture_resolve(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, const struct LDKP2PGossipSync *NONNULL_PTR gossip, struct LDKCResult_TxOutUtxoLookupErrorZ result);
50435
50436 /**
50437  * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
50438  */
50439 void NodeId_free(struct LDKNodeId this_obj);
50440
50441 /**
50442  * Creates a copy of the NodeId
50443  */
50444 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
50445
50446 /**
50447  * Create a new NodeId from a public key
50448  */
50449 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
50450
50451 /**
50452  * Create a new NodeId from a slice of bytes
50453  */
50454 MUST_USE_RES struct LDKCResult_NodeIdDecodeErrorZ NodeId_from_slice(struct LDKu8slice bytes);
50455
50456 /**
50457  * Get the public key slice from this NodeId
50458  */
50459 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
50460
50461 /**
50462  * Get the public key as an array from this NodeId
50463  */
50464 MUST_USE_RES const uint8_t (*NodeId_as_array(const struct LDKNodeId *NONNULL_PTR this_arg))[33];
50465
50466 /**
50467  * Get the public key from this NodeId
50468  */
50469 MUST_USE_RES struct LDKCResult_PublicKeySecp256k1ErrorZ NodeId_as_pubkey(const struct LDKNodeId *NONNULL_PTR this_arg);
50470
50471 /**
50472  * Get the string representation of a NodeId object
50473  */
50474 struct LDKStr NodeId_to_str(const struct LDKNodeId *NONNULL_PTR o);
50475
50476 /**
50477  * Generates a non-cryptographic 64-bit hash of the NodeId.
50478  */
50479 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
50480
50481 /**
50482  * Serialize the NodeId object into a byte array which can be read by NodeId_read
50483  */
50484 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
50485
50486 /**
50487  * Read a NodeId from a byte array, created by NodeId_write
50488  */
50489 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
50490
50491 /**
50492  * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
50493  */
50494 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
50495
50496 /**
50497  * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
50498  */
50499 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
50500
50501 /**
50502  * Frees any resources used by the NetworkUpdate
50503  */
50504 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
50505
50506 /**
50507  * Creates a copy of the NetworkUpdate
50508  */
50509 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
50510
50511 /**
50512  * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
50513  */
50514 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
50515
50516 /**
50517  * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
50518  */
50519 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
50520
50521 /**
50522  * Utility method to constructs a new NodeFailure-variant NetworkUpdate
50523  */
50524 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
50525
50526 /**
50527  * Checks if two NetworkUpdates contain equal inner contents.
50528  * This ignores pointers and is_owned flags and looks at the values in fields.
50529  */
50530 bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
50531
50532 /**
50533  * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
50534  */
50535 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
50536
50537 /**
50538  * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
50539  */
50540 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
50541
50542 /**
50543  * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
50544  */
50545 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
50546
50547 /**
50548  * Creates a new tracker of the actual state of the network of channels and nodes,
50549  * assuming an existing [`NetworkGraph`].
50550  * UTXO lookup is used to make sure announced channels exist on-chain, channel data is
50551  * correct, and the announcement is signed with channel owners' keys.
50552  */
50553 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_UtxoLookupZ utxo_lookup, struct LDKLogger logger);
50554
50555 /**
50556  * Adds a provider used to check new announcements. Does not affect
50557  * existing announcements unless they are updated.
50558  * Add, update or remove the provider would replace the current one.
50559  */
50560 void P2PGossipSync_add_utxo_lookup(const struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_UtxoLookupZ utxo_lookup);
50561
50562 /**
50563  * Handles any network updates originating from [`Event`]s.
50564  * Note that this will skip applying any [`NetworkUpdate::ChannelUpdateMessage`] to avoid
50565  * leaking possibly identifying information of the sender to the public network.
50566  *
50567  * [`Event`]: crate::events::Event
50568  */
50569 void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update);
50570
50571 /**
50572  * Gets the chain hash for this network graph.
50573  */
50574 MUST_USE_RES struct LDKThirtyTwoBytes NetworkGraph_get_chain_hash(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
50575
50576 /**
50577  * Verifies the signature of a [`NodeAnnouncement`].
50578  *
50579  * Returns an error if it is invalid.
50580  */
50581 struct LDKCResult_NoneLightningErrorZ verify_node_announcement(const struct LDKNodeAnnouncement *NONNULL_PTR msg);
50582
50583 /**
50584  * Verifies all signatures included in a [`ChannelAnnouncement`].
50585  *
50586  * Returns an error if one of the signatures is invalid.
50587  */
50588 struct LDKCResult_NoneLightningErrorZ verify_channel_announcement(const struct LDKChannelAnnouncement *NONNULL_PTR msg);
50589
50590 /**
50591  * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
50592  * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
50593  */
50594 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
50595
50596 /**
50597  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
50598  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
50599  */
50600 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
50601
50602 /**
50603  * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
50604  */
50605 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
50606
50607 /**
50608  * When the last update to the channel direction was issued.
50609  * Value is opaque, as set in the announcement.
50610  */
50611 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
50612
50613 /**
50614  * When the last update to the channel direction was issued.
50615  * Value is opaque, as set in the announcement.
50616  */
50617 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
50618
50619 /**
50620  * Whether the channel can be currently used for payments (in this one direction).
50621  */
50622 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
50623
50624 /**
50625  * Whether the channel can be currently used for payments (in this one direction).
50626  */
50627 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
50628
50629 /**
50630  * The difference in CLTV values that you must have when routing through this channel.
50631  */
50632 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
50633
50634 /**
50635  * The difference in CLTV values that you must have when routing through this channel.
50636  */
50637 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
50638
50639 /**
50640  * The minimum value, which must be relayed to the next hop via the channel
50641  */
50642 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
50643
50644 /**
50645  * The minimum value, which must be relayed to the next hop via the channel
50646  */
50647 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
50648
50649 /**
50650  * The maximum value which may be relayed to the next hop via the channel.
50651  */
50652 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
50653
50654 /**
50655  * The maximum value which may be relayed to the next hop via the channel.
50656  */
50657 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
50658
50659 /**
50660  * Fees charged when the channel is used for routing
50661  */
50662 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
50663
50664 /**
50665  * Fees charged when the channel is used for routing
50666  */
50667 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
50668
50669 /**
50670  * Most recent update for the channel received from the network
50671  * Mostly redundant with the data we store in fields explicitly.
50672  * Everything else is useful only for sending out for initial routing sync.
50673  * Not stored if contains excess data to prevent DoS.
50674  *
50675  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50676  */
50677 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
50678
50679 /**
50680  * Most recent update for the channel received from the network
50681  * Mostly redundant with the data we store in fields explicitly.
50682  * Everything else is useful only for sending out for initial routing sync.
50683  * Not stored if contains excess data to prevent DoS.
50684  *
50685  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
50686  */
50687 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
50688
50689 /**
50690  * Constructs a new ChannelUpdateInfo given each field
50691  *
50692  * Note that last_update_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
50693  */
50694 MUST_USE_RES struct LDKChannelUpdateInfo ChannelUpdateInfo_new(uint32_t last_update_arg, bool enabled_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, struct LDKChannelUpdate last_update_message_arg);
50695
50696 /**
50697  * Creates a copy of the ChannelUpdateInfo
50698  */
50699 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
50700
50701 /**
50702  * Checks if two ChannelUpdateInfos contain equal inner contents.
50703  * This ignores pointers and is_owned flags and looks at the values in fields.
50704  * Two objects with NULL inner values will be considered "equal" here.
50705  */
50706 bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
50707
50708 /**
50709  * Get the string representation of a ChannelUpdateInfo object
50710  */
50711 struct LDKStr ChannelUpdateInfo_to_str(const struct LDKChannelUpdateInfo *NONNULL_PTR o);
50712
50713 /**
50714  * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
50715  */
50716 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
50717
50718 /**
50719  * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
50720  */
50721 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
50722
50723 /**
50724  * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
50725  */
50726 void ChannelInfo_free(struct LDKChannelInfo this_obj);
50727
50728 /**
50729  * Protocol features of a channel communicated during its announcement
50730  */
50731 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
50732
50733 /**
50734  * Protocol features of a channel communicated during its announcement
50735  */
50736 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
50737
50738 /**
50739  * Source node of the first direction of a channel
50740  */
50741 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
50742
50743 /**
50744  * Source node of the first direction of a channel
50745  */
50746 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
50747
50748 /**
50749  * Details about the first direction of a channel
50750  *
50751  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50752  */
50753 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
50754
50755 /**
50756  * Details about the first direction of a channel
50757  *
50758  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
50759  */
50760 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
50761
50762 /**
50763  * Source node of the second direction of a channel
50764  */
50765 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
50766
50767 /**
50768  * Source node of the second direction of a channel
50769  */
50770 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
50771
50772 /**
50773  * Details about the second direction of a channel
50774  *
50775  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50776  */
50777 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
50778
50779 /**
50780  * Details about the second direction of a channel
50781  *
50782  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
50783  */
50784 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
50785
50786 /**
50787  * The channel capacity as seen on-chain, if chain lookup is available.
50788  */
50789 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
50790
50791 /**
50792  * The channel capacity as seen on-chain, if chain lookup is available.
50793  */
50794 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
50795
50796 /**
50797  * An initial announcement of the channel
50798  * Mostly redundant with the data we store in fields explicitly.
50799  * Everything else is useful only for sending out for initial routing sync.
50800  * Not stored if contains excess data to prevent DoS.
50801  *
50802  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50803  */
50804 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
50805
50806 /**
50807  * An initial announcement of the channel
50808  * Mostly redundant with the data we store in fields explicitly.
50809  * Everything else is useful only for sending out for initial routing sync.
50810  * Not stored if contains excess data to prevent DoS.
50811  *
50812  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
50813  */
50814 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
50815
50816 /**
50817  * Creates a copy of the ChannelInfo
50818  */
50819 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
50820
50821 /**
50822  * Checks if two ChannelInfos contain equal inner contents.
50823  * This ignores pointers and is_owned flags and looks at the values in fields.
50824  * Two objects with NULL inner values will be considered "equal" here.
50825  */
50826 bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
50827
50828 /**
50829  * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
50830  *
50831  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50832  */
50833 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
50834
50835 /**
50836  * Get the string representation of a ChannelInfo object
50837  */
50838 struct LDKStr ChannelInfo_to_str(const struct LDKChannelInfo *NONNULL_PTR o);
50839
50840 /**
50841  * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
50842  */
50843 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
50844
50845 /**
50846  * Read a ChannelInfo from a byte array, created by ChannelInfo_write
50847  */
50848 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
50849
50850 /**
50851  * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
50852  */
50853 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
50854
50855 /**
50856  * Creates a copy of the DirectedChannelInfo
50857  */
50858 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
50859
50860 /**
50861  * Returns information for the channel.
50862  */
50863 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
50864
50865 /**
50866  * Returns the [`EffectiveCapacity`] of the channel in the direction.
50867  *
50868  * This is either the total capacity from the funding transaction, if known, or the
50869  * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
50870  * otherwise.
50871  */
50872 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
50873
50874 /**
50875  * Returns the `node_id` of the source hop.
50876  *
50877  * Refers to the `node_id` forwarding the payment to the next hop.
50878  */
50879 MUST_USE_RES struct LDKNodeId DirectedChannelInfo_source(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
50880
50881 /**
50882  * Returns the `node_id` of the target hop.
50883  *
50884  * Refers to the `node_id` receiving the payment from the previous hop.
50885  */
50886 MUST_USE_RES struct LDKNodeId DirectedChannelInfo_target(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
50887
50888 /**
50889  * Frees any resources used by the EffectiveCapacity
50890  */
50891 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
50892
50893 /**
50894  * Creates a copy of the EffectiveCapacity
50895  */
50896 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
50897
50898 /**
50899  * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
50900  */
50901 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
50902
50903 /**
50904  * Utility method to constructs a new AdvertisedMaxHTLC-variant EffectiveCapacity
50905  */
50906 struct LDKEffectiveCapacity EffectiveCapacity_advertised_max_htlc(uint64_t amount_msat);
50907
50908 /**
50909  * Utility method to constructs a new Total-variant EffectiveCapacity
50910  */
50911 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat);
50912
50913 /**
50914  * Utility method to constructs a new Infinite-variant EffectiveCapacity
50915  */
50916 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
50917
50918 /**
50919  * Utility method to constructs a new HintMaxHTLC-variant EffectiveCapacity
50920  */
50921 struct LDKEffectiveCapacity EffectiveCapacity_hint_max_htlc(uint64_t amount_msat);
50922
50923 /**
50924  * Utility method to constructs a new Unknown-variant EffectiveCapacity
50925  */
50926 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
50927
50928 /**
50929  * Returns the effective capacity denominated in millisatoshi.
50930  */
50931 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
50932
50933 /**
50934  * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
50935  */
50936 void RoutingFees_free(struct LDKRoutingFees this_obj);
50937
50938 /**
50939  * Flat routing fee in millisatoshis.
50940  */
50941 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
50942
50943 /**
50944  * Flat routing fee in millisatoshis.
50945  */
50946 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
50947
50948 /**
50949  * Liquidity-based routing fee in millionths of a routed amount.
50950  * In other words, 10000 is 1%.
50951  */
50952 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
50953
50954 /**
50955  * Liquidity-based routing fee in millionths of a routed amount.
50956  * In other words, 10000 is 1%.
50957  */
50958 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
50959
50960 /**
50961  * Constructs a new RoutingFees given each field
50962  */
50963 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
50964
50965 /**
50966  * Checks if two RoutingFeess contain equal inner contents.
50967  * This ignores pointers and is_owned flags and looks at the values in fields.
50968  * Two objects with NULL inner values will be considered "equal" here.
50969  */
50970 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
50971
50972 /**
50973  * Creates a copy of the RoutingFees
50974  */
50975 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
50976
50977 /**
50978  * Generates a non-cryptographic 64-bit hash of the RoutingFees.
50979  */
50980 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
50981
50982 /**
50983  * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
50984  */
50985 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
50986
50987 /**
50988  * Read a RoutingFees from a byte array, created by RoutingFees_write
50989  */
50990 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
50991
50992 /**
50993  * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
50994  */
50995 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
50996
50997 /**
50998  * Protocol features the node announced support for
50999  */
51000 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
51001
51002 /**
51003  * Protocol features the node announced support for
51004  */
51005 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
51006
51007 /**
51008  * When the last known update to the node state was issued.
51009  * Value is opaque, as set in the announcement.
51010  */
51011 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
51012
51013 /**
51014  * When the last known update to the node state was issued.
51015  * Value is opaque, as set in the announcement.
51016  */
51017 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
51018
51019 /**
51020  * Color assigned to the node
51021  */
51022 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
51023
51024 /**
51025  * Color assigned to the node
51026  */
51027 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
51028
51029 /**
51030  * Moniker assigned to the node.
51031  * May be invalid or malicious (eg control chars),
51032  * should not be exposed to the user.
51033  */
51034 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
51035
51036 /**
51037  * Moniker assigned to the node.
51038  * May be invalid or malicious (eg control chars),
51039  * should not be exposed to the user.
51040  */
51041 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
51042
51043 /**
51044  * An initial announcement of the node
51045  * Mostly redundant with the data we store in fields explicitly.
51046  * Everything else is useful only for sending out for initial routing sync.
51047  * Not stored if contains excess data to prevent DoS.
51048  *
51049  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51050  */
51051 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
51052
51053 /**
51054  * An initial announcement of the node
51055  * Mostly redundant with the data we store in fields explicitly.
51056  * Everything else is useful only for sending out for initial routing sync.
51057  * Not stored if contains excess data to prevent DoS.
51058  *
51059  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
51060  */
51061 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
51062
51063 /**
51064  * Constructs a new NodeAnnouncementInfo given each field
51065  *
51066  * Note that announcement_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
51067  */
51068 MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKNodeAnnouncement announcement_message_arg);
51069
51070 /**
51071  * Creates a copy of the NodeAnnouncementInfo
51072  */
51073 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
51074
51075 /**
51076  * Checks if two NodeAnnouncementInfos contain equal inner contents.
51077  * This ignores pointers and is_owned flags and looks at the values in fields.
51078  * Two objects with NULL inner values will be considered "equal" here.
51079  */
51080 bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
51081
51082 /**
51083  * Internet-level addresses via which one can connect to the node
51084  */
51085 MUST_USE_RES struct LDKCVec_SocketAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
51086
51087 /**
51088  * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
51089  */
51090 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
51091
51092 /**
51093  * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
51094  */
51095 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
51096
51097 /**
51098  * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
51099  */
51100 void NodeAlias_free(struct LDKNodeAlias this_obj);
51101
51102 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
51103
51104 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
51105
51106 /**
51107  * Constructs a new NodeAlias given each field
51108  */
51109 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
51110
51111 /**
51112  * Creates a copy of the NodeAlias
51113  */
51114 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
51115
51116 /**
51117  * Generates a non-cryptographic 64-bit hash of the NodeAlias.
51118  */
51119 uint64_t NodeAlias_hash(const struct LDKNodeAlias *NONNULL_PTR o);
51120
51121 /**
51122  * Checks if two NodeAliass contain equal inner contents.
51123  * This ignores pointers and is_owned flags and looks at the values in fields.
51124  * Two objects with NULL inner values will be considered "equal" here.
51125  */
51126 bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
51127
51128 /**
51129  * Get the string representation of a NodeAlias object
51130  */
51131 struct LDKStr NodeAlias_to_str(const struct LDKNodeAlias *NONNULL_PTR o);
51132
51133 /**
51134  * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
51135  */
51136 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
51137
51138 /**
51139  * Read a NodeAlias from a byte array, created by NodeAlias_write
51140  */
51141 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
51142
51143 /**
51144  * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
51145  */
51146 void NodeInfo_free(struct LDKNodeInfo this_obj);
51147
51148 /**
51149  * All valid channels a node has announced
51150  *
51151  * Returns a copy of the field.
51152  */
51153 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
51154
51155 /**
51156  * All valid channels a node has announced
51157  */
51158 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
51159
51160 /**
51161  * More information about a node from node_announcement.
51162  * Optional because we store a Node entry after learning about it from
51163  * a channel announcement, but before receiving a node announcement.
51164  *
51165  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51166  */
51167 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
51168
51169 /**
51170  * More information about a node from node_announcement.
51171  * Optional because we store a Node entry after learning about it from
51172  * a channel announcement, but before receiving a node announcement.
51173  *
51174  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
51175  */
51176 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
51177
51178 /**
51179  * Constructs a new NodeInfo given each field
51180  *
51181  * Note that announcement_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
51182  */
51183 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
51184
51185 /**
51186  * Creates a copy of the NodeInfo
51187  */
51188 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
51189
51190 /**
51191  * Checks if two NodeInfos contain equal inner contents.
51192  * This ignores pointers and is_owned flags and looks at the values in fields.
51193  * Two objects with NULL inner values will be considered "equal" here.
51194  */
51195 bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
51196
51197 /**
51198  * Returns whether the node has only announced Tor addresses.
51199  */
51200 MUST_USE_RES bool NodeInfo_is_tor_only(const struct LDKNodeInfo *NONNULL_PTR this_arg);
51201
51202 /**
51203  * Get the string representation of a NodeInfo object
51204  */
51205 struct LDKStr NodeInfo_to_str(const struct LDKNodeInfo *NONNULL_PTR o);
51206
51207 /**
51208  * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
51209  */
51210 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
51211
51212 /**
51213  * Read a NodeInfo from a byte array, created by NodeInfo_write
51214  */
51215 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
51216
51217 /**
51218  * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
51219  */
51220 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
51221
51222 /**
51223  * Read a NetworkGraph from a byte array, created by NetworkGraph_write
51224  */
51225 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
51226
51227 /**
51228  * Get the string representation of a NetworkGraph object
51229  */
51230 struct LDKStr NetworkGraph_to_str(const struct LDKNetworkGraph *NONNULL_PTR o);
51231
51232 /**
51233  * Creates a new, empty, network graph.
51234  */
51235 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger);
51236
51237 /**
51238  * Returns a read-only view of the network graph.
51239  */
51240 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
51241
51242 /**
51243  * The unix timestamp provided by the most recent rapid gossip sync.
51244  * It will be set by the rapid sync process after every sync completion.
51245  */
51246 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
51247
51248 /**
51249  * Update the unix timestamp provided by the most recent rapid gossip sync.
51250  * This should be done automatically by the rapid sync process after every sync completion.
51251  */
51252 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
51253
51254 /**
51255  * For an already known node (from channel announcements), update its stored properties from a
51256  * given node announcement.
51257  *
51258  * You probably don't want to call this directly, instead relying on a P2PGossipSync's
51259  * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
51260  * routing messages from a source using a protocol other than the lightning P2P protocol.
51261  */
51262 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
51263
51264 /**
51265  * For an already known node (from channel announcements), update its stored properties from a
51266  * given node announcement without verifying the associated signatures. Because we aren't
51267  * given the associated signatures here we cannot relay the node announcement to any of our
51268  * peers.
51269  */
51270 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
51271
51272 /**
51273  * Store or update channel info from a channel announcement.
51274  *
51275  * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
51276  * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
51277  * routing messages from a source using a protocol other than the lightning P2P protocol.
51278  *
51279  * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
51280  * the corresponding UTXO exists on chain and is correctly-formatted.
51281  */
51282 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_UtxoLookupZ utxo_lookup);
51283
51284 /**
51285  * Store or update channel info from a channel announcement.
51286  *
51287  * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
51288  * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
51289  * routing messages from a source using a protocol other than the lightning P2P protocol.
51290  *
51291  * This will skip verification of if the channel is actually on-chain.
51292  */
51293 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement_no_lookup(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
51294
51295 /**
51296  * Store or update channel info from a channel announcement without verifying the associated
51297  * signatures. Because we aren't given the associated signatures here we cannot relay the
51298  * channel announcement to any of our peers.
51299  *
51300  * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
51301  * the corresponding UTXO exists on chain and is correctly-formatted.
51302  */
51303 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_UtxoLookupZ utxo_lookup);
51304
51305 /**
51306  * Update channel from partial announcement data received via rapid gossip sync
51307  *
51308  * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
51309  * rapid gossip sync server)
51310  *
51311  * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
51312  */
51313 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_add_channel_from_partial_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, uint64_t timestamp, struct LDKChannelFeatures features, struct LDKPublicKey node_id_1, struct LDKPublicKey node_id_2);
51314
51315 /**
51316  * Marks a channel in the graph as failed permanently.
51317  *
51318  * The channel and any node for which this was their last channel are removed from the graph.
51319  */
51320 void NetworkGraph_channel_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
51321
51322 /**
51323  * Marks a node in the graph as permanently failed, effectively removing it and its channels
51324  * from local storage.
51325  */
51326 void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
51327
51328 /**
51329  * Removes information about channels that we haven't heard any updates about in some time.
51330  * This can be used regularly to prune the network graph of channels that likely no longer
51331  * exist.
51332  *
51333  * While there is no formal requirement that nodes regularly re-broadcast their channel
51334  * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
51335  * pruning occur for updates which are at least two weeks old, which we implement here.
51336  *
51337  * Note that for users of the `lightning-background-processor` crate this method may be
51338  * automatically called regularly for you.
51339  *
51340  * This method will also cause us to stop tracking removed nodes and channels if they have been
51341  * in the map for a while so that these can be resynced from gossip in the future.
51342  *
51343  * This method is only available with the `std` feature. See
51344  * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
51345  */
51346 void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
51347
51348 /**
51349  * Removes information about channels that we haven't heard any updates about in some time.
51350  * This can be used regularly to prune the network graph of channels that likely no longer
51351  * exist.
51352  *
51353  * While there is no formal requirement that nodes regularly re-broadcast their channel
51354  * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
51355  * pruning occur for updates which are at least two weeks old, which we implement here.
51356  *
51357  * This method will also cause us to stop tracking removed nodes and channels if they have been
51358  * in the map for a while so that these can be resynced from gossip in the future.
51359  *
51360  * This function takes the current unix time as an argument. For users with the `std` feature
51361  * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
51362  */
51363 void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
51364
51365 /**
51366  * For an already known (from announcement) channel, update info about one of the directions
51367  * of the channel.
51368  *
51369  * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
51370  * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
51371  * routing messages from a source using a protocol other than the lightning P2P protocol.
51372  *
51373  * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
51374  * materially in the future will be rejected.
51375  */
51376 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
51377
51378 /**
51379  * For an already known (from announcement) channel, update info about one of the directions
51380  * of the channel without verifying the associated signatures. Because we aren't given the
51381  * associated signatures here we cannot relay the channel update to any of our peers.
51382  *
51383  * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
51384  * materially in the future will be rejected.
51385  */
51386 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
51387
51388 /**
51389  * For an already known (from announcement) channel, verify the given [`ChannelUpdate`].
51390  *
51391  * This checks whether the update currently is applicable by [`Self::update_channel`].
51392  *
51393  * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
51394  * materially in the future will be rejected.
51395  */
51396 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_verify_channel_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
51397
51398 /**
51399  * Returns information on a channel with the given id.
51400  *
51401  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51402  */
51403 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
51404
51405 /**
51406  * Returns the list of channels in the graph
51407  */
51408 MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
51409
51410 /**
51411  * Returns information on a node with the given id.
51412  *
51413  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51414  */
51415 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
51416
51417 /**
51418  * Returns the list of nodes in the graph
51419  */
51420 MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
51421
51422 /**
51423  * Get network addresses by node id.
51424  * Returns None if the requested node is completely unknown,
51425  * or if node announcement for the node was never received.
51426  */
51427 MUST_USE_RES struct LDKCOption_CVec_SocketAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
51428
51429 /**
51430  * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
51431  */
51432 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
51433
51434 /**
51435  * Creates a new router.
51436  */
51437 MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKEntropySource entropy_source, struct LDKLockableScore scorer, struct LDKProbabilisticScoringFeeParameters score_params);
51438
51439 /**
51440  * Constructs a new Router which calls the relevant methods on this_arg.
51441  * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
51442  */
51443 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
51444
51445 /**
51446  * Constructs a new MessageRouter which calls the relevant methods on this_arg.
51447  * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
51448  */
51449 struct LDKMessageRouter DefaultRouter_as_MessageRouter(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
51450
51451 /**
51452  * Calls the free function if one is set
51453  */
51454 void Router_free(struct LDKRouter this_ptr);
51455
51456 /**
51457  * Frees any resources used by the ScorerAccountingForInFlightHtlcs, if is_owned is set and inner is non-NULL.
51458  */
51459 void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj);
51460
51461 /**
51462  * Initialize a new `ScorerAccountingForInFlightHtlcs`.
51463  */
51464 MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScoreLookUp scorer, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs);
51465
51466 /**
51467  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
51468  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
51469  */
51470 struct LDKScoreLookUp ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg);
51471
51472 /**
51473  * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
51474  */
51475 void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
51476
51477 /**
51478  * Creates a copy of the InFlightHtlcs
51479  */
51480 struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig);
51481
51482 /**
51483  * Constructs an empty `InFlightHtlcs`.
51484  */
51485 MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void);
51486
51487 /**
51488  * Takes in a path with payer's node id and adds the path's details to `InFlightHtlcs`.
51489  */
51490 void InFlightHtlcs_process_path(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, struct LDKPublicKey payer_node_id);
51491
51492 /**
51493  * Adds a known HTLC given the public key of the HTLC source, target, and short channel
51494  * id.
51495  */
51496 void InFlightHtlcs_add_inflight_htlc(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, uint64_t channel_scid, uint64_t used_msat);
51497
51498 /**
51499  * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
51500  * id.
51501  */
51502 MUST_USE_RES struct LDKCOption_u64Z InFlightHtlcs_used_liquidity_msat(const struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, uint64_t channel_scid);
51503
51504 /**
51505  * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
51506  */
51507 struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
51508
51509 /**
51510  * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
51511  */
51512 struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
51513
51514 /**
51515  * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
51516  */
51517 void RouteHop_free(struct LDKRouteHop this_obj);
51518
51519 /**
51520  * The node_id of the node at this hop.
51521  */
51522 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
51523
51524 /**
51525  * The node_id of the node at this hop.
51526  */
51527 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
51528
51529 /**
51530  * The node_announcement features of the node at this hop. For the last hop, these may be
51531  * amended to match the features present in the invoice this node generated.
51532  */
51533 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
51534
51535 /**
51536  * The node_announcement features of the node at this hop. For the last hop, these may be
51537  * amended to match the features present in the invoice this node generated.
51538  */
51539 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
51540
51541 /**
51542  * The channel that should be used from the previous hop to reach this node.
51543  */
51544 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
51545
51546 /**
51547  * The channel that should be used from the previous hop to reach this node.
51548  */
51549 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
51550
51551 /**
51552  * The channel_announcement features of the channel that should be used from the previous hop
51553  * to reach this node.
51554  */
51555 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
51556
51557 /**
51558  * The channel_announcement features of the channel that should be used from the previous hop
51559  * to reach this node.
51560  */
51561 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
51562
51563 /**
51564  * The fee taken on this hop (for paying for the use of the *next* channel in the path).
51565  * If this is the last hop in [`Path::hops`]:
51566  * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
51567  * * otherwise, this is the full value of this [`Path`]'s part of the payment
51568  *
51569  * [`BlindedPath`]: crate::blinded_path::BlindedPath
51570  */
51571 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
51572
51573 /**
51574  * The fee taken on this hop (for paying for the use of the *next* channel in the path).
51575  * If this is the last hop in [`Path::hops`]:
51576  * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
51577  * * otherwise, this is the full value of this [`Path`]'s part of the payment
51578  *
51579  * [`BlindedPath`]: crate::blinded_path::BlindedPath
51580  */
51581 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
51582
51583 /**
51584  * The CLTV delta added for this hop.
51585  * If this is the last hop in [`Path::hops`]:
51586  * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
51587  * * otherwise, this is the CLTV delta expected at the destination
51588  *
51589  * [`BlindedPath`]: crate::blinded_path::BlindedPath
51590  */
51591 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
51592
51593 /**
51594  * The CLTV delta added for this hop.
51595  * If this is the last hop in [`Path::hops`]:
51596  * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
51597  * * otherwise, this is the CLTV delta expected at the destination
51598  *
51599  * [`BlindedPath`]: crate::blinded_path::BlindedPath
51600  */
51601 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
51602
51603 /**
51604  * Indicates whether this hop is possibly announced in the public network graph.
51605  *
51606  * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
51607  * either know for sure it's announced in the public graph, or if any public channels exist
51608  * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
51609  * the channel to be unannounced.
51610  *
51611  * Will be `true` for objects serialized with LDK version 0.0.116 and before.
51612  */
51613 bool RouteHop_get_maybe_announced_channel(const struct LDKRouteHop *NONNULL_PTR this_ptr);
51614
51615 /**
51616  * Indicates whether this hop is possibly announced in the public network graph.
51617  *
51618  * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
51619  * either know for sure it's announced in the public graph, or if any public channels exist
51620  * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
51621  * the channel to be unannounced.
51622  *
51623  * Will be `true` for objects serialized with LDK version 0.0.116 and before.
51624  */
51625 void RouteHop_set_maybe_announced_channel(struct LDKRouteHop *NONNULL_PTR this_ptr, bool val);
51626
51627 /**
51628  * Constructs a new RouteHop given each field
51629  */
51630 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, bool maybe_announced_channel_arg);
51631
51632 /**
51633  * Creates a copy of the RouteHop
51634  */
51635 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
51636
51637 /**
51638  * Generates a non-cryptographic 64-bit hash of the RouteHop.
51639  */
51640 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
51641
51642 /**
51643  * Checks if two RouteHops contain equal inner contents.
51644  * This ignores pointers and is_owned flags and looks at the values in fields.
51645  * Two objects with NULL inner values will be considered "equal" here.
51646  */
51647 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
51648
51649 /**
51650  * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
51651  */
51652 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
51653
51654 /**
51655  * Read a RouteHop from a byte array, created by RouteHop_write
51656  */
51657 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
51658
51659 /**
51660  * Frees any resources used by the BlindedTail, if is_owned is set and inner is non-NULL.
51661  */
51662 void BlindedTail_free(struct LDKBlindedTail this_obj);
51663
51664 /**
51665  * The hops of the [`BlindedPath`] provided by the recipient.
51666  *
51667  * [`BlindedPath`]: crate::blinded_path::BlindedPath
51668  */
51669 struct LDKCVec_BlindedHopZ BlindedTail_get_hops(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
51670
51671 /**
51672  * The hops of the [`BlindedPath`] provided by the recipient.
51673  *
51674  * [`BlindedPath`]: crate::blinded_path::BlindedPath
51675  */
51676 void BlindedTail_set_hops(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
51677
51678 /**
51679  * The blinding point of the [`BlindedPath`] provided by the recipient.
51680  *
51681  * [`BlindedPath`]: crate::blinded_path::BlindedPath
51682  */
51683 struct LDKPublicKey BlindedTail_get_blinding_point(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
51684
51685 /**
51686  * The blinding point of the [`BlindedPath`] provided by the recipient.
51687  *
51688  * [`BlindedPath`]: crate::blinded_path::BlindedPath
51689  */
51690 void BlindedTail_set_blinding_point(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKPublicKey val);
51691
51692 /**
51693  * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
51694  * inferring the destination. May be 0.
51695  */
51696 uint32_t BlindedTail_get_excess_final_cltv_expiry_delta(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
51697
51698 /**
51699  * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
51700  * inferring the destination. May be 0.
51701  */
51702 void BlindedTail_set_excess_final_cltv_expiry_delta(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint32_t val);
51703
51704 /**
51705  * The total amount paid on this [`Path`], excluding the fees.
51706  */
51707 uint64_t BlindedTail_get_final_value_msat(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
51708
51709 /**
51710  * The total amount paid on this [`Path`], excluding the fees.
51711  */
51712 void BlindedTail_set_final_value_msat(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint64_t val);
51713
51714 /**
51715  * Constructs a new BlindedTail given each field
51716  */
51717 MUST_USE_RES struct LDKBlindedTail BlindedTail_new(struct LDKCVec_BlindedHopZ hops_arg, struct LDKPublicKey blinding_point_arg, uint32_t excess_final_cltv_expiry_delta_arg, uint64_t final_value_msat_arg);
51718
51719 /**
51720  * Creates a copy of the BlindedTail
51721  */
51722 struct LDKBlindedTail BlindedTail_clone(const struct LDKBlindedTail *NONNULL_PTR orig);
51723
51724 /**
51725  * Generates a non-cryptographic 64-bit hash of the BlindedTail.
51726  */
51727 uint64_t BlindedTail_hash(const struct LDKBlindedTail *NONNULL_PTR o);
51728
51729 /**
51730  * Checks if two BlindedTails contain equal inner contents.
51731  * This ignores pointers and is_owned flags and looks at the values in fields.
51732  * Two objects with NULL inner values will be considered "equal" here.
51733  */
51734 bool BlindedTail_eq(const struct LDKBlindedTail *NONNULL_PTR a, const struct LDKBlindedTail *NONNULL_PTR b);
51735
51736 /**
51737  * Serialize the BlindedTail object into a byte array which can be read by BlindedTail_read
51738  */
51739 struct LDKCVec_u8Z BlindedTail_write(const struct LDKBlindedTail *NONNULL_PTR obj);
51740
51741 /**
51742  * Read a BlindedTail from a byte array, created by BlindedTail_write
51743  */
51744 struct LDKCResult_BlindedTailDecodeErrorZ BlindedTail_read(struct LDKu8slice ser);
51745
51746 /**
51747  * Frees any resources used by the Path, if is_owned is set and inner is non-NULL.
51748  */
51749 void Path_free(struct LDKPath this_obj);
51750
51751 /**
51752  * The list of unblinded hops in this [`Path`]. Must be at least length one.
51753  */
51754 struct LDKCVec_RouteHopZ Path_get_hops(const struct LDKPath *NONNULL_PTR this_ptr);
51755
51756 /**
51757  * The list of unblinded hops in this [`Path`]. Must be at least length one.
51758  */
51759 void Path_set_hops(struct LDKPath *NONNULL_PTR this_ptr, struct LDKCVec_RouteHopZ val);
51760
51761 /**
51762  * The blinded path at which this path terminates, if we're sending to one, and its metadata.
51763  *
51764  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51765  */
51766 struct LDKBlindedTail Path_get_blinded_tail(const struct LDKPath *NONNULL_PTR this_ptr);
51767
51768 /**
51769  * The blinded path at which this path terminates, if we're sending to one, and its metadata.
51770  *
51771  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
51772  */
51773 void Path_set_blinded_tail(struct LDKPath *NONNULL_PTR this_ptr, struct LDKBlindedTail val);
51774
51775 /**
51776  * Constructs a new Path given each field
51777  *
51778  * Note that blinded_tail_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
51779  */
51780 MUST_USE_RES struct LDKPath Path_new(struct LDKCVec_RouteHopZ hops_arg, struct LDKBlindedTail blinded_tail_arg);
51781
51782 /**
51783  * Creates a copy of the Path
51784  */
51785 struct LDKPath Path_clone(const struct LDKPath *NONNULL_PTR orig);
51786
51787 /**
51788  * Generates a non-cryptographic 64-bit hash of the Path.
51789  */
51790 uint64_t Path_hash(const struct LDKPath *NONNULL_PTR o);
51791
51792 /**
51793  * Checks if two Paths contain equal inner contents.
51794  * This ignores pointers and is_owned flags and looks at the values in fields.
51795  * Two objects with NULL inner values will be considered "equal" here.
51796  */
51797 bool Path_eq(const struct LDKPath *NONNULL_PTR a, const struct LDKPath *NONNULL_PTR b);
51798
51799 /**
51800  * Gets the fees for a given path, excluding any excess paid to the recipient.
51801  */
51802 MUST_USE_RES uint64_t Path_fee_msat(const struct LDKPath *NONNULL_PTR this_arg);
51803
51804 /**
51805  * Gets the total amount paid on this [`Path`], excluding the fees.
51806  */
51807 MUST_USE_RES uint64_t Path_final_value_msat(const struct LDKPath *NONNULL_PTR this_arg);
51808
51809 /**
51810  * Gets the final hop's CLTV expiry delta.
51811  */
51812 MUST_USE_RES struct LDKCOption_u32Z Path_final_cltv_expiry_delta(const struct LDKPath *NONNULL_PTR this_arg);
51813
51814 /**
51815  * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
51816  */
51817 void Route_free(struct LDKRoute this_obj);
51818
51819 /**
51820  * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
51821  * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
51822  * the same.
51823  */
51824 struct LDKCVec_PathZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
51825
51826 /**
51827  * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
51828  * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
51829  * the same.
51830  */
51831 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_PathZ val);
51832
51833 /**
51834  * The `route_params` parameter passed to [`find_route`].
51835  *
51836  * This is used by `ChannelManager` to track information which may be required for retries.
51837  *
51838  * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
51839  *
51840  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51841  */
51842 struct LDKRouteParameters Route_get_route_params(const struct LDKRoute *NONNULL_PTR this_ptr);
51843
51844 /**
51845  * The `route_params` parameter passed to [`find_route`].
51846  *
51847  * This is used by `ChannelManager` to track information which may be required for retries.
51848  *
51849  * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
51850  *
51851  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
51852  */
51853 void Route_set_route_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKRouteParameters val);
51854
51855 /**
51856  * Constructs a new Route given each field
51857  *
51858  * Note that route_params_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
51859  */
51860 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_PathZ paths_arg, struct LDKRouteParameters route_params_arg);
51861
51862 /**
51863  * Creates a copy of the Route
51864  */
51865 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
51866
51867 /**
51868  * Generates a non-cryptographic 64-bit hash of the Route.
51869  */
51870 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
51871
51872 /**
51873  * Checks if two Routes contain equal inner contents.
51874  * This ignores pointers and is_owned flags and looks at the values in fields.
51875  * Two objects with NULL inner values will be considered "equal" here.
51876  */
51877 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
51878
51879 /**
51880  * Returns the total amount of fees paid on this [`Route`].
51881  *
51882  * For objects serialized with LDK 0.0.117 and after, this includes any extra payment made to
51883  * the recipient, which can happen in excess of the amount passed to [`find_route`] via
51884  * [`RouteParameters::final_value_msat`], if we had to reach the [`htlc_minimum_msat`] limits.
51885  *
51886  * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
51887  */
51888 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
51889
51890 /**
51891  * Returns the total amount paid on this [`Route`], excluding the fees.
51892  *
51893  * Might be more than requested as part of the given [`RouteParameters::final_value_msat`] if
51894  * we had to reach the [`htlc_minimum_msat`] limits.
51895  *
51896  * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
51897  */
51898 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
51899
51900 /**
51901  * Get the string representation of a Route object
51902  */
51903 struct LDKStr Route_to_str(const struct LDKRoute *NONNULL_PTR o);
51904
51905 /**
51906  * Serialize the Route object into a byte array which can be read by Route_read
51907  */
51908 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
51909
51910 /**
51911  * Read a Route from a byte array, created by Route_write
51912  */
51913 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
51914
51915 /**
51916  * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
51917  */
51918 void RouteParameters_free(struct LDKRouteParameters this_obj);
51919
51920 /**
51921  * The parameters of the failed payment path.
51922  */
51923 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
51924
51925 /**
51926  * The parameters of the failed payment path.
51927  */
51928 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
51929
51930 /**
51931  * The amount in msats sent on the failed payment path.
51932  */
51933 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
51934
51935 /**
51936  * The amount in msats sent on the failed payment path.
51937  */
51938 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
51939
51940 /**
51941  * The maximum total fees, in millisatoshi, that may accrue during route finding.
51942  *
51943  * This limit also applies to the total fees that may arise while retrying failed payment
51944  * paths.
51945  *
51946  * Note that values below a few sats may result in some paths being spuriously ignored.
51947  */
51948 struct LDKCOption_u64Z RouteParameters_get_max_total_routing_fee_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
51949
51950 /**
51951  * The maximum total fees, in millisatoshi, that may accrue during route finding.
51952  *
51953  * This limit also applies to the total fees that may arise while retrying failed payment
51954  * paths.
51955  *
51956  * Note that values below a few sats may result in some paths being spuriously ignored.
51957  */
51958 void RouteParameters_set_max_total_routing_fee_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
51959
51960 /**
51961  * Constructs a new RouteParameters given each field
51962  */
51963 MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPaymentParameters payment_params_arg, uint64_t final_value_msat_arg, struct LDKCOption_u64Z max_total_routing_fee_msat_arg);
51964
51965 /**
51966  * Creates a copy of the RouteParameters
51967  */
51968 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
51969
51970 /**
51971  * Generates a non-cryptographic 64-bit hash of the RouteParameters.
51972  */
51973 uint64_t RouteParameters_hash(const struct LDKRouteParameters *NONNULL_PTR o);
51974
51975 /**
51976  * Checks if two RouteParameterss contain equal inner contents.
51977  * This ignores pointers and is_owned flags and looks at the values in fields.
51978  * Two objects with NULL inner values will be considered "equal" here.
51979  */
51980 bool RouteParameters_eq(const struct LDKRouteParameters *NONNULL_PTR a, const struct LDKRouteParameters *NONNULL_PTR b);
51981
51982 /**
51983  * Constructs [`RouteParameters`] from the given [`PaymentParameters`] and a payment amount.
51984  *
51985  * [`Self::max_total_routing_fee_msat`] defaults to 1% of the payment amount + 50 sats
51986  */
51987 MUST_USE_RES struct LDKRouteParameters RouteParameters_from_payment_params_and_value(struct LDKPaymentParameters payment_params, uint64_t final_value_msat);
51988
51989 /**
51990  * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
51991  */
51992 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
51993
51994 /**
51995  * Read a RouteParameters from a byte array, created by RouteParameters_write
51996  */
51997 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
51998
51999 /**
52000  * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
52001  */
52002 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
52003
52004 /**
52005  * Information about the payee, such as their features and route hints for their channels.
52006  */
52007 struct LDKPayee PaymentParameters_get_payee(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
52008
52009 /**
52010  * Information about the payee, such as their features and route hints for their channels.
52011  */
52012 void PaymentParameters_set_payee(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
52013
52014 /**
52015  * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
52016  */
52017 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
52018
52019 /**
52020  * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
52021  */
52022 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
52023
52024 /**
52025  * The maximum total CLTV delta we accept for the route.
52026  * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
52027  */
52028 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
52029
52030 /**
52031  * The maximum total CLTV delta we accept for the route.
52032  * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
52033  */
52034 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
52035
52036 /**
52037  * The maximum number of paths that may be used by (MPP) payments.
52038  * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
52039  */
52040 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
52041
52042 /**
52043  * The maximum number of paths that may be used by (MPP) payments.
52044  * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
52045  */
52046 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
52047
52048 /**
52049  * Selects the maximum share of a channel's total capacity which will be sent over a channel,
52050  * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
52051  * a lower value prefers to send larger MPP parts, potentially saturating channels and
52052  * increasing failure probability for those paths.
52053  *
52054  * Note that this restriction will be relaxed during pathfinding after paths which meet this
52055  * restriction have been found. While paths which meet this criteria will be searched for, it
52056  * is ultimately up to the scorer to select them over other paths.
52057  *
52058  * A value of 0 will allow payments up to and including a channel's total announced usable
52059  * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
52060  *
52061  * Default value: 2
52062  */
52063 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
52064
52065 /**
52066  * Selects the maximum share of a channel's total capacity which will be sent over a channel,
52067  * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
52068  * a lower value prefers to send larger MPP parts, potentially saturating channels and
52069  * increasing failure probability for those paths.
52070  *
52071  * Note that this restriction will be relaxed during pathfinding after paths which meet this
52072  * restriction have been found. While paths which meet this criteria will be searched for, it
52073  * is ultimately up to the scorer to select them over other paths.
52074  *
52075  * A value of 0 will allow payments up to and including a channel's total announced usable
52076  * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
52077  *
52078  * Default value: 2
52079  */
52080 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
52081
52082 /**
52083  * A list of SCIDs which this payment was previously attempted over and which caused the
52084  * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
52085  * these SCIDs.
52086  *
52087  * Returns a copy of the field.
52088  */
52089 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
52090
52091 /**
52092  * A list of SCIDs which this payment was previously attempted over and which caused the
52093  * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
52094  * these SCIDs.
52095  */
52096 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
52097
52098 /**
52099  * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
52100  * payment was previously attempted over and which caused the payment to fail. Future attempts
52101  * for the same payment shouldn't be relayed through any of these blinded paths.
52102  *
52103  * Returns a copy of the field.
52104  */
52105 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_blinded_path_idxs(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
52106
52107 /**
52108  * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
52109  * payment was previously attempted over and which caused the payment to fail. Future attempts
52110  * for the same payment shouldn't be relayed through any of these blinded paths.
52111  */
52112 void PaymentParameters_set_previously_failed_blinded_path_idxs(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
52113
52114 /**
52115  * Constructs a new PaymentParameters given each field
52116  */
52117 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_new(struct LDKPayee payee_arg, struct LDKCOption_u64Z expiry_time_arg, uint32_t max_total_cltv_expiry_delta_arg, uint8_t max_path_count_arg, uint8_t max_channel_saturation_power_of_half_arg, struct LDKCVec_u64Z previously_failed_channels_arg, struct LDKCVec_u64Z previously_failed_blinded_path_idxs_arg);
52118
52119 /**
52120  * Creates a copy of the PaymentParameters
52121  */
52122 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
52123
52124 /**
52125  * Generates a non-cryptographic 64-bit hash of the PaymentParameters.
52126  */
52127 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
52128
52129 /**
52130  * Checks if two PaymentParameterss contain equal inner contents.
52131  * This ignores pointers and is_owned flags and looks at the values in fields.
52132  * Two objects with NULL inner values will be considered "equal" here.
52133  */
52134 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
52135
52136 /**
52137  * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
52138  */
52139 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
52140
52141 /**
52142  * Read a PaymentParameters from a byte array, created by PaymentParameters_write
52143  */
52144 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser, uint32_t arg);
52145
52146 /**
52147  * Creates a payee with the node id of the given `pubkey`.
52148  *
52149  * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
52150  * provided.
52151  */
52152 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
52153
52154 /**
52155  * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
52156  *
52157  * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
52158  * provided.
52159  *
52160  * Note that MPP keysend is not widely supported yet. The `allow_mpp` lets you choose
52161  * whether your router will be allowed to find a multi-part route for this payment. If you
52162  * set `allow_mpp` to true, you should ensure a payment secret is set on send, likely via
52163  * [`RecipientOnionFields::secret_only`].
52164  *
52165  * [`RecipientOnionFields::secret_only`]: crate::ln::channelmanager::RecipientOnionFields::secret_only
52166  */
52167 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta, bool allow_mpp);
52168
52169 /**
52170  * Creates parameters for paying to a blinded payee from the provided invoice. Sets
52171  * [`Payee::Blinded::route_hints`], [`Payee::Blinded::features`], and
52172  * [`PaymentParameters::expiry_time`].
52173  */
52174 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_bolt12_invoice(const struct LDKBolt12Invoice *NONNULL_PTR invoice);
52175
52176 /**
52177  * Creates parameters for paying to a blinded payee from the provided blinded route hints.
52178  */
52179 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints);
52180
52181 /**
52182  * Frees any resources used by the Payee
52183  */
52184 void Payee_free(struct LDKPayee this_ptr);
52185
52186 /**
52187  * Creates a copy of the Payee
52188  */
52189 struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
52190
52191 /**
52192  * Utility method to constructs a new Blinded-variant Payee
52193  */
52194 struct LDKPayee Payee_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints, struct LDKBolt12InvoiceFeatures features);
52195
52196 /**
52197  * Utility method to constructs a new Clear-variant Payee
52198  */
52199 struct LDKPayee Payee_clear(struct LDKPublicKey node_id, struct LDKCVec_RouteHintZ route_hints, struct LDKBolt11InvoiceFeatures features, uint32_t final_cltv_expiry_delta);
52200
52201 /**
52202  * Generates a non-cryptographic 64-bit hash of the Payee.
52203  */
52204 uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
52205
52206 /**
52207  * Checks if two Payees contain equal inner contents.
52208  * This ignores pointers and is_owned flags and looks at the values in fields.
52209  */
52210 bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
52211
52212 /**
52213  * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
52214  */
52215 void RouteHint_free(struct LDKRouteHint this_obj);
52216
52217 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
52218
52219 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
52220
52221 /**
52222  * Constructs a new RouteHint given each field
52223  */
52224 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
52225
52226 /**
52227  * Creates a copy of the RouteHint
52228  */
52229 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
52230
52231 /**
52232  * Generates a non-cryptographic 64-bit hash of the RouteHint.
52233  */
52234 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
52235
52236 /**
52237  * Checks if two RouteHints contain equal inner contents.
52238  * This ignores pointers and is_owned flags and looks at the values in fields.
52239  * Two objects with NULL inner values will be considered "equal" here.
52240  */
52241 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
52242
52243 /**
52244  * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
52245  */
52246 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
52247
52248 /**
52249  * Read a RouteHint from a byte array, created by RouteHint_write
52250  */
52251 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
52252
52253 /**
52254  * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
52255  */
52256 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
52257
52258 /**
52259  * The node_id of the non-target end of the route
52260  */
52261 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
52262
52263 /**
52264  * The node_id of the non-target end of the route
52265  */
52266 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
52267
52268 /**
52269  * The short_channel_id of this channel
52270  */
52271 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
52272
52273 /**
52274  * The short_channel_id of this channel
52275  */
52276 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
52277
52278 /**
52279  * The fees which must be paid to use this channel
52280  */
52281 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
52282
52283 /**
52284  * The fees which must be paid to use this channel
52285  */
52286 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
52287
52288 /**
52289  * The difference in CLTV values between this node and the next node.
52290  */
52291 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
52292
52293 /**
52294  * The difference in CLTV values between this node and the next node.
52295  */
52296 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
52297
52298 /**
52299  * The minimum value, in msat, which must be relayed to the next hop.
52300  */
52301 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
52302
52303 /**
52304  * The minimum value, in msat, which must be relayed to the next hop.
52305  */
52306 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
52307
52308 /**
52309  * The maximum value in msat available for routing with a single HTLC.
52310  */
52311 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
52312
52313 /**
52314  * The maximum value in msat available for routing with a single HTLC.
52315  */
52316 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
52317
52318 /**
52319  * Constructs a new RouteHintHop given each field
52320  */
52321 MUST_USE_RES struct LDKRouteHintHop RouteHintHop_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, struct LDKCOption_u64Z htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg);
52322
52323 /**
52324  * Creates a copy of the RouteHintHop
52325  */
52326 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
52327
52328 /**
52329  * Generates a non-cryptographic 64-bit hash of the RouteHintHop.
52330  */
52331 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
52332
52333 /**
52334  * Checks if two RouteHintHops contain equal inner contents.
52335  * This ignores pointers and is_owned flags and looks at the values in fields.
52336  * Two objects with NULL inner values will be considered "equal" here.
52337  */
52338 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
52339
52340 /**
52341  * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
52342  */
52343 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
52344
52345 /**
52346  * Read a RouteHintHop from a byte array, created by RouteHintHop_write
52347  */
52348 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
52349
52350 /**
52351  * Frees any resources used by the FirstHopCandidate, if is_owned is set and inner is non-NULL.
52352  */
52353 void FirstHopCandidate_free(struct LDKFirstHopCandidate this_obj);
52354
52355 /**
52356  * Creates a copy of the FirstHopCandidate
52357  */
52358 struct LDKFirstHopCandidate FirstHopCandidate_clone(const struct LDKFirstHopCandidate *NONNULL_PTR orig);
52359
52360 /**
52361  * Frees any resources used by the PublicHopCandidate, if is_owned is set and inner is non-NULL.
52362  */
52363 void PublicHopCandidate_free(struct LDKPublicHopCandidate this_obj);
52364
52365 /**
52366  * The short channel ID of the channel, i.e. the identifier by which we refer to this
52367  * channel.
52368  */
52369 uint64_t PublicHopCandidate_get_short_channel_id(const struct LDKPublicHopCandidate *NONNULL_PTR this_ptr);
52370
52371 /**
52372  * The short channel ID of the channel, i.e. the identifier by which we refer to this
52373  * channel.
52374  */
52375 void PublicHopCandidate_set_short_channel_id(struct LDKPublicHopCandidate *NONNULL_PTR this_ptr, uint64_t val);
52376
52377 /**
52378  * Creates a copy of the PublicHopCandidate
52379  */
52380 struct LDKPublicHopCandidate PublicHopCandidate_clone(const struct LDKPublicHopCandidate *NONNULL_PTR orig);
52381
52382 /**
52383  * Frees any resources used by the PrivateHopCandidate, if is_owned is set and inner is non-NULL.
52384  */
52385 void PrivateHopCandidate_free(struct LDKPrivateHopCandidate this_obj);
52386
52387 /**
52388  * Creates a copy of the PrivateHopCandidate
52389  */
52390 struct LDKPrivateHopCandidate PrivateHopCandidate_clone(const struct LDKPrivateHopCandidate *NONNULL_PTR orig);
52391
52392 /**
52393  * Frees any resources used by the BlindedPathCandidate, if is_owned is set and inner is non-NULL.
52394  */
52395 void BlindedPathCandidate_free(struct LDKBlindedPathCandidate this_obj);
52396
52397 /**
52398  * Creates a copy of the BlindedPathCandidate
52399  */
52400 struct LDKBlindedPathCandidate BlindedPathCandidate_clone(const struct LDKBlindedPathCandidate *NONNULL_PTR orig);
52401
52402 /**
52403  * Frees any resources used by the OneHopBlindedPathCandidate, if is_owned is set and inner is non-NULL.
52404  */
52405 void OneHopBlindedPathCandidate_free(struct LDKOneHopBlindedPathCandidate this_obj);
52406
52407 /**
52408  * Creates a copy of the OneHopBlindedPathCandidate
52409  */
52410 struct LDKOneHopBlindedPathCandidate OneHopBlindedPathCandidate_clone(const struct LDKOneHopBlindedPathCandidate *NONNULL_PTR orig);
52411
52412 /**
52413  * Frees any resources used by the CandidateRouteHop
52414  */
52415 void CandidateRouteHop_free(struct LDKCandidateRouteHop this_ptr);
52416
52417 /**
52418  * Creates a copy of the CandidateRouteHop
52419  */
52420 struct LDKCandidateRouteHop CandidateRouteHop_clone(const struct LDKCandidateRouteHop *NONNULL_PTR orig);
52421
52422 /**
52423  * Utility method to constructs a new FirstHop-variant CandidateRouteHop
52424  */
52425 struct LDKCandidateRouteHop CandidateRouteHop_first_hop(struct LDKFirstHopCandidate a);
52426
52427 /**
52428  * Utility method to constructs a new PublicHop-variant CandidateRouteHop
52429  */
52430 struct LDKCandidateRouteHop CandidateRouteHop_public_hop(struct LDKPublicHopCandidate a);
52431
52432 /**
52433  * Utility method to constructs a new PrivateHop-variant CandidateRouteHop
52434  */
52435 struct LDKCandidateRouteHop CandidateRouteHop_private_hop(struct LDKPrivateHopCandidate a);
52436
52437 /**
52438  * Utility method to constructs a new Blinded-variant CandidateRouteHop
52439  */
52440 struct LDKCandidateRouteHop CandidateRouteHop_blinded(struct LDKBlindedPathCandidate a);
52441
52442 /**
52443  * Utility method to constructs a new OneHopBlinded-variant CandidateRouteHop
52444  */
52445 struct LDKCandidateRouteHop CandidateRouteHop_one_hop_blinded(struct LDKOneHopBlindedPathCandidate a);
52446
52447 /**
52448  * Returns the globally unique short channel ID for this hop, if one is known.
52449  *
52450  * This only returns `Some` if the channel is public (either our own, or one we've learned
52451  * from the public network graph), and thus the short channel ID we have for this channel is
52452  * globally unique and identifies this channel in a global namespace.
52453  */
52454 MUST_USE_RES struct LDKCOption_u64Z CandidateRouteHop_globally_unique_short_channel_id(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
52455
52456 /**
52457  * Returns the required difference in HTLC CLTV expiry between the [`Self::source`] and the
52458  * next-hop for an HTLC taking this hop.
52459  *
52460  * This is the time that the node(s) in this hop have to claim the HTLC on-chain if the
52461  * next-hop goes on chain with a payment preimage.
52462  */
52463 MUST_USE_RES uint32_t CandidateRouteHop_cltv_expiry_delta(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
52464
52465 /**
52466  * Returns the minimum amount that can be sent over this hop, in millisatoshis.
52467  */
52468 MUST_USE_RES uint64_t CandidateRouteHop_htlc_minimum_msat(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
52469
52470 /**
52471  * Returns the fees that must be paid to route an HTLC over this channel.
52472  */
52473 MUST_USE_RES struct LDKRoutingFees CandidateRouteHop_fees(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
52474
52475 /**
52476  * Returns the source node id of current hop.
52477  *
52478  * Source node id refers to the node forwarding the HTLC through this hop.
52479  *
52480  * For [`Self::FirstHop`] we return payer's node id.
52481  */
52482 MUST_USE_RES struct LDKNodeId CandidateRouteHop_source(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
52483
52484 /**
52485  * Returns the target node id of this hop, if known.
52486  *
52487  * Target node id refers to the node receiving the HTLC after this hop.
52488  *
52489  * For [`Self::Blinded`] we return `None` because the ultimate destination after the blinded
52490  * path is unknown.
52491  *
52492  * For [`Self::OneHopBlinded`] we return `None` because the target is the same as the source,
52493  * and such a return value would be somewhat nonsensical.
52494  *
52495  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
52496  */
52497 MUST_USE_RES struct LDKNodeId CandidateRouteHop_target(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
52498
52499 /**
52500  * Finds a route from us (payer) to the given target node (payee).
52501  *
52502  * If the payee provided features in their invoice, they should be provided via the `payee` field
52503  * in the given [`RouteParameters::payment_params`].
52504  * Without this, MPP will only be used if the payee's features are available in the network graph.
52505  *
52506  * Private routing paths between a public node and the target may be included in the `payee` field
52507  * of [`RouteParameters::payment_params`].
52508  *
52509  * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
52510  * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
52511  * from `network_graph` will be ignored, and only those in `first_hops` will be used.
52512  *
52513  * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
52514  * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
52515  * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
52516  *
52517  * # Panics
52518  *
52519  * Panics if first_hops contains channels without `short_channel_id`s;
52520  * [`ChannelManager::list_usable_channels`] will never include such channels.
52521  *
52522  * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
52523  * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
52524  * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
52525  *
52526  * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
52527  */
52528 struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKLogger logger, const struct LDKScoreLookUp *NONNULL_PTR scorer, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR score_params, const uint8_t (*random_seed_bytes)[32]);
52529
52530 /**
52531  * Construct a route from us (payer) to the target node (payee) via the given hops (which should
52532  * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
52533  *
52534  * Re-uses logic from `find_route`, so the restrictions described there also apply here.
52535  */
52536 struct LDKCResult_RouteLightningErrorZ build_route_from_hops(struct LDKPublicKey our_node_pubkey, struct LDKCVec_PublicKeyZ hops, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, const uint8_t (*random_seed_bytes)[32]);
52537
52538 /**
52539  * Calls the free function if one is set
52540  */
52541 void ScoreLookUp_free(struct LDKScoreLookUp this_ptr);
52542
52543 /**
52544  * Calls the free function if one is set
52545  */
52546 void ScoreUpdate_free(struct LDKScoreUpdate this_ptr);
52547
52548 /**
52549  * Calls the free function if one is set
52550  */
52551 void Score_free(struct LDKScore this_ptr);
52552
52553 /**
52554  * Calls the free function if one is set
52555  */
52556 void LockableScore_free(struct LDKLockableScore this_ptr);
52557
52558 /**
52559  * Calls the free function if one is set
52560  */
52561 void WriteableScore_free(struct LDKWriteableScore this_ptr);
52562
52563 /**
52564  * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
52565  */
52566 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
52567
52568 /**
52569  * Constructs a new LockableScore which calls the relevant methods on this_arg.
52570  * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
52571  */
52572 struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
52573
52574 /**
52575  * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
52576  */
52577 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
52578
52579 /**
52580  * Constructs a new WriteableScore which calls the relevant methods on this_arg.
52581  * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
52582  */
52583 struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
52584
52585 /**
52586  * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
52587  */
52588 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
52589
52590 /**
52591  * Frees any resources used by the MultiThreadedScoreLockRead, if is_owned is set and inner is non-NULL.
52592  */
52593 void MultiThreadedScoreLockRead_free(struct LDKMultiThreadedScoreLockRead this_obj);
52594
52595 /**
52596  * Frees any resources used by the MultiThreadedScoreLockWrite, if is_owned is set and inner is non-NULL.
52597  */
52598 void MultiThreadedScoreLockWrite_free(struct LDKMultiThreadedScoreLockWrite this_obj);
52599
52600 /**
52601  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
52602  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
52603  */
52604 struct LDKScoreLookUp MultiThreadedScoreLockRead_as_ScoreLookUp(const struct LDKMultiThreadedScoreLockRead *NONNULL_PTR this_arg);
52605
52606 /**
52607  * Serialize the MultiThreadedScoreLockWrite object into a byte array which can be read by MultiThreadedScoreLockWrite_read
52608  */
52609 struct LDKCVec_u8Z MultiThreadedScoreLockWrite_write(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR obj);
52610
52611 /**
52612  * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
52613  * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
52614  */
52615 struct LDKScoreUpdate MultiThreadedScoreLockWrite_as_ScoreUpdate(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR this_arg);
52616
52617 /**
52618  * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
52619  */
52620 void ChannelUsage_free(struct LDKChannelUsage this_obj);
52621
52622 /**
52623  * The amount to send through the channel, denominated in millisatoshis.
52624  */
52625 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
52626
52627 /**
52628  * The amount to send through the channel, denominated in millisatoshis.
52629  */
52630 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
52631
52632 /**
52633  * Total amount, denominated in millisatoshis, already allocated to send through the channel
52634  * as part of a multi-path payment.
52635  */
52636 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
52637
52638 /**
52639  * Total amount, denominated in millisatoshis, already allocated to send through the channel
52640  * as part of a multi-path payment.
52641  */
52642 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
52643
52644 /**
52645  * The effective capacity of the channel.
52646  */
52647 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
52648
52649 /**
52650  * The effective capacity of the channel.
52651  */
52652 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
52653
52654 /**
52655  * Constructs a new ChannelUsage given each field
52656  */
52657 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
52658
52659 /**
52660  * Creates a copy of the ChannelUsage
52661  */
52662 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
52663
52664 /**
52665  * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
52666  */
52667 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
52668
52669 /**
52670  * Creates a copy of the FixedPenaltyScorer
52671  */
52672 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
52673
52674 /**
52675  * Creates a new scorer using `penalty_msat`.
52676  */
52677 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
52678
52679 /**
52680  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
52681  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
52682  */
52683 struct LDKScoreLookUp FixedPenaltyScorer_as_ScoreLookUp(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
52684
52685 /**
52686  * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
52687  * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
52688  */
52689 struct LDKScoreUpdate FixedPenaltyScorer_as_ScoreUpdate(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
52690
52691 /**
52692  * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
52693  */
52694 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
52695
52696 /**
52697  * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
52698  */
52699 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
52700
52701 /**
52702  * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
52703  */
52704 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
52705
52706 /**
52707  * Frees any resources used by the ProbabilisticScoringFeeParameters, if is_owned is set and inner is non-NULL.
52708  */
52709 void ProbabilisticScoringFeeParameters_free(struct LDKProbabilisticScoringFeeParameters this_obj);
52710
52711 /**
52712  * A fixed penalty in msats to apply to each channel.
52713  *
52714  * Default value: 500 msat
52715  */
52716 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
52717
52718 /**
52719  * A fixed penalty in msats to apply to each channel.
52720  *
52721  * Default value: 500 msat
52722  */
52723 void ProbabilisticScoringFeeParameters_set_base_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
52724
52725 /**
52726  * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
52727  * applied to each channel, in excess of the [`base_penalty_msat`].
52728  *
52729  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
52730  * fees plus penalty) for large payments. The penalty is computed as the product of this
52731  * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
52732  * amount plus the amount of any other HTLCs flowing we sent over the same channel).
52733  *
52734  * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
52735  *
52736  * Default value: 8,192 msat
52737  *
52738  * [`base_penalty_msat`]: Self::base_penalty_msat
52739  */
52740 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
52741
52742 /**
52743  * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
52744  * applied to each channel, in excess of the [`base_penalty_msat`].
52745  *
52746  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
52747  * fees plus penalty) for large payments. The penalty is computed as the product of this
52748  * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
52749  * amount plus the amount of any other HTLCs flowing we sent over the same channel).
52750  *
52751  * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
52752  *
52753  * Default value: 8,192 msat
52754  *
52755  * [`base_penalty_msat`]: Self::base_penalty_msat
52756  */
52757 void ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
52758
52759 /**
52760  * A multiplier used in conjunction with the negative `log10` of the channel's success
52761  * probability for a payment, as determined by our latest estimates of the channel's
52762  * liquidity, to determine the liquidity penalty.
52763  *
52764  * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
52765  * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
52766  * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
52767  * lower bounding the success probability to `0.01`) when the amount falls within the
52768  * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
52769  * result in a `u64::max_value` penalty, however.
52770  *
52771  * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
52772  *
52773  * Default value: 30,000 msat
52774  *
52775  * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
52776  */
52777 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
52778
52779 /**
52780  * A multiplier used in conjunction with the negative `log10` of the channel's success
52781  * probability for a payment, as determined by our latest estimates of the channel's
52782  * liquidity, to determine the liquidity penalty.
52783  *
52784  * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
52785  * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
52786  * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
52787  * lower bounding the success probability to `0.01`) when the amount falls within the
52788  * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
52789  * result in a `u64::max_value` penalty, however.
52790  *
52791  * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
52792  *
52793  * Default value: 30,000 msat
52794  *
52795  * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
52796  */
52797 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
52798
52799 /**
52800  * A multiplier used in conjunction with the total amount flowing over a channel and the
52801  * negative `log10` of the channel's success probability for the payment, as determined by our
52802  * latest estimates of the channel's liquidity, to determine the amount penalty.
52803  *
52804  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
52805  * fees plus penalty) for large payments. The penalty is computed as the product of this
52806  * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
52807  * `log10` of the success probability.
52808  *
52809  * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
52810  *
52811  * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
52812  * the amount will result in a penalty of the multiplier. And, as the success probability
52813  * decreases, the negative `log10` weighting will increase dramatically. For higher success
52814  * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
52815  * fall below `1`.
52816  *
52817  * Default value: 192 msat
52818  */
52819 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
52820
52821 /**
52822  * A multiplier used in conjunction with the total amount flowing over a channel and the
52823  * negative `log10` of the channel's success probability for the payment, as determined by our
52824  * latest estimates of the channel's liquidity, to determine the amount penalty.
52825  *
52826  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
52827  * fees plus penalty) for large payments. The penalty is computed as the product of this
52828  * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
52829  * `log10` of the success probability.
52830  *
52831  * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
52832  *
52833  * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
52834  * the amount will result in a penalty of the multiplier. And, as the success probability
52835  * decreases, the negative `log10` weighting will increase dramatically. For higher success
52836  * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
52837  * fall below `1`.
52838  *
52839  * Default value: 192 msat
52840  */
52841 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
52842
52843 /**
52844  * A multiplier used in conjunction with the negative `log10` of the channel's success
52845  * probability for the payment, as determined based on the history of our estimates of the
52846  * channel's available liquidity, to determine a penalty.
52847  *
52848  * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
52849  * only our latest estimate for the current liquidity available in the channel, it estimates
52850  * success probability based on the estimated liquidity available in the channel through
52851  * history. Specifically, every time we update our liquidity bounds on a given channel, we
52852  * track which of several buckets those bounds fall into, exponentially decaying the
52853  * probability of each bucket as new samples are added.
52854  *
52855  * Default value: 10,000 msat
52856  *
52857  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
52858  */
52859 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
52860
52861 /**
52862  * A multiplier used in conjunction with the negative `log10` of the channel's success
52863  * probability for the payment, as determined based on the history of our estimates of the
52864  * channel's available liquidity, to determine a penalty.
52865  *
52866  * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
52867  * only our latest estimate for the current liquidity available in the channel, it estimates
52868  * success probability based on the estimated liquidity available in the channel through
52869  * history. Specifically, every time we update our liquidity bounds on a given channel, we
52870  * track which of several buckets those bounds fall into, exponentially decaying the
52871  * probability of each bucket as new samples are added.
52872  *
52873  * Default value: 10,000 msat
52874  *
52875  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
52876  */
52877 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
52878
52879 /**
52880  * A multiplier used in conjunction with the total amount flowing over a channel and the
52881  * negative `log10` of the channel's success probability for the payment, as determined based
52882  * on the history of our estimates of the channel's available liquidity, to determine a
52883  * penalty.
52884  *
52885  * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
52886  * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
52887  * of the amount flowing over this channel, weighted by the negative `log10` of the success
52888  * probability.
52889  *
52890  * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
52891  * of using only our latest estimate for the current liquidity available in the channel, it
52892  * estimates success probability based on the estimated liquidity available in the channel
52893  * through history. Specifically, every time we update our liquidity bounds on a given
52894  * channel, we track which of several buckets those bounds fall into, exponentially decaying
52895  * the probability of each bucket as new samples are added.
52896  *
52897  * Default value: 64 msat
52898  *
52899  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
52900  */
52901 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
52902
52903 /**
52904  * A multiplier used in conjunction with the total amount flowing over a channel and the
52905  * negative `log10` of the channel's success probability for the payment, as determined based
52906  * on the history of our estimates of the channel's available liquidity, to determine a
52907  * penalty.
52908  *
52909  * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
52910  * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
52911  * of the amount flowing over this channel, weighted by the negative `log10` of the success
52912  * probability.
52913  *
52914  * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
52915  * of using only our latest estimate for the current liquidity available in the channel, it
52916  * estimates success probability based on the estimated liquidity available in the channel
52917  * through history. Specifically, every time we update our liquidity bounds on a given
52918  * channel, we track which of several buckets those bounds fall into, exponentially decaying
52919  * the probability of each bucket as new samples are added.
52920  *
52921  * Default value: 64 msat
52922  *
52923  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
52924  */
52925 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
52926
52927 /**
52928  * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
52929  * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
52930  * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
52931  * as this makes balance discovery attacks harder to execute, thereby creating an incentive
52932  * to restrict `htlc_maximum_msat` and improve privacy.
52933  *
52934  * Default value: 250 msat
52935  */
52936 uint64_t ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
52937
52938 /**
52939  * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
52940  * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
52941  * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
52942  * as this makes balance discovery attacks harder to execute, thereby creating an incentive
52943  * to restrict `htlc_maximum_msat` and improve privacy.
52944  *
52945  * Default value: 250 msat
52946  */
52947 void ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
52948
52949 /**
52950  * This penalty is applied when the total amount flowing over a channel exceeds our current
52951  * estimate of the channel's available liquidity. The total amount is the amount of the
52952  * current HTLC plus any HTLCs which we've sent over the same channel.
52953  *
52954  * Note that in this case all other penalties, including the
52955  * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
52956  * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
52957  * applicable, are still included in the overall penalty.
52958  *
52959  * If you wish to avoid creating paths with such channels entirely, setting this to a value of
52960  * `u64::max_value()` will guarantee that.
52961  *
52962  * Default value: 1_0000_0000_000 msat (1 Bitcoin)
52963  *
52964  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
52965  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
52966  * [`base_penalty_msat`]: Self::base_penalty_msat
52967  * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
52968  */
52969 uint64_t ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
52970
52971 /**
52972  * This penalty is applied when the total amount flowing over a channel exceeds our current
52973  * estimate of the channel's available liquidity. The total amount is the amount of the
52974  * current HTLC plus any HTLCs which we've sent over the same channel.
52975  *
52976  * Note that in this case all other penalties, including the
52977  * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
52978  * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
52979  * applicable, are still included in the overall penalty.
52980  *
52981  * If you wish to avoid creating paths with such channels entirely, setting this to a value of
52982  * `u64::max_value()` will guarantee that.
52983  *
52984  * Default value: 1_0000_0000_000 msat (1 Bitcoin)
52985  *
52986  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
52987  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
52988  * [`base_penalty_msat`]: Self::base_penalty_msat
52989  * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
52990  */
52991 void ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
52992
52993 /**
52994  * In order to calculate most of the scores above, we must first convert a lower and upper
52995  * bound on the available liquidity in a channel into the probability that we think a payment
52996  * will succeed. That probability is derived from a Probability Density Function for where we
52997  * think the liquidity in a channel likely lies, given such bounds.
52998  *
52999  * If this flag is set, that PDF is simply a constant - we assume that the actual available
53000  * liquidity in a channel is just as likely to be at any point between our lower and upper
53001  * bounds.
53002  *
53003  * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
53004  * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
53005  * matches experimental results - most routing nodes do not aggressively rebalance their
53006  * channels and flows in the network are often unbalanced, leaving liquidity usually
53007  * unavailable.
53008  *
53009  * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
53010  * of floating-point multiplications in the hottest routing code, which may lead to routing
53011  * performance degradation on some machines.
53012  *
53013  * Default value: false
53014  */
53015 bool ProbabilisticScoringFeeParameters_get_linear_success_probability(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
53016
53017 /**
53018  * In order to calculate most of the scores above, we must first convert a lower and upper
53019  * bound on the available liquidity in a channel into the probability that we think a payment
53020  * will succeed. That probability is derived from a Probability Density Function for where we
53021  * think the liquidity in a channel likely lies, given such bounds.
53022  *
53023  * If this flag is set, that PDF is simply a constant - we assume that the actual available
53024  * liquidity in a channel is just as likely to be at any point between our lower and upper
53025  * bounds.
53026  *
53027  * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
53028  * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
53029  * matches experimental results - most routing nodes do not aggressively rebalance their
53030  * channels and flows in the network are often unbalanced, leaving liquidity usually
53031  * unavailable.
53032  *
53033  * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
53034  * of floating-point multiplications in the hottest routing code, which may lead to routing
53035  * performance degradation on some machines.
53036  *
53037  * Default value: false
53038  */
53039 void ProbabilisticScoringFeeParameters_set_linear_success_probability(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, bool val);
53040
53041 /**
53042  * Creates a copy of the ProbabilisticScoringFeeParameters
53043  */
53044 struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_clone(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR orig);
53045
53046 /**
53047  * Creates a "default" ProbabilisticScoringFeeParameters. See struct and individual field documentaiton for details on which values are used.
53048  */
53049 MUST_USE_RES struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_default(void);
53050
53051 /**
53052  * Marks the node with the given `node_id` as banned,
53053  * i.e it will be avoided during path finding.
53054  */
53055 void ProbabilisticScoringFeeParameters_add_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
53056
53057 /**
53058  * Marks all nodes in the given list as banned, i.e.,
53059  * they will be avoided during path finding.
53060  */
53061 void ProbabilisticScoringFeeParameters_add_banned_from_list(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
53062
53063 /**
53064  * Removes the node with the given `node_id` from the list of nodes to avoid.
53065  */
53066 void ProbabilisticScoringFeeParameters_remove_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
53067
53068 /**
53069  * Sets a manual penalty for the given node.
53070  */
53071 void ProbabilisticScoringFeeParameters_set_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
53072
53073 /**
53074  * Removes the node with the given `node_id` from the list of manual penalties.
53075  */
53076 void ProbabilisticScoringFeeParameters_remove_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
53077
53078 /**
53079  * Clears the list of manual penalties that are applied during path finding.
53080  */
53081 void ProbabilisticScoringFeeParameters_clear_manual_penalties(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg);
53082
53083 /**
53084  * Frees any resources used by the ProbabilisticScoringDecayParameters, if is_owned is set and inner is non-NULL.
53085  */
53086 void ProbabilisticScoringDecayParameters_free(struct LDKProbabilisticScoringDecayParameters this_obj);
53087
53088 /**
53089  * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
53090  * tracking can simply live on with increasingly stale data. Instead, when a channel has not
53091  * seen a liquidity estimate update for this amount of time, the historical datapoints are
53092  * decayed by half.
53093  * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
53094  *
53095  * Note that after 16 or more half lives all historical data will be completely gone.
53096  *
53097  * Default value: 14 days
53098  *
53099  * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
53100  */
53101 uint64_t ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
53102
53103 /**
53104  * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
53105  * tracking can simply live on with increasingly stale data. Instead, when a channel has not
53106  * seen a liquidity estimate update for this amount of time, the historical datapoints are
53107  * decayed by half.
53108  * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
53109  *
53110  * Note that after 16 or more half lives all historical data will be completely gone.
53111  *
53112  * Default value: 14 days
53113  *
53114  * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
53115  */
53116 void ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
53117
53118 /**
53119  * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
53120  * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
53121  * the available liquidity is halved and the upper-bound moves half-way to the channel's total
53122  * capacity.
53123  *
53124  * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
53125  * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
53126  * struct documentation for more info on the way the liquidity bounds are used.
53127  *
53128  * For example, if the channel's capacity is 1 million sats, and the current upper and lower
53129  * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
53130  * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
53131  *
53132  * Default value: 6 hours
53133  *
53134  * # Note
53135  *
53136  * When built with the `no-std` feature, time will never elapse. Therefore, the channel
53137  * liquidity knowledge will never decay except when the bounds cross.
53138  */
53139 uint64_t ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
53140
53141 /**
53142  * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
53143  * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
53144  * the available liquidity is halved and the upper-bound moves half-way to the channel's total
53145  * capacity.
53146  *
53147  * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
53148  * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
53149  * struct documentation for more info on the way the liquidity bounds are used.
53150  *
53151  * For example, if the channel's capacity is 1 million sats, and the current upper and lower
53152  * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
53153  * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
53154  *
53155  * Default value: 6 hours
53156  *
53157  * # Note
53158  *
53159  * When built with the `no-std` feature, time will never elapse. Therefore, the channel
53160  * liquidity knowledge will never decay except when the bounds cross.
53161  */
53162 void ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
53163
53164 /**
53165  * Constructs a new ProbabilisticScoringDecayParameters given each field
53166  */
53167 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_new(uint64_t historical_no_updates_half_life_arg, uint64_t liquidity_offset_half_life_arg);
53168
53169 /**
53170  * Creates a copy of the ProbabilisticScoringDecayParameters
53171  */
53172 struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_clone(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR orig);
53173
53174 /**
53175  * Creates a "default" ProbabilisticScoringDecayParameters. See struct and individual field documentaiton for details on which values are used.
53176  */
53177 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_default(void);
53178
53179 /**
53180  * Creates a new scorer using the given scoring parameters for sending payments from a node
53181  * through a network graph.
53182  */
53183 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringDecayParameters decay_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
53184
53185 /**
53186  * Dump the contents of this scorer into the configured logger.
53187  *
53188  * Note that this writes roughly one line per channel for which we have a liquidity estimate,
53189  * which may be a substantial amount of log output.
53190  */
53191 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
53192
53193 /**
53194  * Query the estimated minimum and maximum liquidity available for sending a payment over the
53195  * channel with `scid` towards the given `target` node.
53196  */
53197 MUST_USE_RES struct LDKCOption_C2Tuple_u64u64ZZ ProbabilisticScorer_estimated_channel_liquidity_range(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target);
53198
53199 /**
53200  * Query the historical estimated minimum and maximum liquidity available for sending a
53201  * payment over the channel with `scid` towards the given `target` node.
53202  *
53203  * Returns two sets of 32 buckets. The first set describes the lower-bound liquidity history,
53204  * the second set describes the upper-bound liquidity history. Each bucket describes the
53205  * relative frequency at which we've seen a liquidity bound in the bucket's range relative to
53206  * the channel's total capacity, on an arbitrary scale. Because the values are slowly decayed,
53207  * more recent data points are weighted more heavily than older datapoints.
53208  *
53209  * Note that the range of each bucket varies by its location to provide more granular results
53210  * at the edges of a channel's capacity, where it is more likely to sit.
53211  *
53212  * When scoring, the estimated probability that an upper-/lower-bound lies in a given bucket
53213  * is calculated by dividing that bucket's value with the total value of all buckets.
53214  *
53215  * For example, using a lower bucket count for illustrative purposes, a value of
53216  * `[0, 0, 0, ..., 0, 32]` indicates that we believe the probability of a bound being very
53217  * close to the channel's capacity to be 100%, and have never (recently) seen it in any other
53218  * bucket. A value of `[31, 0, 0, ..., 0, 0, 32]` indicates we've seen the bound being both
53219  * in the top and bottom bucket, and roughly with similar (recent) frequency.
53220  *
53221  * Because the datapoints are decayed slowly over time, values will eventually return to
53222  * `Some(([0; 32], [0; 32]))` or `None` if no data remains for a channel.
53223  *
53224  * In order to fetch a single success probability from the buckets provided here, as used in
53225  * the scoring model, see [`Self::historical_estimated_payment_success_probability`].
53226  */
53227 MUST_USE_RES struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target);
53228
53229 /**
53230  * Query the probability of payment success sending the given `amount_msat` over the channel
53231  * with `scid` towards the given `target` node, based on the historical estimated liquidity
53232  * bounds.
53233  *
53234  * These are the same bounds as returned by
53235  * [`Self::historical_estimated_channel_liquidity_probabilities`] (but not those returned by
53236  * [`Self::estimated_channel_liquidity_range`]).
53237  */
53238 MUST_USE_RES struct LDKCOption_f64Z ProbabilisticScorer_historical_estimated_payment_success_probability(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target, uint64_t amount_msat, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR params);
53239
53240 /**
53241  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
53242  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
53243  */
53244 struct LDKScoreLookUp ProbabilisticScorer_as_ScoreLookUp(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
53245
53246 /**
53247  * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
53248  * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
53249  */
53250 struct LDKScoreUpdate ProbabilisticScorer_as_ScoreUpdate(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
53251
53252 /**
53253  * Constructs a new Score which calls the relevant methods on this_arg.
53254  * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
53255  */
53256 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
53257
53258 /**
53259  * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
53260  */
53261 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
53262
53263 /**
53264  * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
53265  */
53266 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringDecayParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
53267
53268 /**
53269  * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
53270  */
53271 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
53272
53273 /**
53274  * The outpoint which is spendable.
53275  */
53276 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53277
53278 /**
53279  * The outpoint which is spendable.
53280  */
53281 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
53282
53283 /**
53284  * Per commitment point to derive the delayed payment key by key holder.
53285  */
53286 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53287
53288 /**
53289  * Per commitment point to derive the delayed payment key by key holder.
53290  */
53291 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
53292
53293 /**
53294  * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
53295  * the witness_script.
53296  */
53297 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53298
53299 /**
53300  * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
53301  * the witness_script.
53302  */
53303 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
53304
53305 /**
53306  * The output which is referenced by the given outpoint.
53307  */
53308 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53309
53310 /**
53311  * The output which is referenced by the given outpoint.
53312  */
53313 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
53314
53315 /**
53316  * The revocation point specific to the commitment transaction which was broadcast. Used to
53317  * derive the witnessScript for this output.
53318  */
53319 struct LDKRevocationKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53320
53321 /**
53322  * The revocation point specific to the commitment transaction which was broadcast. Used to
53323  * derive the witnessScript for this output.
53324  */
53325 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
53326
53327 /**
53328  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
53329  * This may be useful in re-deriving keys used in the channel to spend the output.
53330  */
53331 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
53332
53333 /**
53334  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
53335  * This may be useful in re-deriving keys used in the channel to spend the output.
53336  */
53337 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
53338
53339 /**
53340  * The value of the channel which this output originated from, possibly indirectly.
53341  */
53342 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53343
53344 /**
53345  * The value of the channel which this output originated from, possibly indirectly.
53346  */
53347 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
53348
53349 /**
53350  * The channel public keys and other parameters needed to generate a spending transaction or
53351  * to provide to a re-derived signer through [`ChannelSigner::provide_channel_parameters`].
53352  *
53353  * Added as optional, but always `Some` if the descriptor was produced in v0.0.123 or later.
53354  *
53355  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
53356  */
53357 struct LDKChannelTransactionParameters DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53358
53359 /**
53360  * The channel public keys and other parameters needed to generate a spending transaction or
53361  * to provide to a re-derived signer through [`ChannelSigner::provide_channel_parameters`].
53362  *
53363  * Added as optional, but always `Some` if the descriptor was produced in v0.0.123 or later.
53364  *
53365  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
53366  */
53367 void DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
53368
53369 /**
53370  * Constructs a new DelayedPaymentOutputDescriptor given each field
53371  *
53372  * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
53373  */
53374 MUST_USE_RES struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKPublicKey per_commitment_point_arg, uint16_t to_self_delay_arg, struct LDKTxOut output_arg, struct LDKRevocationKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg, struct LDKChannelTransactionParameters channel_transaction_parameters_arg);
53375
53376 /**
53377  * Creates a copy of the DelayedPaymentOutputDescriptor
53378  */
53379 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
53380
53381 /**
53382  * Generates a non-cryptographic 64-bit hash of the DelayedPaymentOutputDescriptor.
53383  */
53384 uint64_t DelayedPaymentOutputDescriptor_hash(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR o);
53385
53386 /**
53387  * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
53388  * This ignores pointers and is_owned flags and looks at the values in fields.
53389  * Two objects with NULL inner values will be considered "equal" here.
53390  */
53391 bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
53392
53393 /**
53394  * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
53395  */
53396 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
53397
53398 /**
53399  * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
53400  */
53401 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
53402
53403 /**
53404  * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
53405  */
53406 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
53407
53408 /**
53409  * The outpoint which is spendable.
53410  */
53411 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53412
53413 /**
53414  * The outpoint which is spendable.
53415  */
53416 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
53417
53418 /**
53419  * The output which is referenced by the given outpoint.
53420  */
53421 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53422
53423 /**
53424  * The output which is referenced by the given outpoint.
53425  */
53426 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
53427
53428 /**
53429  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
53430  * This may be useful in re-deriving keys used in the channel to spend the output.
53431  */
53432 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
53433
53434 /**
53435  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
53436  * This may be useful in re-deriving keys used in the channel to spend the output.
53437  */
53438 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
53439
53440 /**
53441  * The value of the channel which this transactions spends.
53442  */
53443 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53444
53445 /**
53446  * The value of the channel which this transactions spends.
53447  */
53448 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
53449
53450 /**
53451  * The necessary channel parameters that need to be provided to the re-derived signer through
53452  * [`ChannelSigner::provide_channel_parameters`].
53453  *
53454  * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
53455  *
53456  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
53457  */
53458 struct LDKChannelTransactionParameters StaticPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
53459
53460 /**
53461  * The necessary channel parameters that need to be provided to the re-derived signer through
53462  * [`ChannelSigner::provide_channel_parameters`].
53463  *
53464  * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
53465  *
53466  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
53467  */
53468 void StaticPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
53469
53470 /**
53471  * Constructs a new StaticPaymentOutputDescriptor given each field
53472  *
53473  * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
53474  */
53475 MUST_USE_RES struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg, struct LDKChannelTransactionParameters channel_transaction_parameters_arg);
53476
53477 /**
53478  * Creates a copy of the StaticPaymentOutputDescriptor
53479  */
53480 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
53481
53482 /**
53483  * Generates a non-cryptographic 64-bit hash of the StaticPaymentOutputDescriptor.
53484  */
53485 uint64_t StaticPaymentOutputDescriptor_hash(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR o);
53486
53487 /**
53488  * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
53489  * This ignores pointers and is_owned flags and looks at the values in fields.
53490  * Two objects with NULL inner values will be considered "equal" here.
53491  */
53492 bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
53493
53494 /**
53495  * Returns the `witness_script` of the spendable output.
53496  *
53497  * Note that this will only return `Some` for [`StaticPaymentOutputDescriptor`]s that
53498  * originated from an anchor outputs channel, as they take the form of a P2WSH script.
53499  */
53500 MUST_USE_RES struct LDKCOption_CVec_u8ZZ StaticPaymentOutputDescriptor_witness_script(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
53501
53502 /**
53503  * The maximum length a well-formed witness spending one of these should have.
53504  * Note: If you have the grind_signatures feature enabled, this will be at least 1 byte
53505  * shorter.
53506  */
53507 MUST_USE_RES uint64_t StaticPaymentOutputDescriptor_max_witness_length(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
53508
53509 /**
53510  * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
53511  */
53512 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
53513
53514 /**
53515  * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
53516  */
53517 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
53518
53519 /**
53520  * Frees any resources used by the SpendableOutputDescriptor
53521  */
53522 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
53523
53524 /**
53525  * Creates a copy of the SpendableOutputDescriptor
53526  */
53527 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
53528
53529 /**
53530  * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
53531  */
53532 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output, struct LDKThirtyTwoBytes channel_keys_id);
53533
53534 /**
53535  * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
53536  */
53537 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
53538
53539 /**
53540  * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
53541  */
53542 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
53543
53544 /**
53545  * Generates a non-cryptographic 64-bit hash of the SpendableOutputDescriptor.
53546  */
53547 uint64_t SpendableOutputDescriptor_hash(const struct LDKSpendableOutputDescriptor *NONNULL_PTR o);
53548
53549 /**
53550  * Checks if two SpendableOutputDescriptors contain equal inner contents.
53551  * This ignores pointers and is_owned flags and looks at the values in fields.
53552  */
53553 bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
53554
53555 /**
53556  * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
53557  */
53558 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
53559
53560 /**
53561  * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
53562  */
53563 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
53564
53565 /**
53566  * Creates an unsigned [`PartiallySignedTransaction`] which spends the given descriptors to
53567  * the given outputs, plus an output to the given change destination (if sufficient
53568  * change value remains). The PSBT will have a feerate, at least, of the given value.
53569  *
53570  * The `locktime` argument is used to set the transaction's locktime. If `None`, the
53571  * transaction will have a locktime of 0. It it recommended to set this to the current block
53572  * height to avoid fee sniping, unless you have some specific reason to use a different
53573  * locktime.
53574  *
53575  * Returns the PSBT and expected max transaction weight.
53576  *
53577  * Returns `Err(())` if the output value is greater than the input value minus required fee,
53578  * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
53579  * does not match the one we can spend.
53580  *
53581  * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
53582  */
53583 MUST_USE_RES struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ SpendableOutputDescriptor_create_spendable_outputs_psbt(struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
53584
53585 /**
53586  * Frees any resources used by the ChannelDerivationParameters, if is_owned is set and inner is non-NULL.
53587  */
53588 void ChannelDerivationParameters_free(struct LDKChannelDerivationParameters this_obj);
53589
53590 /**
53591  * The value in satoshis of the channel we're attempting to spend the anchor output of.
53592  */
53593 uint64_t ChannelDerivationParameters_get_value_satoshis(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
53594
53595 /**
53596  * The value in satoshis of the channel we're attempting to spend the anchor output of.
53597  */
53598 void ChannelDerivationParameters_set_value_satoshis(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, uint64_t val);
53599
53600 /**
53601  * The unique identifier to re-derive the signer for the associated channel.
53602  */
53603 const uint8_t (*ChannelDerivationParameters_get_keys_id(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr))[32];
53604
53605 /**
53606  * The unique identifier to re-derive the signer for the associated channel.
53607  */
53608 void ChannelDerivationParameters_set_keys_id(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
53609
53610 /**
53611  * The necessary channel parameters that need to be provided to the re-derived signer through
53612  * [`ChannelSigner::provide_channel_parameters`].
53613  */
53614 struct LDKChannelTransactionParameters ChannelDerivationParameters_get_transaction_parameters(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
53615
53616 /**
53617  * The necessary channel parameters that need to be provided to the re-derived signer through
53618  * [`ChannelSigner::provide_channel_parameters`].
53619  */
53620 void ChannelDerivationParameters_set_transaction_parameters(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
53621
53622 /**
53623  * Constructs a new ChannelDerivationParameters given each field
53624  */
53625 MUST_USE_RES struct LDKChannelDerivationParameters ChannelDerivationParameters_new(uint64_t value_satoshis_arg, struct LDKThirtyTwoBytes keys_id_arg, struct LDKChannelTransactionParameters transaction_parameters_arg);
53626
53627 /**
53628  * Creates a copy of the ChannelDerivationParameters
53629  */
53630 struct LDKChannelDerivationParameters ChannelDerivationParameters_clone(const struct LDKChannelDerivationParameters *NONNULL_PTR orig);
53631
53632 /**
53633  * Checks if two ChannelDerivationParameterss contain equal inner contents.
53634  * This ignores pointers and is_owned flags and looks at the values in fields.
53635  * Two objects with NULL inner values will be considered "equal" here.
53636  */
53637 bool ChannelDerivationParameters_eq(const struct LDKChannelDerivationParameters *NONNULL_PTR a, const struct LDKChannelDerivationParameters *NONNULL_PTR b);
53638
53639 /**
53640  * Serialize the ChannelDerivationParameters object into a byte array which can be read by ChannelDerivationParameters_read
53641  */
53642 struct LDKCVec_u8Z ChannelDerivationParameters_write(const struct LDKChannelDerivationParameters *NONNULL_PTR obj);
53643
53644 /**
53645  * Read a ChannelDerivationParameters from a byte array, created by ChannelDerivationParameters_write
53646  */
53647 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ ChannelDerivationParameters_read(struct LDKu8slice ser);
53648
53649 /**
53650  * Frees any resources used by the HTLCDescriptor, if is_owned is set and inner is non-NULL.
53651  */
53652 void HTLCDescriptor_free(struct LDKHTLCDescriptor this_obj);
53653
53654 /**
53655  * The parameters required to derive the signer for the HTLC input.
53656  */
53657 struct LDKChannelDerivationParameters HTLCDescriptor_get_channel_derivation_parameters(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
53658
53659 /**
53660  * The parameters required to derive the signer for the HTLC input.
53661  */
53662 void HTLCDescriptor_set_channel_derivation_parameters(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
53663
53664 /**
53665  * The txid of the commitment transaction in which the HTLC output lives.
53666  */
53667 const uint8_t (*HTLCDescriptor_get_commitment_txid(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr))[32];
53668
53669 /**
53670  * The txid of the commitment transaction in which the HTLC output lives.
53671  */
53672 void HTLCDescriptor_set_commitment_txid(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
53673
53674 /**
53675  * The number of the commitment transaction in which the HTLC output lives.
53676  */
53677 uint64_t HTLCDescriptor_get_per_commitment_number(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
53678
53679 /**
53680  * The number of the commitment transaction in which the HTLC output lives.
53681  */
53682 void HTLCDescriptor_set_per_commitment_number(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint64_t val);
53683
53684 /**
53685  * The key tweak corresponding to the number of the commitment transaction in which the HTLC
53686  * output lives. This tweak is applied to all the basepoints for both parties in the channel to
53687  * arrive at unique keys per commitment.
53688  *
53689  * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
53690  */
53691 struct LDKPublicKey HTLCDescriptor_get_per_commitment_point(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
53692
53693 /**
53694  * The key tweak corresponding to the number of the commitment transaction in which the HTLC
53695  * output lives. This tweak is applied to all the basepoints for both parties in the channel to
53696  * arrive at unique keys per commitment.
53697  *
53698  * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
53699  */
53700 void HTLCDescriptor_set_per_commitment_point(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
53701
53702 /**
53703  * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
53704  * originating from a channel supporting anchor outputs, otherwise it is the channel's
53705  * negotiated feerate at the time the commitment transaction was built.
53706  */
53707 uint32_t HTLCDescriptor_get_feerate_per_kw(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
53708
53709 /**
53710  * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
53711  * originating from a channel supporting anchor outputs, otherwise it is the channel's
53712  * negotiated feerate at the time the commitment transaction was built.
53713  */
53714 void HTLCDescriptor_set_feerate_per_kw(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint32_t val);
53715
53716 /**
53717  * The details of the HTLC as it appears in the commitment transaction.
53718  */
53719 struct LDKHTLCOutputInCommitment HTLCDescriptor_get_htlc(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
53720
53721 /**
53722  * The details of the HTLC as it appears in the commitment transaction.
53723  */
53724 void HTLCDescriptor_set_htlc(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKHTLCOutputInCommitment val);
53725
53726 /**
53727  * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
53728  * taken.
53729  */
53730 struct LDKCOption_ThirtyTwoBytesZ HTLCDescriptor_get_preimage(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
53731
53732 /**
53733  * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
53734  * taken.
53735  */
53736 void HTLCDescriptor_set_preimage(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
53737
53738 /**
53739  * The counterparty's signature required to spend the HTLC output.
53740  */
53741 struct LDKECDSASignature HTLCDescriptor_get_counterparty_sig(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
53742
53743 /**
53744  * The counterparty's signature required to spend the HTLC output.
53745  */
53746 void HTLCDescriptor_set_counterparty_sig(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
53747
53748 /**
53749  * Constructs a new HTLCDescriptor given each field
53750  */
53751 MUST_USE_RES struct LDKHTLCDescriptor HTLCDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKThirtyTwoBytes commitment_txid_arg, uint64_t per_commitment_number_arg, struct LDKPublicKey per_commitment_point_arg, uint32_t feerate_per_kw_arg, struct LDKHTLCOutputInCommitment htlc_arg, struct LDKCOption_ThirtyTwoBytesZ preimage_arg, struct LDKECDSASignature counterparty_sig_arg);
53752
53753 /**
53754  * Creates a copy of the HTLCDescriptor
53755  */
53756 struct LDKHTLCDescriptor HTLCDescriptor_clone(const struct LDKHTLCDescriptor *NONNULL_PTR orig);
53757
53758 /**
53759  * Checks if two HTLCDescriptors contain equal inner contents.
53760  * This ignores pointers and is_owned flags and looks at the values in fields.
53761  * Two objects with NULL inner values will be considered "equal" here.
53762  */
53763 bool HTLCDescriptor_eq(const struct LDKHTLCDescriptor *NONNULL_PTR a, const struct LDKHTLCDescriptor *NONNULL_PTR b);
53764
53765 /**
53766  * Serialize the HTLCDescriptor object into a byte array which can be read by HTLCDescriptor_read
53767  */
53768 struct LDKCVec_u8Z HTLCDescriptor_write(const struct LDKHTLCDescriptor *NONNULL_PTR obj);
53769
53770 /**
53771  * Read a HTLCDescriptor from a byte array, created by HTLCDescriptor_write
53772  */
53773 struct LDKCResult_HTLCDescriptorDecodeErrorZ HTLCDescriptor_read(struct LDKu8slice ser);
53774
53775 /**
53776  * Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint
53777  * being spent by the HTLC input in the HTLC transaction.
53778  */
53779 MUST_USE_RES struct LDKOutPoint HTLCDescriptor_outpoint(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
53780
53781 /**
53782  * Returns the UTXO to be spent by the HTLC input, which can be obtained via
53783  * [`Self::unsigned_tx_input`].
53784  */
53785 MUST_USE_RES struct LDKTxOut HTLCDescriptor_previous_utxo(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
53786
53787 /**
53788  * Returns the unsigned transaction input spending the HTLC output in the commitment
53789  * transaction.
53790  */
53791 MUST_USE_RES struct LDKTxIn HTLCDescriptor_unsigned_tx_input(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
53792
53793 /**
53794  * Returns the delayed output created as a result of spending the HTLC output in the commitment
53795  * transaction.
53796  */
53797 MUST_USE_RES struct LDKTxOut HTLCDescriptor_tx_output(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
53798
53799 /**
53800  * Returns the witness script of the HTLC output in the commitment transaction.
53801  */
53802 MUST_USE_RES struct LDKCVec_u8Z HTLCDescriptor_witness_script(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
53803
53804 /**
53805  * Returns the fully signed witness required to spend the HTLC output in the commitment
53806  * transaction.
53807  */
53808 MUST_USE_RES struct LDKWitness HTLCDescriptor_tx_input_witness(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature, struct LDKu8slice witness_script);
53809
53810 /**
53811  * Derives the channel signer required to sign the HTLC input.
53812  */
53813 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
53814
53815 /**
53816  * Calls the free function if one is set
53817  */
53818 void ChannelSigner_free(struct LDKChannelSigner this_ptr);
53819
53820 /**
53821  * Creates a copy of the Recipient
53822  */
53823 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
53824
53825 /**
53826  * Utility method to constructs a new Node-variant Recipient
53827  */
53828 enum LDKRecipient Recipient_node(void);
53829
53830 /**
53831  * Utility method to constructs a new PhantomNode-variant Recipient
53832  */
53833 enum LDKRecipient Recipient_phantom_node(void);
53834
53835 /**
53836  * Calls the free function if one is set
53837  */
53838 void EntropySource_free(struct LDKEntropySource this_ptr);
53839
53840 /**
53841  * Calls the free function if one is set
53842  */
53843 void NodeSigner_free(struct LDKNodeSigner this_ptr);
53844
53845 /**
53846  * Calls the free function if one is set
53847  */
53848 void OutputSpender_free(struct LDKOutputSpender this_ptr);
53849
53850 /**
53851  * Calls the free function if one is set
53852  */
53853 void SignerProvider_free(struct LDKSignerProvider this_ptr);
53854
53855 /**
53856  * Calls the free function if one is set
53857  */
53858 void ChangeDestinationSource_free(struct LDKChangeDestinationSource this_ptr);
53859
53860 /**
53861  * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
53862  */
53863 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
53864
53865 /**
53866  * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
53867  * holder's anchor output in a commitment transaction, if one is present.
53868  */
53869 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
53870
53871 /**
53872  * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
53873  * holder's anchor output in a commitment transaction, if one is present.
53874  */
53875 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
53876
53877 /**
53878  * Holder secret key for blinded revocation pubkey.
53879  */
53880 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
53881
53882 /**
53883  * Holder secret key for blinded revocation pubkey.
53884  */
53885 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
53886
53887 /**
53888  * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
53889  */
53890 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
53891
53892 /**
53893  * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
53894  */
53895 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
53896
53897 /**
53898  * Holder secret key used in an HTLC transaction.
53899  */
53900 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
53901
53902 /**
53903  * Holder secret key used in an HTLC transaction.
53904  */
53905 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
53906
53907 /**
53908  * Holder HTLC secret key used in commitment transaction HTLC outputs.
53909  */
53910 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
53911
53912 /**
53913  * Holder HTLC secret key used in commitment transaction HTLC outputs.
53914  */
53915 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
53916
53917 /**
53918  * Commitment seed.
53919  */
53920 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
53921
53922 /**
53923  * Commitment seed.
53924  */
53925 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
53926
53927 /**
53928  * Creates a copy of the InMemorySigner
53929  */
53930 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
53931
53932 /**
53933  * Creates a new [`InMemorySigner`].
53934  */
53935 MUST_USE_RES struct LDKInMemorySigner InMemorySigner_new(struct LDKSecretKey funding_key, struct LDKSecretKey revocation_base_key, struct LDKSecretKey payment_key, struct LDKSecretKey delayed_payment_base_key, struct LDKSecretKey htlc_base_key, struct LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id, struct LDKThirtyTwoBytes rand_bytes_unique_start);
53936
53937 /**
53938  * Returns the counterparty's pubkeys.
53939  *
53940  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
53941  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
53942  *
53943  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
53944  */
53945 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53946
53947 /**
53948  * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable
53949  * transactions, i.e., the amount of time that we have to wait to recover our funds if we
53950  * broadcast a transaction.
53951  *
53952  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
53953  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
53954  */
53955 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53956
53957 /**
53958  * Returns the `contest_delay` value specified by us and applied on transactions broadcastable
53959  * by our counterparty, i.e., the amount of time that they have to wait to recover their funds
53960  * if they broadcast a transaction.
53961  *
53962  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
53963  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
53964  */
53965 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53966
53967 /**
53968  * Returns whether the holder is the initiator.
53969  *
53970  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
53971  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
53972  */
53973 MUST_USE_RES struct LDKCOption_boolZ InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53974
53975 /**
53976  * Funding outpoint
53977  *
53978  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
53979  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
53980  *
53981  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
53982  */
53983 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53984
53985 /**
53986  * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or
53987  * building transactions.
53988  *
53989  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
53990  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
53991  *
53992  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
53993  */
53994 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53995
53996 /**
53997  * Returns the channel type features of the channel parameters. Should be helpful for
53998  * determining a channel's category, i. e. legacy/anchors/taproot/etc.
53999  *
54000  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
54001  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
54002  *
54003  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
54004  */
54005 MUST_USE_RES struct LDKChannelTypeFeatures InMemorySigner_channel_type_features(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
54006
54007 /**
54008  * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described
54009  * by `descriptor`, returning the witness stack for the input.
54010  *
54011  * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
54012  * is not spending the outpoint described by [`descriptor.outpoint`],
54013  * or if an output descriptor `script_pubkey` does not match the one we can spend.
54014  *
54015  * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint
54016  */
54017 MUST_USE_RES struct LDKCResult_WitnessNoneZ InMemorySigner_sign_counterparty_payment_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR descriptor);
54018
54019 /**
54020  * Sign the single input of `spend_tx` at index `input_idx` which spends the output
54021  * described by `descriptor`, returning the witness stack for the input.
54022  *
54023  * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
54024  * is not spending the outpoint described by [`descriptor.outpoint`], does not have a
54025  * sequence set to [`descriptor.to_self_delay`], or if an output descriptor
54026  * `script_pubkey` does not match the one we can spend.
54027  *
54028  * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint
54029  * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay
54030  */
54031 MUST_USE_RES struct LDKCResult_WitnessNoneZ InMemorySigner_sign_dynamic_p2wsh_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR descriptor);
54032
54033 /**
54034  * Constructs a new EntropySource which calls the relevant methods on this_arg.
54035  * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
54036  */
54037 struct LDKEntropySource InMemorySigner_as_EntropySource(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
54038
54039 /**
54040  * Constructs a new ChannelSigner which calls the relevant methods on this_arg.
54041  * This copies the `inner` pointer in this_arg and thus the returned ChannelSigner must be freed before this_arg is
54042  */
54043 struct LDKChannelSigner InMemorySigner_as_ChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
54044
54045 /**
54046  * Constructs a new EcdsaChannelSigner which calls the relevant methods on this_arg.
54047  * This copies the `inner` pointer in this_arg and thus the returned EcdsaChannelSigner must be freed before this_arg is
54048  */
54049 struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
54050
54051 /**
54052  * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg.
54053  * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is
54054  */
54055 struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
54056
54057 /**
54058  * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
54059  */
54060 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
54061
54062 /**
54063  * Read a InMemorySigner from a byte array, created by InMemorySigner_write
54064  */
54065 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg);
54066
54067 /**
54068  * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
54069  */
54070 void KeysManager_free(struct LDKKeysManager this_obj);
54071
54072 /**
54073  * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g.,
54074  * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
54075  * `starting_time` isn't strictly required to actually be a time, but it must absolutely,
54076  * without a doubt, be unique to this instance. ie if you start multiple times with the same
54077  * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this
54078  * is to simply use the current time (with very high precision).
54079  *
54080  * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however,
54081  * obviously, `starting_time` should be unique every time you reload the library - it is only
54082  * used to generate new ephemeral key data (which will be stored by the individual channel if
54083  * necessary).
54084  *
54085  * Note that the seed is required to recover certain on-chain funds independent of
54086  * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required
54087  * for any channel, and some on-chain during-closing funds.
54088  *
54089  * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
54090  */
54091 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
54092
54093 /**
54094  * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
54095  */
54096 MUST_USE_RES struct LDKSecretKey KeysManager_get_node_secret_key(const struct LDKKeysManager *NONNULL_PTR this_arg);
54097
54098 /**
54099  * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters.
54100  */
54101 MUST_USE_RES struct LDKInMemorySigner KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]);
54102
54103 /**
54104  * Signs the given [`PartiallySignedTransaction`] which spends the given [`SpendableOutputDescriptor`]s.
54105  * The resulting inputs will be finalized and the PSBT will be ready for broadcast if there
54106  * are no other inputs that need signing.
54107  *
54108  * Returns `Err(())` if the PSBT is missing a descriptor or if we fail to sign.
54109  *
54110  * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
54111  * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
54112  */
54113 MUST_USE_RES struct LDKCResult_CVec_u8ZNoneZ KeysManager_sign_spendable_outputs_psbt(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_u8Z psbt);
54114
54115 /**
54116  * Constructs a new EntropySource which calls the relevant methods on this_arg.
54117  * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
54118  */
54119 struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg);
54120
54121 /**
54122  * Constructs a new NodeSigner which calls the relevant methods on this_arg.
54123  * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
54124  */
54125 struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg);
54126
54127 /**
54128  * Constructs a new OutputSpender which calls the relevant methods on this_arg.
54129  * This copies the `inner` pointer in this_arg and thus the returned OutputSpender must be freed before this_arg is
54130  */
54131 struct LDKOutputSpender KeysManager_as_OutputSpender(const struct LDKKeysManager *NONNULL_PTR this_arg);
54132
54133 /**
54134  * Constructs a new SignerProvider which calls the relevant methods on this_arg.
54135  * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
54136  */
54137 struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg);
54138
54139 /**
54140  * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
54141  */
54142 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
54143
54144 /**
54145  * Constructs a new EntropySource which calls the relevant methods on this_arg.
54146  * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
54147  */
54148 struct LDKEntropySource PhantomKeysManager_as_EntropySource(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
54149
54150 /**
54151  * Constructs a new NodeSigner which calls the relevant methods on this_arg.
54152  * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
54153  */
54154 struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
54155
54156 /**
54157  * Constructs a new OutputSpender which calls the relevant methods on this_arg.
54158  * This copies the `inner` pointer in this_arg and thus the returned OutputSpender must be freed before this_arg is
54159  */
54160 struct LDKOutputSpender PhantomKeysManager_as_OutputSpender(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
54161
54162 /**
54163  * Constructs a new SignerProvider which calls the relevant methods on this_arg.
54164  * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
54165  */
54166 struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
54167
54168 /**
54169  * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed`
54170  * that is shared across all nodes that intend to participate in [phantom node payments]
54171  * together.
54172  *
54173  * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
54174  * `starting_time_nanos`.
54175  *
54176  * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
54177  * same across restarts, or else inbound payments may fail.
54178  *
54179  * [phantom node payments]: PhantomKeysManager
54180  */
54181 MUST_USE_RES struct LDKPhantomKeysManager PhantomKeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos, const uint8_t (*cross_node_seed)[32]);
54182
54183 /**
54184  * See [`KeysManager::derive_channel_keys`] for documentation on this method.
54185  */
54186 MUST_USE_RES struct LDKInMemorySigner PhantomKeysManager_derive_channel_keys(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]);
54187
54188 /**
54189  * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
54190  */
54191 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
54192
54193 /**
54194  * Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the
54195  * last-hop onion data, etc.
54196  */
54197 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
54198
54199 /**
54200  * Frees any resources used by the RandomBytes, if is_owned is set and inner is non-NULL.
54201  */
54202 void RandomBytes_free(struct LDKRandomBytes this_obj);
54203
54204 /**
54205  * Creates a new instance using the given seed.
54206  */
54207 MUST_USE_RES struct LDKRandomBytes RandomBytes_new(struct LDKThirtyTwoBytes seed);
54208
54209 /**
54210  * Constructs a new EntropySource which calls the relevant methods on this_arg.
54211  * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
54212  */
54213 struct LDKEntropySource RandomBytes_as_EntropySource(const struct LDKRandomBytes *NONNULL_PTR this_arg);
54214
54215 /**
54216  * Calls the free function if one is set
54217  */
54218 void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr);
54219
54220 /**
54221  * Creates a copy of a WriteableEcdsaChannelSigner
54222  */
54223 struct LDKWriteableEcdsaChannelSigner WriteableEcdsaChannelSigner_clone(const struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR orig);
54224
54225 /**
54226  * Calls the free function if one is set
54227  */
54228 void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr);
54229
54230 /**
54231  * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
54232  */
54233 void OnionMessenger_free(struct LDKOnionMessenger this_obj);
54234
54235 /**
54236  * Calls the free function if one is set
54237  */
54238 void MessageRouter_free(struct LDKMessageRouter this_ptr);
54239
54240 /**
54241  * Frees any resources used by the DefaultMessageRouter, if is_owned is set and inner is non-NULL.
54242  */
54243 void DefaultMessageRouter_free(struct LDKDefaultMessageRouter this_obj);
54244
54245 /**
54246  * Creates a [`DefaultMessageRouter`] using the given [`NetworkGraph`].
54247  */
54248 MUST_USE_RES struct LDKDefaultMessageRouter DefaultMessageRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKEntropySource entropy_source);
54249
54250 /**
54251  * Constructs a new MessageRouter which calls the relevant methods on this_arg.
54252  * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
54253  */
54254 struct LDKMessageRouter DefaultMessageRouter_as_MessageRouter(const struct LDKDefaultMessageRouter *NONNULL_PTR this_arg);
54255
54256 /**
54257  * Frees any resources used by the OnionMessagePath, if is_owned is set and inner is non-NULL.
54258  */
54259 void OnionMessagePath_free(struct LDKOnionMessagePath this_obj);
54260
54261 /**
54262  * Nodes on the path between the sender and the destination.
54263  *
54264  * Returns a copy of the field.
54265  */
54266 struct LDKCVec_PublicKeyZ OnionMessagePath_get_intermediate_nodes(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
54267
54268 /**
54269  * Nodes on the path between the sender and the destination.
54270  */
54271 void OnionMessagePath_set_intermediate_nodes(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCVec_PublicKeyZ val);
54272
54273 /**
54274  * The recipient of the message.
54275  */
54276 struct LDKDestination OnionMessagePath_get_destination(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
54277
54278 /**
54279  * The recipient of the message.
54280  */
54281 void OnionMessagePath_set_destination(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKDestination val);
54282
54283 /**
54284  * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
54285  *
54286  * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
54287  * this to initiate such a connection.
54288  *
54289  * Returns a copy of the field.
54290  */
54291 struct LDKCOption_CVec_SocketAddressZZ OnionMessagePath_get_first_node_addresses(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
54292
54293 /**
54294  * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
54295  *
54296  * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
54297  * this to initiate such a connection.
54298  */
54299 void OnionMessagePath_set_first_node_addresses(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCOption_CVec_SocketAddressZZ val);
54300
54301 /**
54302  * Constructs a new OnionMessagePath given each field
54303  */
54304 MUST_USE_RES struct LDKOnionMessagePath OnionMessagePath_new(struct LDKCVec_PublicKeyZ intermediate_nodes_arg, struct LDKDestination destination_arg, struct LDKCOption_CVec_SocketAddressZZ first_node_addresses_arg);
54305
54306 /**
54307  * Creates a copy of the OnionMessagePath
54308  */
54309 struct LDKOnionMessagePath OnionMessagePath_clone(const struct LDKOnionMessagePath *NONNULL_PTR orig);
54310
54311 /**
54312  * Returns the first node in the path.
54313  *
54314  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
54315  */
54316 MUST_USE_RES struct LDKPublicKey OnionMessagePath_first_node(const struct LDKOnionMessagePath *NONNULL_PTR this_arg);
54317
54318 /**
54319  * Frees any resources used by the Destination
54320  */
54321 void Destination_free(struct LDKDestination this_ptr);
54322
54323 /**
54324  * Creates a copy of the Destination
54325  */
54326 struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig);
54327
54328 /**
54329  * Utility method to constructs a new Node-variant Destination
54330  */
54331 struct LDKDestination Destination_node(struct LDKPublicKey a);
54332
54333 /**
54334  * Utility method to constructs a new BlindedPath-variant Destination
54335  */
54336 struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a);
54337
54338 /**
54339  * Generates a non-cryptographic 64-bit hash of the Destination.
54340  */
54341 uint64_t Destination_hash(const struct LDKDestination *NONNULL_PTR o);
54342
54343 /**
54344  * Checks if two Destinations contain equal inner contents.
54345  * This ignores pointers and is_owned flags and looks at the values in fields.
54346  */
54347 bool Destination_eq(const struct LDKDestination *NONNULL_PTR a, const struct LDKDestination *NONNULL_PTR b);
54348
54349 /**
54350  * Attempts to resolve the [`IntroductionNode::DirectedShortChannelId`] of a
54351  * [`Destination::BlindedPath`] to a [`IntroductionNode::NodeId`], if applicable, using the
54352  * provided [`ReadOnlyNetworkGraph`].
54353  */
54354 void Destination_resolve(struct LDKDestination *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph);
54355
54356 /**
54357  * Frees any resources used by the SendSuccess
54358  */
54359 void SendSuccess_free(struct LDKSendSuccess this_ptr);
54360
54361 /**
54362  * Creates a copy of the SendSuccess
54363  */
54364 struct LDKSendSuccess SendSuccess_clone(const struct LDKSendSuccess *NONNULL_PTR orig);
54365
54366 /**
54367  * Utility method to constructs a new Buffered-variant SendSuccess
54368  */
54369 struct LDKSendSuccess SendSuccess_buffered(void);
54370
54371 /**
54372  * Utility method to constructs a new BufferedAwaitingConnection-variant SendSuccess
54373  */
54374 struct LDKSendSuccess SendSuccess_buffered_awaiting_connection(struct LDKPublicKey a);
54375
54376 /**
54377  * Generates a non-cryptographic 64-bit hash of the SendSuccess.
54378  */
54379 uint64_t SendSuccess_hash(const struct LDKSendSuccess *NONNULL_PTR o);
54380
54381 /**
54382  * Checks if two SendSuccesss contain equal inner contents.
54383  * This ignores pointers and is_owned flags and looks at the values in fields.
54384  */
54385 bool SendSuccess_eq(const struct LDKSendSuccess *NONNULL_PTR a, const struct LDKSendSuccess *NONNULL_PTR b);
54386
54387 /**
54388  * Frees any resources used by the SendError
54389  */
54390 void SendError_free(struct LDKSendError this_ptr);
54391
54392 /**
54393  * Creates a copy of the SendError
54394  */
54395 struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
54396
54397 /**
54398  * Utility method to constructs a new Secp256k1-variant SendError
54399  */
54400 struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
54401
54402 /**
54403  * Utility method to constructs a new TooBigPacket-variant SendError
54404  */
54405 struct LDKSendError SendError_too_big_packet(void);
54406
54407 /**
54408  * Utility method to constructs a new TooFewBlindedHops-variant SendError
54409  */
54410 struct LDKSendError SendError_too_few_blinded_hops(void);
54411
54412 /**
54413  * Utility method to constructs a new InvalidFirstHop-variant SendError
54414  */
54415 struct LDKSendError SendError_invalid_first_hop(struct LDKPublicKey a);
54416
54417 /**
54418  * Utility method to constructs a new PathNotFound-variant SendError
54419  */
54420 struct LDKSendError SendError_path_not_found(void);
54421
54422 /**
54423  * Utility method to constructs a new InvalidMessage-variant SendError
54424  */
54425 struct LDKSendError SendError_invalid_message(void);
54426
54427 /**
54428  * Utility method to constructs a new BufferFull-variant SendError
54429  */
54430 struct LDKSendError SendError_buffer_full(void);
54431
54432 /**
54433  * Utility method to constructs a new GetNodeIdFailed-variant SendError
54434  */
54435 struct LDKSendError SendError_get_node_id_failed(void);
54436
54437 /**
54438  * Utility method to constructs a new UnresolvedIntroductionNode-variant SendError
54439  */
54440 struct LDKSendError SendError_unresolved_introduction_node(void);
54441
54442 /**
54443  * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
54444  */
54445 struct LDKSendError SendError_blinded_path_advance_failed(void);
54446
54447 /**
54448  * Generates a non-cryptographic 64-bit hash of the SendError.
54449  */
54450 uint64_t SendError_hash(const struct LDKSendError *NONNULL_PTR o);
54451
54452 /**
54453  * Checks if two SendErrors contain equal inner contents.
54454  * This ignores pointers and is_owned flags and looks at the values in fields.
54455  */
54456 bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
54457
54458 /**
54459  * Calls the free function if one is set
54460  */
54461 void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
54462
54463 /**
54464  * Frees any resources used by the PeeledOnion
54465  */
54466 void PeeledOnion_free(struct LDKPeeledOnion this_ptr);
54467
54468 /**
54469  * Creates a copy of the PeeledOnion
54470  */
54471 struct LDKPeeledOnion PeeledOnion_clone(const struct LDKPeeledOnion *NONNULL_PTR orig);
54472
54473 /**
54474  * Utility method to constructs a new Forward-variant PeeledOnion
54475  */
54476 struct LDKPeeledOnion PeeledOnion_forward(struct LDKNextMessageHop a, struct LDKOnionMessage b);
54477
54478 /**
54479  * Utility method to constructs a new Receive-variant PeeledOnion
54480  */
54481 struct LDKPeeledOnion PeeledOnion_receive(struct LDKParsedOnionMessageContents a, struct LDKThirtyTwoBytes b, struct LDKBlindedPath c);
54482
54483 /**
54484  * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
54485  * `path`, first calling [`Destination::resolve`] on `path.destination` with the given
54486  * [`ReadOnlyNetworkGraph`].
54487  *
54488  * Returns the node id of the peer to send the message to, the message itself, and any addresses
54489  * needed to connect to the first node.
54490  *
54491  * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
54492  */
54493 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message_resolving_destination(const struct LDKEntropySource *NONNULL_PTR entropy_source, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph, struct LDKOnionMessagePath path, struct LDKOnionMessageContents contents, struct LDKBlindedPath reply_path);
54494
54495 /**
54496  * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
54497  * `path`.
54498  *
54499  * Returns the node id of the peer to send the message to, the message itself, and any addresses
54500  * needed to connect to the first node.
54501  *
54502  * Returns [`SendError::UnresolvedIntroductionNode`] if:
54503  * - `destination` contains a blinded path with an [`IntroductionNode::DirectedShortChannelId`],
54504  * - unless it can be resolved by [`NodeIdLookUp::next_node_id`].
54505  * Use [`create_onion_message_resolving_destination`] instead to resolve the introduction node
54506  * first with a [`ReadOnlyNetworkGraph`].
54507  *
54508  * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
54509  */
54510 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message(const struct LDKEntropySource *NONNULL_PTR entropy_source, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup, struct LDKOnionMessagePath path, struct LDKOnionMessageContents contents, struct LDKBlindedPath reply_path);
54511
54512 /**
54513  * Decode one layer of an incoming [`OnionMessage`].
54514  *
54515  * Returns either the next layer of the onion for forwarding or the decrypted content for the
54516  * receiver.
54517  */
54518 struct LDKCResult_PeeledOnionNoneZ peel_onion_message(const struct LDKOnionMessage *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler);
54519
54520 /**
54521  * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
54522  * their respective handlers.
54523  */
54524 MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKNodeIdLookUp node_id_lookup, struct LDKMessageRouter message_router, struct LDKOffersMessageHandler offers_handler, struct LDKCustomOnionMessageHandler custom_handler);
54525
54526 /**
54527  * Sends an [`OnionMessage`] with the given `contents` to `destination`.
54528  *
54529  * See [`OnionMessenger`] for example usage.
54530  *
54531  * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
54532  */
54533 MUST_USE_RES struct LDKCResult_SendSuccessSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessageContents contents, struct LDKDestination destination, struct LDKBlindedPath reply_path);
54534
54535 /**
54536  * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
54537  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
54538  */
54539 struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
54540
54541 /**
54542  * Calls the free function if one is set
54543  */
54544 void OffersMessageHandler_free(struct LDKOffersMessageHandler this_ptr);
54545
54546 /**
54547  * Frees any resources used by the OffersMessage
54548  */
54549 void OffersMessage_free(struct LDKOffersMessage this_ptr);
54550
54551 /**
54552  * Creates a copy of the OffersMessage
54553  */
54554 struct LDKOffersMessage OffersMessage_clone(const struct LDKOffersMessage *NONNULL_PTR orig);
54555
54556 /**
54557  * Utility method to constructs a new InvoiceRequest-variant OffersMessage
54558  */
54559 struct LDKOffersMessage OffersMessage_invoice_request(struct LDKInvoiceRequest a);
54560
54561 /**
54562  * Utility method to constructs a new Invoice-variant OffersMessage
54563  */
54564 struct LDKOffersMessage OffersMessage_invoice(struct LDKBolt12Invoice a);
54565
54566 /**
54567  * Utility method to constructs a new InvoiceError-variant OffersMessage
54568  */
54569 struct LDKOffersMessage OffersMessage_invoice_error(struct LDKInvoiceError a);
54570
54571 /**
54572  * Returns whether `tlv_type` corresponds to a TLV record for Offers.
54573  */
54574 MUST_USE_RES bool OffersMessage_is_known_type(uint64_t tlv_type);
54575
54576 /**
54577  * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
54578  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
54579  */
54580 struct LDKOnionMessageContents OffersMessage_as_OnionMessageContents(const struct LDKOffersMessage *NONNULL_PTR this_arg);
54581
54582 /**
54583  * Serialize the OffersMessage object into a byte array which can be read by OffersMessage_read
54584  */
54585 struct LDKCVec_u8Z OffersMessage_write(const struct LDKOffersMessage *NONNULL_PTR obj);
54586
54587 /**
54588  * Read a OffersMessage from a byte array, created by OffersMessage_write
54589  */
54590 struct LDKCResult_OffersMessageDecodeErrorZ OffersMessage_read(struct LDKu8slice ser, uint64_t arg_a, const struct LDKLogger *NONNULL_PTR arg_b);
54591
54592 /**
54593  * Frees any resources used by the Packet, if is_owned is set and inner is non-NULL.
54594  */
54595 void Packet_free(struct LDKPacket this_obj);
54596
54597 /**
54598  * Bolt 04 version number
54599  */
54600 uint8_t Packet_get_version(const struct LDKPacket *NONNULL_PTR this_ptr);
54601
54602 /**
54603  * Bolt 04 version number
54604  */
54605 void Packet_set_version(struct LDKPacket *NONNULL_PTR this_ptr, uint8_t val);
54606
54607 /**
54608  * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
54609  */
54610 struct LDKPublicKey Packet_get_public_key(const struct LDKPacket *NONNULL_PTR this_ptr);
54611
54612 /**
54613  * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
54614  */
54615 void Packet_set_public_key(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
54616
54617 /**
54618  * Encrypted payload for the next hop
54619  *
54620  * Returns a copy of the field.
54621  */
54622 struct LDKCVec_u8Z Packet_get_hop_data(const struct LDKPacket *NONNULL_PTR this_ptr);
54623
54624 /**
54625  * Encrypted payload for the next hop
54626  */
54627 void Packet_set_hop_data(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
54628
54629 /**
54630  * HMAC to verify the integrity of hop_data
54631  */
54632 const uint8_t (*Packet_get_hmac(const struct LDKPacket *NONNULL_PTR this_ptr))[32];
54633
54634 /**
54635  * HMAC to verify the integrity of hop_data
54636  */
54637 void Packet_set_hmac(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
54638
54639 /**
54640  * Constructs a new Packet given each field
54641  */
54642 MUST_USE_RES struct LDKPacket Packet_new(uint8_t version_arg, struct LDKPublicKey public_key_arg, struct LDKCVec_u8Z hop_data_arg, struct LDKThirtyTwoBytes hmac_arg);
54643
54644 /**
54645  * Creates a copy of the Packet
54646  */
54647 struct LDKPacket Packet_clone(const struct LDKPacket *NONNULL_PTR orig);
54648
54649 /**
54650  * Generates a non-cryptographic 64-bit hash of the Packet.
54651  */
54652 uint64_t Packet_hash(const struct LDKPacket *NONNULL_PTR o);
54653
54654 /**
54655  * Checks if two Packets contain equal inner contents.
54656  * This ignores pointers and is_owned flags and looks at the values in fields.
54657  * Two objects with NULL inner values will be considered "equal" here.
54658  */
54659 bool Packet_eq(const struct LDKPacket *NONNULL_PTR a, const struct LDKPacket *NONNULL_PTR b);
54660
54661 /**
54662  * Serialize the Packet object into a byte array which can be read by Packet_read
54663  */
54664 struct LDKCVec_u8Z Packet_write(const struct LDKPacket *NONNULL_PTR obj);
54665
54666 /**
54667  * Frees any resources used by the ParsedOnionMessageContents
54668  */
54669 void ParsedOnionMessageContents_free(struct LDKParsedOnionMessageContents this_ptr);
54670
54671 /**
54672  * Creates a copy of the ParsedOnionMessageContents
54673  */
54674 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_clone(const struct LDKParsedOnionMessageContents *NONNULL_PTR orig);
54675
54676 /**
54677  * Utility method to constructs a new Offers-variant ParsedOnionMessageContents
54678  */
54679 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_offers(struct LDKOffersMessage a);
54680
54681 /**
54682  * Utility method to constructs a new Custom-variant ParsedOnionMessageContents
54683  */
54684 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_custom(struct LDKOnionMessageContents a);
54685
54686 /**
54687  * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
54688  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
54689  */
54690 struct LDKOnionMessageContents ParsedOnionMessageContents_as_OnionMessageContents(const struct LDKParsedOnionMessageContents *NONNULL_PTR this_arg);
54691
54692 /**
54693  * Serialize the ParsedOnionMessageContents object into a byte array which can be read by ParsedOnionMessageContents_read
54694  */
54695 struct LDKCVec_u8Z ParsedOnionMessageContents_write(const struct LDKParsedOnionMessageContents *NONNULL_PTR obj);
54696
54697 /**
54698  * Creates a copy of a OnionMessageContents
54699  */
54700 struct LDKOnionMessageContents OnionMessageContents_clone(const struct LDKOnionMessageContents *NONNULL_PTR orig);
54701
54702 /**
54703  * Calls the free function if one is set
54704  */
54705 void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr);
54706
54707 /**
54708  * Frees any resources used by the NextMessageHop
54709  */
54710 void NextMessageHop_free(struct LDKNextMessageHop this_ptr);
54711
54712 /**
54713  * Creates a copy of the NextMessageHop
54714  */
54715 struct LDKNextMessageHop NextMessageHop_clone(const struct LDKNextMessageHop *NONNULL_PTR orig);
54716
54717 /**
54718  * Utility method to constructs a new NodeId-variant NextMessageHop
54719  */
54720 struct LDKNextMessageHop NextMessageHop_node_id(struct LDKPublicKey a);
54721
54722 /**
54723  * Utility method to constructs a new ShortChannelId-variant NextMessageHop
54724  */
54725 struct LDKNextMessageHop NextMessageHop_short_channel_id(uint64_t a);
54726
54727 /**
54728  * Generates a non-cryptographic 64-bit hash of the NextMessageHop.
54729  */
54730 uint64_t NextMessageHop_hash(const struct LDKNextMessageHop *NONNULL_PTR o);
54731
54732 /**
54733  * Checks if two NextMessageHops contain equal inner contents.
54734  * This ignores pointers and is_owned flags and looks at the values in fields.
54735  */
54736 bool NextMessageHop_eq(const struct LDKNextMessageHop *NONNULL_PTR a, const struct LDKNextMessageHop *NONNULL_PTR b);
54737
54738 /**
54739  * Frees any resources used by the BlindedPath, if is_owned is set and inner is non-NULL.
54740  */
54741 void BlindedPath_free(struct LDKBlindedPath this_obj);
54742
54743 /**
54744  * To send to a blinded path, the sender first finds a route to the unblinded
54745  * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion
54746  * message or payment's next hop and forward it along.
54747  *
54748  * [`encrypted_payload`]: BlindedHop::encrypted_payload
54749  */
54750 struct LDKIntroductionNode BlindedPath_get_introduction_node(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
54751
54752 /**
54753  * To send to a blinded path, the sender first finds a route to the unblinded
54754  * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion
54755  * message or payment's next hop and forward it along.
54756  *
54757  * [`encrypted_payload`]: BlindedHop::encrypted_payload
54758  */
54759 void BlindedPath_set_introduction_node(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKIntroductionNode val);
54760
54761 /**
54762  * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
54763  * message or payment.
54764  *
54765  * [`encrypted_payload`]: BlindedHop::encrypted_payload
54766  */
54767 struct LDKPublicKey BlindedPath_get_blinding_point(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
54768
54769 /**
54770  * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
54771  * message or payment.
54772  *
54773  * [`encrypted_payload`]: BlindedHop::encrypted_payload
54774  */
54775 void BlindedPath_set_blinding_point(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
54776
54777 /**
54778  * The hops composing the blinded path.
54779  */
54780 struct LDKCVec_BlindedHopZ BlindedPath_get_blinded_hops(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
54781
54782 /**
54783  * The hops composing the blinded path.
54784  */
54785 void BlindedPath_set_blinded_hops(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
54786
54787 /**
54788  * Constructs a new BlindedPath given each field
54789  */
54790 MUST_USE_RES struct LDKBlindedPath BlindedPath_new(struct LDKIntroductionNode introduction_node_arg, struct LDKPublicKey blinding_point_arg, struct LDKCVec_BlindedHopZ blinded_hops_arg);
54791
54792 /**
54793  * Creates a copy of the BlindedPath
54794  */
54795 struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig);
54796
54797 /**
54798  * Generates a non-cryptographic 64-bit hash of the BlindedPath.
54799  */
54800 uint64_t BlindedPath_hash(const struct LDKBlindedPath *NONNULL_PTR o);
54801
54802 /**
54803  * Checks if two BlindedPaths contain equal inner contents.
54804  * This ignores pointers and is_owned flags and looks at the values in fields.
54805  * Two objects with NULL inner values will be considered "equal" here.
54806  */
54807 bool BlindedPath_eq(const struct LDKBlindedPath *NONNULL_PTR a, const struct LDKBlindedPath *NONNULL_PTR b);
54808
54809 /**
54810  * Frees any resources used by the IntroductionNode
54811  */
54812 void IntroductionNode_free(struct LDKIntroductionNode this_ptr);
54813
54814 /**
54815  * Creates a copy of the IntroductionNode
54816  */
54817 struct LDKIntroductionNode IntroductionNode_clone(const struct LDKIntroductionNode *NONNULL_PTR orig);
54818
54819 /**
54820  * Utility method to constructs a new NodeId-variant IntroductionNode
54821  */
54822 struct LDKIntroductionNode IntroductionNode_node_id(struct LDKPublicKey a);
54823
54824 /**
54825  * Utility method to constructs a new DirectedShortChannelId-variant IntroductionNode
54826  */
54827 struct LDKIntroductionNode IntroductionNode_directed_short_channel_id(enum LDKDirection a, uint64_t b);
54828
54829 /**
54830  * Generates a non-cryptographic 64-bit hash of the IntroductionNode.
54831  */
54832 uint64_t IntroductionNode_hash(const struct LDKIntroductionNode *NONNULL_PTR o);
54833
54834 /**
54835  * Checks if two IntroductionNodes contain equal inner contents.
54836  * This ignores pointers and is_owned flags and looks at the values in fields.
54837  */
54838 bool IntroductionNode_eq(const struct LDKIntroductionNode *NONNULL_PTR a, const struct LDKIntroductionNode *NONNULL_PTR b);
54839
54840 /**
54841  * Creates a copy of the Direction
54842  */
54843 enum LDKDirection Direction_clone(const enum LDKDirection *NONNULL_PTR orig);
54844
54845 /**
54846  * Utility method to constructs a new NodeOne-variant Direction
54847  */
54848 enum LDKDirection Direction_node_one(void);
54849
54850 /**
54851  * Utility method to constructs a new NodeTwo-variant Direction
54852  */
54853 enum LDKDirection Direction_node_two(void);
54854
54855 /**
54856  * Generates a non-cryptographic 64-bit hash of the Direction.
54857  */
54858 uint64_t Direction_hash(const enum LDKDirection *NONNULL_PTR o);
54859
54860 /**
54861  * Checks if two Directions contain equal inner contents.
54862  * This ignores pointers and is_owned flags and looks at the values in fields.
54863  */
54864 bool Direction_eq(const enum LDKDirection *NONNULL_PTR a, const enum LDKDirection *NONNULL_PTR b);
54865
54866 /**
54867  * Calls the free function if one is set
54868  */
54869 void NodeIdLookUp_free(struct LDKNodeIdLookUp this_ptr);
54870
54871 /**
54872  * Frees any resources used by the EmptyNodeIdLookUp, if is_owned is set and inner is non-NULL.
54873  */
54874 void EmptyNodeIdLookUp_free(struct LDKEmptyNodeIdLookUp this_obj);
54875
54876 /**
54877  * Constructs a new EmptyNodeIdLookUp given each field
54878  */
54879 MUST_USE_RES struct LDKEmptyNodeIdLookUp EmptyNodeIdLookUp_new(void);
54880
54881 /**
54882  * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg.
54883  * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is
54884  */
54885 struct LDKNodeIdLookUp EmptyNodeIdLookUp_as_NodeIdLookUp(const struct LDKEmptyNodeIdLookUp *NONNULL_PTR this_arg);
54886
54887 /**
54888  * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
54889  */
54890 void BlindedHop_free(struct LDKBlindedHop this_obj);
54891
54892 /**
54893  * The blinded node id of this hop in a [`BlindedPath`].
54894  */
54895 struct LDKPublicKey BlindedHop_get_blinded_node_id(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
54896
54897 /**
54898  * The blinded node id of this hop in a [`BlindedPath`].
54899  */
54900 void BlindedHop_set_blinded_node_id(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
54901
54902 /**
54903  * The encrypted payload intended for this hop in a [`BlindedPath`].
54904  *
54905  * Returns a copy of the field.
54906  */
54907 struct LDKCVec_u8Z BlindedHop_get_encrypted_payload(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
54908
54909 /**
54910  * The encrypted payload intended for this hop in a [`BlindedPath`].
54911  */
54912 void BlindedHop_set_encrypted_payload(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
54913
54914 /**
54915  * Constructs a new BlindedHop given each field
54916  */
54917 MUST_USE_RES struct LDKBlindedHop BlindedHop_new(struct LDKPublicKey blinded_node_id_arg, struct LDKCVec_u8Z encrypted_payload_arg);
54918
54919 /**
54920  * Creates a copy of the BlindedHop
54921  */
54922 struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig);
54923
54924 /**
54925  * Generates a non-cryptographic 64-bit hash of the BlindedHop.
54926  */
54927 uint64_t BlindedHop_hash(const struct LDKBlindedHop *NONNULL_PTR o);
54928
54929 /**
54930  * Checks if two BlindedHops contain equal inner contents.
54931  * This ignores pointers and is_owned flags and looks at the values in fields.
54932  * Two objects with NULL inner values will be considered "equal" here.
54933  */
54934 bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b);
54935
54936 /**
54937  * Create a one-hop blinded path for a message.
54938  */
54939 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_one_hop_for_message(struct LDKPublicKey recipient_node_id, struct LDKEntropySource entropy_source);
54940
54941 /**
54942  * Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node
54943  * pubkey in `node_pks` will be the destination node.
54944  *
54945  * Errors if no hops are provided or if `node_pk`(s) are invalid.
54946  */
54947 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, struct LDKEntropySource entropy_source);
54948
54949 /**
54950  * Create a one-hop blinded path for a payment.
54951  */
54952 MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_one_hop_for_payment(struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, uint16_t min_final_cltv_expiry_delta, struct LDKEntropySource entropy_source);
54953
54954 /**
54955  * Create a blinded path for a payment, to be forwarded along `intermediate_nodes`.
54956  *
54957  * Errors if:
54958  * * a provided node id is invalid
54959  * * [`BlindedPayInfo`] calculation results in an integer overflow
54960  * * any unknown features are required in the provided [`ForwardTlvs`]
54961  *
54962  * [`ForwardTlvs`]: crate::blinded_path::payment::ForwardTlvs
54963  */
54964 MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_new_for_payment(struct LDKCVec_ForwardNodeZ intermediate_nodes, struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, uint64_t htlc_maximum_msat, uint16_t min_final_cltv_expiry_delta, struct LDKEntropySource entropy_source);
54965
54966 /**
54967  * Returns the introduction [`NodeId`] of the blinded path, if it is publicly reachable (i.e.,
54968  * it is found in the network graph).
54969  *
54970  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
54971  */
54972 MUST_USE_RES struct LDKNodeId BlindedPath_public_introduction_node_id(const struct LDKBlindedPath *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph);
54973
54974 /**
54975  * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
54976  */
54977 struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj);
54978
54979 /**
54980  * Read a BlindedPath from a byte array, created by BlindedPath_write
54981  */
54982 struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser);
54983
54984 /**
54985  * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
54986  */
54987 struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
54988
54989 /**
54990  * Read a BlindedHop from a byte array, created by BlindedHop_write
54991  */
54992 struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
54993
54994 /**
54995  * Frees any resources used by the ForwardNode, if is_owned is set and inner is non-NULL.
54996  */
54997 void ForwardNode_free(struct LDKForwardNode this_obj);
54998
54999 /**
55000  * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
55001  * used for [`BlindedPayInfo`] construction.
55002  */
55003 struct LDKForwardTlvs ForwardNode_get_tlvs(const struct LDKForwardNode *NONNULL_PTR this_ptr);
55004
55005 /**
55006  * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
55007  * used for [`BlindedPayInfo`] construction.
55008  */
55009 void ForwardNode_set_tlvs(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKForwardTlvs val);
55010
55011 /**
55012  * This node's pubkey.
55013  */
55014 struct LDKPublicKey ForwardNode_get_node_id(const struct LDKForwardNode *NONNULL_PTR this_ptr);
55015
55016 /**
55017  * This node's pubkey.
55018  */
55019 void ForwardNode_set_node_id(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val);
55020
55021 /**
55022  * The maximum value, in msat, that may be accepted by this node.
55023  */
55024 uint64_t ForwardNode_get_htlc_maximum_msat(const struct LDKForwardNode *NONNULL_PTR this_ptr);
55025
55026 /**
55027  * The maximum value, in msat, that may be accepted by this node.
55028  */
55029 void ForwardNode_set_htlc_maximum_msat(struct LDKForwardNode *NONNULL_PTR this_ptr, uint64_t val);
55030
55031 /**
55032  * Constructs a new ForwardNode given each field
55033  */
55034 MUST_USE_RES struct LDKForwardNode ForwardNode_new(struct LDKForwardTlvs tlvs_arg, struct LDKPublicKey node_id_arg, uint64_t htlc_maximum_msat_arg);
55035
55036 /**
55037  * Creates a copy of the ForwardNode
55038  */
55039 struct LDKForwardNode ForwardNode_clone(const struct LDKForwardNode *NONNULL_PTR orig);
55040
55041 /**
55042  * Frees any resources used by the ForwardTlvs, if is_owned is set and inner is non-NULL.
55043  */
55044 void ForwardTlvs_free(struct LDKForwardTlvs this_obj);
55045
55046 /**
55047  * The short channel id this payment should be forwarded out over.
55048  */
55049 uint64_t ForwardTlvs_get_short_channel_id(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
55050
55051 /**
55052  * The short channel id this payment should be forwarded out over.
55053  */
55054 void ForwardTlvs_set_short_channel_id(struct LDKForwardTlvs *NONNULL_PTR this_ptr, uint64_t val);
55055
55056 /**
55057  * Payment parameters for relaying over [`Self::short_channel_id`].
55058  */
55059 struct LDKPaymentRelay ForwardTlvs_get_payment_relay(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
55060
55061 /**
55062  * Payment parameters for relaying over [`Self::short_channel_id`].
55063  */
55064 void ForwardTlvs_set_payment_relay(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentRelay val);
55065
55066 /**
55067  * Payment constraints for relaying over [`Self::short_channel_id`].
55068  */
55069 struct LDKPaymentConstraints ForwardTlvs_get_payment_constraints(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
55070
55071 /**
55072  * Payment constraints for relaying over [`Self::short_channel_id`].
55073  */
55074 void ForwardTlvs_set_payment_constraints(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
55075
55076 /**
55077  * Supported and required features when relaying a payment onion containing this object's
55078  * corresponding [`BlindedHop::encrypted_payload`].
55079  *
55080  * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
55081  */
55082 struct LDKBlindedHopFeatures ForwardTlvs_get_features(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
55083
55084 /**
55085  * Supported and required features when relaying a payment onion containing this object's
55086  * corresponding [`BlindedHop::encrypted_payload`].
55087  *
55088  * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
55089  */
55090 void ForwardTlvs_set_features(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
55091
55092 /**
55093  * Constructs a new ForwardTlvs given each field
55094  */
55095 MUST_USE_RES struct LDKForwardTlvs ForwardTlvs_new(uint64_t short_channel_id_arg, struct LDKPaymentRelay payment_relay_arg, struct LDKPaymentConstraints payment_constraints_arg, struct LDKBlindedHopFeatures features_arg);
55096
55097 /**
55098  * Creates a copy of the ForwardTlvs
55099  */
55100 struct LDKForwardTlvs ForwardTlvs_clone(const struct LDKForwardTlvs *NONNULL_PTR orig);
55101
55102 /**
55103  * Frees any resources used by the ReceiveTlvs, if is_owned is set and inner is non-NULL.
55104  */
55105 void ReceiveTlvs_free(struct LDKReceiveTlvs this_obj);
55106
55107 /**
55108  * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
55109  */
55110 const uint8_t (*ReceiveTlvs_get_payment_secret(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr))[32];
55111
55112 /**
55113  * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
55114  */
55115 void ReceiveTlvs_set_payment_secret(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
55116
55117 /**
55118  * Constraints for the receiver of this payment.
55119  */
55120 struct LDKPaymentConstraints ReceiveTlvs_get_payment_constraints(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
55121
55122 /**
55123  * Constraints for the receiver of this payment.
55124  */
55125 void ReceiveTlvs_set_payment_constraints(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
55126
55127 /**
55128  * Context for the receiver of this payment.
55129  */
55130 struct LDKPaymentContext ReceiveTlvs_get_payment_context(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
55131
55132 /**
55133  * Context for the receiver of this payment.
55134  */
55135 void ReceiveTlvs_set_payment_context(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentContext val);
55136
55137 /**
55138  * Constructs a new ReceiveTlvs given each field
55139  */
55140 MUST_USE_RES struct LDKReceiveTlvs ReceiveTlvs_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKPaymentConstraints payment_constraints_arg, struct LDKPaymentContext payment_context_arg);
55141
55142 /**
55143  * Creates a copy of the ReceiveTlvs
55144  */
55145 struct LDKReceiveTlvs ReceiveTlvs_clone(const struct LDKReceiveTlvs *NONNULL_PTR orig);
55146
55147 /**
55148  * Frees any resources used by the PaymentRelay, if is_owned is set and inner is non-NULL.
55149  */
55150 void PaymentRelay_free(struct LDKPaymentRelay this_obj);
55151
55152 /**
55153  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
55154  */
55155 uint16_t PaymentRelay_get_cltv_expiry_delta(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
55156
55157 /**
55158  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
55159  */
55160 void PaymentRelay_set_cltv_expiry_delta(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint16_t val);
55161
55162 /**
55163  * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
55164  * this [`BlindedHop`], (i.e., 10,000 is 1%).
55165  */
55166 uint32_t PaymentRelay_get_fee_proportional_millionths(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
55167
55168 /**
55169  * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
55170  * this [`BlindedHop`], (i.e., 10,000 is 1%).
55171  */
55172 void PaymentRelay_set_fee_proportional_millionths(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
55173
55174 /**
55175  * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
55176  */
55177 uint32_t PaymentRelay_get_fee_base_msat(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
55178
55179 /**
55180  * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
55181  */
55182 void PaymentRelay_set_fee_base_msat(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
55183
55184 /**
55185  * Constructs a new PaymentRelay given each field
55186  */
55187 MUST_USE_RES struct LDKPaymentRelay PaymentRelay_new(uint16_t cltv_expiry_delta_arg, uint32_t fee_proportional_millionths_arg, uint32_t fee_base_msat_arg);
55188
55189 /**
55190  * Creates a copy of the PaymentRelay
55191  */
55192 struct LDKPaymentRelay PaymentRelay_clone(const struct LDKPaymentRelay *NONNULL_PTR orig);
55193
55194 /**
55195  * Frees any resources used by the PaymentConstraints, if is_owned is set and inner is non-NULL.
55196  */
55197 void PaymentConstraints_free(struct LDKPaymentConstraints this_obj);
55198
55199 /**
55200  * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
55201  */
55202 uint32_t PaymentConstraints_get_max_cltv_expiry(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
55203
55204 /**
55205  * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
55206  */
55207 void PaymentConstraints_set_max_cltv_expiry(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint32_t val);
55208
55209 /**
55210  * The minimum value, in msat, that may be accepted by the node corresponding to this
55211  * [`BlindedHop`].
55212  */
55213 uint64_t PaymentConstraints_get_htlc_minimum_msat(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
55214
55215 /**
55216  * The minimum value, in msat, that may be accepted by the node corresponding to this
55217  * [`BlindedHop`].
55218  */
55219 void PaymentConstraints_set_htlc_minimum_msat(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint64_t val);
55220
55221 /**
55222  * Constructs a new PaymentConstraints given each field
55223  */
55224 MUST_USE_RES struct LDKPaymentConstraints PaymentConstraints_new(uint32_t max_cltv_expiry_arg, uint64_t htlc_minimum_msat_arg);
55225
55226 /**
55227  * Creates a copy of the PaymentConstraints
55228  */
55229 struct LDKPaymentConstraints PaymentConstraints_clone(const struct LDKPaymentConstraints *NONNULL_PTR orig);
55230
55231 /**
55232  * Frees any resources used by the PaymentContext
55233  */
55234 void PaymentContext_free(struct LDKPaymentContext this_ptr);
55235
55236 /**
55237  * Creates a copy of the PaymentContext
55238  */
55239 struct LDKPaymentContext PaymentContext_clone(const struct LDKPaymentContext *NONNULL_PTR orig);
55240
55241 /**
55242  * Utility method to constructs a new Unknown-variant PaymentContext
55243  */
55244 struct LDKPaymentContext PaymentContext_unknown(struct LDKUnknownPaymentContext a);
55245
55246 /**
55247  * Utility method to constructs a new Bolt12Offer-variant PaymentContext
55248  */
55249 struct LDKPaymentContext PaymentContext_bolt12_offer(struct LDKBolt12OfferContext a);
55250
55251 /**
55252  * Utility method to constructs a new Bolt12Refund-variant PaymentContext
55253  */
55254 struct LDKPaymentContext PaymentContext_bolt12_refund(struct LDKBolt12RefundContext a);
55255
55256 /**
55257  * Checks if two PaymentContexts contain equal inner contents.
55258  * This ignores pointers and is_owned flags and looks at the values in fields.
55259  */
55260 bool PaymentContext_eq(const struct LDKPaymentContext *NONNULL_PTR a, const struct LDKPaymentContext *NONNULL_PTR b);
55261
55262 /**
55263  * Frees any resources used by the UnknownPaymentContext, if is_owned is set and inner is non-NULL.
55264  */
55265 void UnknownPaymentContext_free(struct LDKUnknownPaymentContext this_obj);
55266
55267 /**
55268  * Creates a copy of the UnknownPaymentContext
55269  */
55270 struct LDKUnknownPaymentContext UnknownPaymentContext_clone(const struct LDKUnknownPaymentContext *NONNULL_PTR orig);
55271
55272 /**
55273  * Checks if two UnknownPaymentContexts contain equal inner contents.
55274  * This ignores pointers and is_owned flags and looks at the values in fields.
55275  * Two objects with NULL inner values will be considered "equal" here.
55276  */
55277 bool UnknownPaymentContext_eq(const struct LDKUnknownPaymentContext *NONNULL_PTR a, const struct LDKUnknownPaymentContext *NONNULL_PTR b);
55278
55279 /**
55280  * Frees any resources used by the Bolt12OfferContext, if is_owned is set and inner is non-NULL.
55281  */
55282 void Bolt12OfferContext_free(struct LDKBolt12OfferContext this_obj);
55283
55284 /**
55285  * The identifier of the [`Offer`].
55286  *
55287  * [`Offer`]: crate::offers::offer::Offer
55288  */
55289 struct LDKOfferId Bolt12OfferContext_get_offer_id(const struct LDKBolt12OfferContext *NONNULL_PTR this_ptr);
55290
55291 /**
55292  * The identifier of the [`Offer`].
55293  *
55294  * [`Offer`]: crate::offers::offer::Offer
55295  */
55296 void Bolt12OfferContext_set_offer_id(struct LDKBolt12OfferContext *NONNULL_PTR this_ptr, struct LDKOfferId val);
55297
55298 /**
55299  * Fields from an [`InvoiceRequest`] sent for a [`Bolt12Invoice`].
55300  *
55301  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
55302  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
55303  */
55304 struct LDKInvoiceRequestFields Bolt12OfferContext_get_invoice_request(const struct LDKBolt12OfferContext *NONNULL_PTR this_ptr);
55305
55306 /**
55307  * Fields from an [`InvoiceRequest`] sent for a [`Bolt12Invoice`].
55308  *
55309  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
55310  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
55311  */
55312 void Bolt12OfferContext_set_invoice_request(struct LDKBolt12OfferContext *NONNULL_PTR this_ptr, struct LDKInvoiceRequestFields val);
55313
55314 /**
55315  * Constructs a new Bolt12OfferContext given each field
55316  */
55317 MUST_USE_RES struct LDKBolt12OfferContext Bolt12OfferContext_new(struct LDKOfferId offer_id_arg, struct LDKInvoiceRequestFields invoice_request_arg);
55318
55319 /**
55320  * Creates a copy of the Bolt12OfferContext
55321  */
55322 struct LDKBolt12OfferContext Bolt12OfferContext_clone(const struct LDKBolt12OfferContext *NONNULL_PTR orig);
55323
55324 /**
55325  * Checks if two Bolt12OfferContexts contain equal inner contents.
55326  * This ignores pointers and is_owned flags and looks at the values in fields.
55327  * Two objects with NULL inner values will be considered "equal" here.
55328  */
55329 bool Bolt12OfferContext_eq(const struct LDKBolt12OfferContext *NONNULL_PTR a, const struct LDKBolt12OfferContext *NONNULL_PTR b);
55330
55331 /**
55332  * Frees any resources used by the Bolt12RefundContext, if is_owned is set and inner is non-NULL.
55333  */
55334 void Bolt12RefundContext_free(struct LDKBolt12RefundContext this_obj);
55335
55336 /**
55337  * Constructs a new Bolt12RefundContext given each field
55338  */
55339 MUST_USE_RES struct LDKBolt12RefundContext Bolt12RefundContext_new(void);
55340
55341 /**
55342  * Creates a copy of the Bolt12RefundContext
55343  */
55344 struct LDKBolt12RefundContext Bolt12RefundContext_clone(const struct LDKBolt12RefundContext *NONNULL_PTR orig);
55345
55346 /**
55347  * Checks if two Bolt12RefundContexts contain equal inner contents.
55348  * This ignores pointers and is_owned flags and looks at the values in fields.
55349  * Two objects with NULL inner values will be considered "equal" here.
55350  */
55351 bool Bolt12RefundContext_eq(const struct LDKBolt12RefundContext *NONNULL_PTR a, const struct LDKBolt12RefundContext *NONNULL_PTR b);
55352
55353 /**
55354  * Serialize the ForwardTlvs object into a byte array which can be read by ForwardTlvs_read
55355  */
55356 struct LDKCVec_u8Z ForwardTlvs_write(const struct LDKForwardTlvs *NONNULL_PTR obj);
55357
55358 /**
55359  * Serialize the ReceiveTlvs object into a byte array which can be read by ReceiveTlvs_read
55360  */
55361 struct LDKCVec_u8Z ReceiveTlvs_write(const struct LDKReceiveTlvs *NONNULL_PTR obj);
55362
55363 /**
55364  * Serialize the PaymentRelay object into a byte array which can be read by PaymentRelay_read
55365  */
55366 struct LDKCVec_u8Z PaymentRelay_write(const struct LDKPaymentRelay *NONNULL_PTR obj);
55367
55368 /**
55369  * Read a PaymentRelay from a byte array, created by PaymentRelay_write
55370  */
55371 struct LDKCResult_PaymentRelayDecodeErrorZ PaymentRelay_read(struct LDKu8slice ser);
55372
55373 /**
55374  * Serialize the PaymentConstraints object into a byte array which can be read by PaymentConstraints_read
55375  */
55376 struct LDKCVec_u8Z PaymentConstraints_write(const struct LDKPaymentConstraints *NONNULL_PTR obj);
55377
55378 /**
55379  * Read a PaymentConstraints from a byte array, created by PaymentConstraints_write
55380  */
55381 struct LDKCResult_PaymentConstraintsDecodeErrorZ PaymentConstraints_read(struct LDKu8slice ser);
55382
55383 /**
55384  * Serialize the PaymentContext object into a byte array which can be read by PaymentContext_read
55385  */
55386 struct LDKCVec_u8Z PaymentContext_write(const struct LDKPaymentContext *NONNULL_PTR obj);
55387
55388 /**
55389  * Read a PaymentContext from a byte array, created by PaymentContext_write
55390  */
55391 struct LDKCResult_PaymentContextDecodeErrorZ PaymentContext_read(struct LDKu8slice ser);
55392
55393 /**
55394  * Serialize the UnknownPaymentContext object into a byte array which can be read by UnknownPaymentContext_read
55395  */
55396 struct LDKCVec_u8Z UnknownPaymentContext_write(const struct LDKUnknownPaymentContext *NONNULL_PTR obj);
55397
55398 /**
55399  * Read a UnknownPaymentContext from a byte array, created by UnknownPaymentContext_write
55400  */
55401 struct LDKCResult_UnknownPaymentContextDecodeErrorZ UnknownPaymentContext_read(struct LDKu8slice ser);
55402
55403 /**
55404  * Serialize the Bolt12OfferContext object into a byte array which can be read by Bolt12OfferContext_read
55405  */
55406 struct LDKCVec_u8Z Bolt12OfferContext_write(const struct LDKBolt12OfferContext *NONNULL_PTR obj);
55407
55408 /**
55409  * Read a Bolt12OfferContext from a byte array, created by Bolt12OfferContext_write
55410  */
55411 struct LDKCResult_Bolt12OfferContextDecodeErrorZ Bolt12OfferContext_read(struct LDKu8slice ser);
55412
55413 /**
55414  * Serialize the Bolt12RefundContext object into a byte array which can be read by Bolt12RefundContext_read
55415  */
55416 struct LDKCVec_u8Z Bolt12RefundContext_write(const struct LDKBolt12RefundContext *NONNULL_PTR obj);
55417
55418 /**
55419  * Read a Bolt12RefundContext from a byte array, created by Bolt12RefundContext_write
55420  */
55421 struct LDKCResult_Bolt12RefundContextDecodeErrorZ Bolt12RefundContext_read(struct LDKu8slice ser);
55422
55423 /**
55424  * Frees any resources used by the PaymentPurpose
55425  */
55426 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
55427
55428 /**
55429  * Creates a copy of the PaymentPurpose
55430  */
55431 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
55432
55433 /**
55434  * Utility method to constructs a new Bolt11InvoicePayment-variant PaymentPurpose
55435  */
55436 struct LDKPaymentPurpose PaymentPurpose_bolt11_invoice_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret);
55437
55438 /**
55439  * Utility method to constructs a new Bolt12OfferPayment-variant PaymentPurpose
55440  */
55441 struct LDKPaymentPurpose PaymentPurpose_bolt12_offer_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret, struct LDKBolt12OfferContext payment_context);
55442
55443 /**
55444  * Utility method to constructs a new Bolt12RefundPayment-variant PaymentPurpose
55445  */
55446 struct LDKPaymentPurpose PaymentPurpose_bolt12_refund_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret, struct LDKBolt12RefundContext payment_context);
55447
55448 /**
55449  * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
55450  */
55451 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
55452
55453 /**
55454  * Checks if two PaymentPurposes contain equal inner contents.
55455  * This ignores pointers and is_owned flags and looks at the values in fields.
55456  */
55457 bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b);
55458
55459 /**
55460  * Returns the preimage for this payment, if it is known.
55461  */
55462 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ PaymentPurpose_preimage(const struct LDKPaymentPurpose *NONNULL_PTR this_arg);
55463
55464 /**
55465  * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
55466  */
55467 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
55468
55469 /**
55470  * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
55471  */
55472 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
55473
55474 /**
55475  * Frees any resources used by the ClaimedHTLC, if is_owned is set and inner is non-NULL.
55476  */
55477 void ClaimedHTLC_free(struct LDKClaimedHTLC this_obj);
55478
55479 /**
55480  * The `channel_id` of the channel over which the HTLC was received.
55481  */
55482 struct LDKChannelId ClaimedHTLC_get_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
55483
55484 /**
55485  * The `channel_id` of the channel over which the HTLC was received.
55486  */
55487 void ClaimedHTLC_set_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
55488
55489 /**
55490  * The `user_channel_id` of the channel over which the HTLC was received. This is the value
55491  * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
55492  * [`ChannelManager::accept_inbound_channel`] for inbound channels if
55493  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
55494  * `user_channel_id` will be randomized for an inbound channel.
55495  *
55496  * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
55497  * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
55498  * was not actually claimed until after upgrading.)
55499  *
55500  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
55501  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
55502  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
55503  */
55504 struct LDKU128 ClaimedHTLC_get_user_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
55505
55506 /**
55507  * The `user_channel_id` of the channel over which the HTLC was received. This is the value
55508  * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
55509  * [`ChannelManager::accept_inbound_channel`] for inbound channels if
55510  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
55511  * `user_channel_id` will be randomized for an inbound channel.
55512  *
55513  * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
55514  * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
55515  * was not actually claimed until after upgrading.)
55516  *
55517  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
55518  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
55519  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
55520  */
55521 void ClaimedHTLC_set_user_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKU128 val);
55522
55523 /**
55524  * The block height at which this HTLC expires.
55525  */
55526 uint32_t ClaimedHTLC_get_cltv_expiry(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
55527
55528 /**
55529  * The block height at which this HTLC expires.
55530  */
55531 void ClaimedHTLC_set_cltv_expiry(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint32_t val);
55532
55533 /**
55534  * The amount (in msats) of this part of an MPP.
55535  */
55536 uint64_t ClaimedHTLC_get_value_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
55537
55538 /**
55539  * The amount (in msats) of this part of an MPP.
55540  */
55541 void ClaimedHTLC_set_value_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
55542
55543 /**
55544  * The extra fee our counterparty skimmed off the top of this HTLC, if any.
55545  *
55546  * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
55547  * 0.0.119.
55548  */
55549 uint64_t ClaimedHTLC_get_counterparty_skimmed_fee_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
55550
55551 /**
55552  * The extra fee our counterparty skimmed off the top of this HTLC, if any.
55553  *
55554  * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
55555  * 0.0.119.
55556  */
55557 void ClaimedHTLC_set_counterparty_skimmed_fee_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
55558
55559 /**
55560  * Constructs a new ClaimedHTLC given each field
55561  */
55562 MUST_USE_RES struct LDKClaimedHTLC ClaimedHTLC_new(struct LDKChannelId channel_id_arg, struct LDKU128 user_channel_id_arg, uint32_t cltv_expiry_arg, uint64_t value_msat_arg, uint64_t counterparty_skimmed_fee_msat_arg);
55563
55564 /**
55565  * Creates a copy of the ClaimedHTLC
55566  */
55567 struct LDKClaimedHTLC ClaimedHTLC_clone(const struct LDKClaimedHTLC *NONNULL_PTR orig);
55568
55569 /**
55570  * Checks if two ClaimedHTLCs contain equal inner contents.
55571  * This ignores pointers and is_owned flags and looks at the values in fields.
55572  * Two objects with NULL inner values will be considered "equal" here.
55573  */
55574 bool ClaimedHTLC_eq(const struct LDKClaimedHTLC *NONNULL_PTR a, const struct LDKClaimedHTLC *NONNULL_PTR b);
55575
55576 /**
55577  * Serialize the ClaimedHTLC object into a byte array which can be read by ClaimedHTLC_read
55578  */
55579 struct LDKCVec_u8Z ClaimedHTLC_write(const struct LDKClaimedHTLC *NONNULL_PTR obj);
55580
55581 /**
55582  * Read a ClaimedHTLC from a byte array, created by ClaimedHTLC_write
55583  */
55584 struct LDKCResult_ClaimedHTLCDecodeErrorZ ClaimedHTLC_read(struct LDKu8slice ser);
55585
55586 /**
55587  * Frees any resources used by the PathFailure
55588  */
55589 void PathFailure_free(struct LDKPathFailure this_ptr);
55590
55591 /**
55592  * Creates a copy of the PathFailure
55593  */
55594 struct LDKPathFailure PathFailure_clone(const struct LDKPathFailure *NONNULL_PTR orig);
55595
55596 /**
55597  * Utility method to constructs a new InitialSend-variant PathFailure
55598  */
55599 struct LDKPathFailure PathFailure_initial_send(struct LDKAPIError err);
55600
55601 /**
55602  * Utility method to constructs a new OnPath-variant PathFailure
55603  */
55604 struct LDKPathFailure PathFailure_on_path(struct LDKCOption_NetworkUpdateZ network_update);
55605
55606 /**
55607  * Checks if two PathFailures contain equal inner contents.
55608  * This ignores pointers and is_owned flags and looks at the values in fields.
55609  */
55610 bool PathFailure_eq(const struct LDKPathFailure *NONNULL_PTR a, const struct LDKPathFailure *NONNULL_PTR b);
55611
55612 /**
55613  * Serialize the PathFailure object into a byte array which can be read by PathFailure_read
55614  */
55615 struct LDKCVec_u8Z PathFailure_write(const struct LDKPathFailure *NONNULL_PTR obj);
55616
55617 /**
55618  * Read a PathFailure from a byte array, created by PathFailure_write
55619  */
55620 struct LDKCResult_COption_PathFailureZDecodeErrorZ PathFailure_read(struct LDKu8slice ser);
55621
55622 /**
55623  * Frees any resources used by the ClosureReason
55624  */
55625 void ClosureReason_free(struct LDKClosureReason this_ptr);
55626
55627 /**
55628  * Creates a copy of the ClosureReason
55629  */
55630 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
55631
55632 /**
55633  * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
55634  */
55635 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg);
55636
55637 /**
55638  * Utility method to constructs a new HolderForceClosed-variant ClosureReason
55639  */
55640 struct LDKClosureReason ClosureReason_holder_force_closed(void);
55641
55642 /**
55643  * Utility method to constructs a new LegacyCooperativeClosure-variant ClosureReason
55644  */
55645 struct LDKClosureReason ClosureReason_legacy_cooperative_closure(void);
55646
55647 /**
55648  * Utility method to constructs a new CounterpartyInitiatedCooperativeClosure-variant ClosureReason
55649  */
55650 struct LDKClosureReason ClosureReason_counterparty_initiated_cooperative_closure(void);
55651
55652 /**
55653  * Utility method to constructs a new LocallyInitiatedCooperativeClosure-variant ClosureReason
55654  */
55655 struct LDKClosureReason ClosureReason_locally_initiated_cooperative_closure(void);
55656
55657 /**
55658  * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
55659  */
55660 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
55661
55662 /**
55663  * Utility method to constructs a new FundingTimedOut-variant ClosureReason
55664  */
55665 struct LDKClosureReason ClosureReason_funding_timed_out(void);
55666
55667 /**
55668  * Utility method to constructs a new ProcessingError-variant ClosureReason
55669  */
55670 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
55671
55672 /**
55673  * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
55674  */
55675 struct LDKClosureReason ClosureReason_disconnected_peer(void);
55676
55677 /**
55678  * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
55679  */
55680 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
55681
55682 /**
55683  * Utility method to constructs a new CounterpartyCoopClosedUnfundedChannel-variant ClosureReason
55684  */
55685 struct LDKClosureReason ClosureReason_counterparty_coop_closed_unfunded_channel(void);
55686
55687 /**
55688  * Utility method to constructs a new FundingBatchClosure-variant ClosureReason
55689  */
55690 struct LDKClosureReason ClosureReason_funding_batch_closure(void);
55691
55692 /**
55693  * Utility method to constructs a new HTLCsTimedOut-variant ClosureReason
55694  */
55695 struct LDKClosureReason ClosureReason_htlcs_timed_out(void);
55696
55697 /**
55698  * Checks if two ClosureReasons contain equal inner contents.
55699  * This ignores pointers and is_owned flags and looks at the values in fields.
55700  */
55701 bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
55702
55703 /**
55704  * Get the string representation of a ClosureReason object
55705  */
55706 struct LDKStr ClosureReason_to_str(const struct LDKClosureReason *NONNULL_PTR o);
55707
55708 /**
55709  * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
55710  */
55711 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
55712
55713 /**
55714  * Read a ClosureReason from a byte array, created by ClosureReason_write
55715  */
55716 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
55717
55718 /**
55719  * Frees any resources used by the HTLCDestination
55720  */
55721 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
55722
55723 /**
55724  * Creates a copy of the HTLCDestination
55725  */
55726 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
55727
55728 /**
55729  * Utility method to constructs a new NextHopChannel-variant HTLCDestination
55730  */
55731 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKChannelId channel_id);
55732
55733 /**
55734  * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
55735  */
55736 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
55737
55738 /**
55739  * Utility method to constructs a new InvalidForward-variant HTLCDestination
55740  */
55741 struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid);
55742
55743 /**
55744  * Utility method to constructs a new InvalidOnion-variant HTLCDestination
55745  */
55746 struct LDKHTLCDestination HTLCDestination_invalid_onion(void);
55747
55748 /**
55749  * Utility method to constructs a new FailedPayment-variant HTLCDestination
55750  */
55751 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
55752
55753 /**
55754  * Checks if two HTLCDestinations contain equal inner contents.
55755  * This ignores pointers and is_owned flags and looks at the values in fields.
55756  */
55757 bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
55758
55759 /**
55760  * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
55761  */
55762 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
55763
55764 /**
55765  * Read a HTLCDestination from a byte array, created by HTLCDestination_write
55766  */
55767 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
55768
55769 /**
55770  * Creates a copy of the PaymentFailureReason
55771  */
55772 enum LDKPaymentFailureReason PaymentFailureReason_clone(const enum LDKPaymentFailureReason *NONNULL_PTR orig);
55773
55774 /**
55775  * Utility method to constructs a new RecipientRejected-variant PaymentFailureReason
55776  */
55777 enum LDKPaymentFailureReason PaymentFailureReason_recipient_rejected(void);
55778
55779 /**
55780  * Utility method to constructs a new UserAbandoned-variant PaymentFailureReason
55781  */
55782 enum LDKPaymentFailureReason PaymentFailureReason_user_abandoned(void);
55783
55784 /**
55785  * Utility method to constructs a new RetriesExhausted-variant PaymentFailureReason
55786  */
55787 enum LDKPaymentFailureReason PaymentFailureReason_retries_exhausted(void);
55788
55789 /**
55790  * Utility method to constructs a new PaymentExpired-variant PaymentFailureReason
55791  */
55792 enum LDKPaymentFailureReason PaymentFailureReason_payment_expired(void);
55793
55794 /**
55795  * Utility method to constructs a new RouteNotFound-variant PaymentFailureReason
55796  */
55797 enum LDKPaymentFailureReason PaymentFailureReason_route_not_found(void);
55798
55799 /**
55800  * Utility method to constructs a new UnexpectedError-variant PaymentFailureReason
55801  */
55802 enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void);
55803
55804 /**
55805  * Checks if two PaymentFailureReasons contain equal inner contents.
55806  * This ignores pointers and is_owned flags and looks at the values in fields.
55807  */
55808 bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b);
55809
55810 /**
55811  * Serialize the PaymentFailureReason object into a byte array which can be read by PaymentFailureReason_read
55812  */
55813 struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj);
55814
55815 /**
55816  * Read a PaymentFailureReason from a byte array, created by PaymentFailureReason_write
55817  */
55818 struct LDKCResult_PaymentFailureReasonDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser);
55819
55820 /**
55821  * Frees any resources used by the Event
55822  */
55823 void Event_free(struct LDKEvent this_ptr);
55824
55825 /**
55826  * Creates a copy of the Event
55827  */
55828 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
55829
55830 /**
55831  * Utility method to constructs a new FundingGenerationReady-variant Event
55832  */
55833 struct LDKEvent Event_funding_generation_ready(struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, struct LDKU128 user_channel_id);
55834
55835 /**
55836  * Utility method to constructs a new PaymentClaimable-variant Event
55837  */
55838 struct LDKEvent Event_payment_claimable(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields onion_fields, uint64_t amount_msat, uint64_t counterparty_skimmed_fee_msat, struct LDKPaymentPurpose purpose, struct LDKChannelId via_channel_id, struct LDKCOption_U128Z via_user_channel_id, struct LDKCOption_u32Z claim_deadline);
55839
55840 /**
55841  * Utility method to constructs a new PaymentClaimed-variant Event
55842  */
55843 struct LDKEvent Event_payment_claimed(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose, struct LDKCVec_ClaimedHTLCZ htlcs, struct LDKCOption_u64Z sender_intended_total_msat);
55844
55845 /**
55846  * Utility method to constructs a new ConnectionNeeded-variant Event
55847  */
55848 struct LDKEvent Event_connection_needed(struct LDKPublicKey node_id, struct LDKCVec_SocketAddressZ addresses);
55849
55850 /**
55851  * Utility method to constructs a new InvoiceRequestFailed-variant Event
55852  */
55853 struct LDKEvent Event_invoice_request_failed(struct LDKThirtyTwoBytes payment_id);
55854
55855 /**
55856  * Utility method to constructs a new PaymentSent-variant Event
55857  */
55858 struct LDKEvent Event_payment_sent(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
55859
55860 /**
55861  * Utility method to constructs a new PaymentFailed-variant Event
55862  */
55863 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_PaymentFailureReasonZ reason);
55864
55865 /**
55866  * Utility method to constructs a new PaymentPathSuccessful-variant Event
55867  */
55868 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKPath path);
55869
55870 /**
55871  * Utility method to constructs a new PaymentPathFailed-variant Event
55872  */
55873 struct LDKEvent Event_payment_path_failed(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_hash, bool payment_failed_permanently, struct LDKPathFailure failure, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
55874
55875 /**
55876  * Utility method to constructs a new ProbeSuccessful-variant Event
55877  */
55878 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path);
55879
55880 /**
55881  * Utility method to constructs a new ProbeFailed-variant Event
55882  */
55883 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
55884
55885 /**
55886  * Utility method to constructs a new PendingHTLCsForwardable-variant Event
55887  */
55888 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
55889
55890 /**
55891  * Utility method to constructs a new HTLCIntercepted-variant Event
55892  */
55893 struct LDKEvent Event_htlcintercepted(struct LDKThirtyTwoBytes intercept_id, uint64_t requested_next_hop_scid, struct LDKThirtyTwoBytes payment_hash, uint64_t inbound_amount_msat, uint64_t expected_outbound_amount_msat);
55894
55895 /**
55896  * Utility method to constructs a new SpendableOutputs-variant Event
55897  */
55898 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs, struct LDKChannelId channel_id);
55899
55900 /**
55901  * Utility method to constructs a new PaymentForwarded-variant Event
55902  */
55903 struct LDKEvent Event_payment_forwarded(struct LDKChannelId prev_channel_id, struct LDKChannelId next_channel_id, struct LDKCOption_U128Z prev_user_channel_id, struct LDKCOption_U128Z next_user_channel_id, struct LDKCOption_u64Z total_fee_earned_msat, struct LDKCOption_u64Z skimmed_fee_msat, bool claim_from_onchain_tx, struct LDKCOption_u64Z outbound_amount_forwarded_msat);
55904
55905 /**
55906  * Utility method to constructs a new ChannelPending-variant Event
55907  */
55908 struct LDKEvent Event_channel_pending(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKChannelId former_temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding_txo, struct LDKChannelTypeFeatures channel_type);
55909
55910 /**
55911  * Utility method to constructs a new ChannelReady-variant Event
55912  */
55913 struct LDKEvent Event_channel_ready(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type);
55914
55915 /**
55916  * Utility method to constructs a new ChannelClosed-variant Event
55917  */
55918 struct LDKEvent Event_channel_closed(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKClosureReason reason, struct LDKPublicKey counterparty_node_id, struct LDKCOption_u64Z channel_capacity_sats, struct LDKOutPoint channel_funding_txo);
55919
55920 /**
55921  * Utility method to constructs a new DiscardFunding-variant Event
55922  */
55923 struct LDKEvent Event_discard_funding(struct LDKChannelId channel_id, struct LDKTransaction transaction);
55924
55925 /**
55926  * Utility method to constructs a new OpenChannelRequest-variant Event
55927  */
55928 struct LDKEvent Event_open_channel_request(struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, uint64_t push_msat, struct LDKChannelTypeFeatures channel_type);
55929
55930 /**
55931  * Utility method to constructs a new HTLCHandlingFailed-variant Event
55932  */
55933 struct LDKEvent Event_htlchandling_failed(struct LDKChannelId prev_channel_id, struct LDKHTLCDestination failed_next_destination);
55934
55935 /**
55936  * Utility method to constructs a new BumpTransaction-variant Event
55937  */
55938 struct LDKEvent Event_bump_transaction(struct LDKBumpTransactionEvent a);
55939
55940 /**
55941  * Checks if two Events contain equal inner contents.
55942  * This ignores pointers and is_owned flags and looks at the values in fields.
55943  */
55944 bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b);
55945
55946 /**
55947  * Serialize the Event object into a byte array which can be read by Event_read
55948  */
55949 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
55950
55951 /**
55952  * Read a Event from a byte array, created by Event_write
55953  */
55954 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
55955
55956 /**
55957  * Frees any resources used by the MessageSendEvent
55958  */
55959 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
55960
55961 /**
55962  * Creates a copy of the MessageSendEvent
55963  */
55964 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
55965
55966 /**
55967  * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
55968  */
55969 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
55970
55971 /**
55972  * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
55973  */
55974 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel_v2(struct LDKPublicKey node_id, struct LDKAcceptChannelV2 msg);
55975
55976 /**
55977  * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
55978  */
55979 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
55980
55981 /**
55982  * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
55983  */
55984 struct LDKMessageSendEvent MessageSendEvent_send_open_channel_v2(struct LDKPublicKey node_id, struct LDKOpenChannelV2 msg);
55985
55986 /**
55987  * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
55988  */
55989 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
55990
55991 /**
55992  * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
55993  */
55994 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
55995
55996 /**
55997  * Utility method to constructs a new SendStfu-variant MessageSendEvent
55998  */
55999 struct LDKMessageSendEvent MessageSendEvent_send_stfu(struct LDKPublicKey node_id, struct LDKStfu msg);
56000
56001 /**
56002  * Utility method to constructs a new SendSplice-variant MessageSendEvent
56003  */
56004 struct LDKMessageSendEvent MessageSendEvent_send_splice(struct LDKPublicKey node_id, struct LDKSplice msg);
56005
56006 /**
56007  * Utility method to constructs a new SendSpliceAck-variant MessageSendEvent
56008  */
56009 struct LDKMessageSendEvent MessageSendEvent_send_splice_ack(struct LDKPublicKey node_id, struct LDKSpliceAck msg);
56010
56011 /**
56012  * Utility method to constructs a new SendSpliceLocked-variant MessageSendEvent
56013  */
56014 struct LDKMessageSendEvent MessageSendEvent_send_splice_locked(struct LDKPublicKey node_id, struct LDKSpliceLocked msg);
56015
56016 /**
56017  * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
56018  */
56019 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_input(struct LDKPublicKey node_id, struct LDKTxAddInput msg);
56020
56021 /**
56022  * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
56023  */
56024 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_output(struct LDKPublicKey node_id, struct LDKTxAddOutput msg);
56025
56026 /**
56027  * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
56028  */
56029 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_input(struct LDKPublicKey node_id, struct LDKTxRemoveInput msg);
56030
56031 /**
56032  * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
56033  */
56034 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_output(struct LDKPublicKey node_id, struct LDKTxRemoveOutput msg);
56035
56036 /**
56037  * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
56038  */
56039 struct LDKMessageSendEvent MessageSendEvent_send_tx_complete(struct LDKPublicKey node_id, struct LDKTxComplete msg);
56040
56041 /**
56042  * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
56043  */
56044 struct LDKMessageSendEvent MessageSendEvent_send_tx_signatures(struct LDKPublicKey node_id, struct LDKTxSignatures msg);
56045
56046 /**
56047  * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
56048  */
56049 struct LDKMessageSendEvent MessageSendEvent_send_tx_init_rbf(struct LDKPublicKey node_id, struct LDKTxInitRbf msg);
56050
56051 /**
56052  * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
56053  */
56054 struct LDKMessageSendEvent MessageSendEvent_send_tx_ack_rbf(struct LDKPublicKey node_id, struct LDKTxAckRbf msg);
56055
56056 /**
56057  * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
56058  */
56059 struct LDKMessageSendEvent MessageSendEvent_send_tx_abort(struct LDKPublicKey node_id, struct LDKTxAbort msg);
56060
56061 /**
56062  * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
56063  */
56064 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
56065
56066 /**
56067  * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
56068  */
56069 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
56070
56071 /**
56072  * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
56073  */
56074 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
56075
56076 /**
56077  * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
56078  */
56079 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
56080
56081 /**
56082  * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
56083  */
56084 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
56085
56086 /**
56087  * Utility method to constructs a new SendShutdown-variant MessageSendEvent
56088  */
56089 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
56090
56091 /**
56092  * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
56093  */
56094 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
56095
56096 /**
56097  * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
56098  */
56099 struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
56100
56101 /**
56102  * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
56103  */
56104 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
56105
56106 /**
56107  * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
56108  */
56109 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
56110
56111 /**
56112  * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
56113  */
56114 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
56115
56116 /**
56117  * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
56118  */
56119 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
56120
56121 /**
56122  * Utility method to constructs a new HandleError-variant MessageSendEvent
56123  */
56124 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
56125
56126 /**
56127  * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
56128  */
56129 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
56130
56131 /**
56132  * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
56133  */
56134 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
56135
56136 /**
56137  * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
56138  */
56139 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
56140
56141 /**
56142  * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
56143  */
56144 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
56145
56146 /**
56147  * Calls the free function if one is set
56148  */
56149 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
56150
56151 /**
56152  * Calls the free function if one is set
56153  */
56154 void EventsProvider_free(struct LDKEventsProvider this_ptr);
56155
56156 /**
56157  * Calls the free function if one is set
56158  */
56159 void EventHandler_free(struct LDKEventHandler this_ptr);
56160
56161 /**
56162  * Frees any resources used by the AnchorDescriptor, if is_owned is set and inner is non-NULL.
56163  */
56164 void AnchorDescriptor_free(struct LDKAnchorDescriptor this_obj);
56165
56166 /**
56167  * The parameters required to derive the signer for the anchor input.
56168  */
56169 struct LDKChannelDerivationParameters AnchorDescriptor_get_channel_derivation_parameters(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
56170
56171 /**
56172  * The parameters required to derive the signer for the anchor input.
56173  */
56174 void AnchorDescriptor_set_channel_derivation_parameters(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
56175
56176 /**
56177  * The transaction input's outpoint corresponding to the commitment transaction's anchor
56178  * output.
56179  */
56180 struct LDKOutPoint AnchorDescriptor_get_outpoint(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
56181
56182 /**
56183  * The transaction input's outpoint corresponding to the commitment transaction's anchor
56184  * output.
56185  */
56186 void AnchorDescriptor_set_outpoint(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
56187
56188 /**
56189  * Constructs a new AnchorDescriptor given each field
56190  */
56191 MUST_USE_RES struct LDKAnchorDescriptor AnchorDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKOutPoint outpoint_arg);
56192
56193 /**
56194  * Creates a copy of the AnchorDescriptor
56195  */
56196 struct LDKAnchorDescriptor AnchorDescriptor_clone(const struct LDKAnchorDescriptor *NONNULL_PTR orig);
56197
56198 /**
56199  * Checks if two AnchorDescriptors contain equal inner contents.
56200  * This ignores pointers and is_owned flags and looks at the values in fields.
56201  * Two objects with NULL inner values will be considered "equal" here.
56202  */
56203 bool AnchorDescriptor_eq(const struct LDKAnchorDescriptor *NONNULL_PTR a, const struct LDKAnchorDescriptor *NONNULL_PTR b);
56204
56205 /**
56206  * Returns the UTXO to be spent by the anchor input, which can be obtained via
56207  * [`Self::unsigned_tx_input`].
56208  */
56209 MUST_USE_RES struct LDKTxOut AnchorDescriptor_previous_utxo(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
56210
56211 /**
56212  * Returns the unsigned transaction input spending the anchor output in the commitment
56213  * transaction.
56214  */
56215 MUST_USE_RES struct LDKTxIn AnchorDescriptor_unsigned_tx_input(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
56216
56217 /**
56218  * Returns the witness script of the anchor output in the commitment transaction.
56219  */
56220 MUST_USE_RES struct LDKCVec_u8Z AnchorDescriptor_witness_script(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
56221
56222 /**
56223  * Returns the fully signed witness required to spend the anchor output in the commitment
56224  * transaction.
56225  */
56226 MUST_USE_RES struct LDKWitness AnchorDescriptor_tx_input_witness(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature);
56227
56228 /**
56229  * Derives the channel signer required to sign the anchor input.
56230  */
56231 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
56232
56233 /**
56234  * Frees any resources used by the BumpTransactionEvent
56235  */
56236 void BumpTransactionEvent_free(struct LDKBumpTransactionEvent this_ptr);
56237
56238 /**
56239  * Creates a copy of the BumpTransactionEvent
56240  */
56241 struct LDKBumpTransactionEvent BumpTransactionEvent_clone(const struct LDKBumpTransactionEvent *NONNULL_PTR orig);
56242
56243 /**
56244  * Utility method to constructs a new ChannelClose-variant BumpTransactionEvent
56245  */
56246 struct LDKBumpTransactionEvent BumpTransactionEvent_channel_close(struct LDKChannelId channel_id, struct LDKPublicKey counterparty_node_id, struct LDKThirtyTwoBytes claim_id, uint32_t package_target_feerate_sat_per_1000_weight, struct LDKTransaction commitment_tx, uint64_t commitment_tx_fee_satoshis, struct LDKAnchorDescriptor anchor_descriptor, struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs);
56247
56248 /**
56249  * Utility method to constructs a new HTLCResolution-variant BumpTransactionEvent
56250  */
56251 struct LDKBumpTransactionEvent BumpTransactionEvent_htlcresolution(struct LDKChannelId channel_id, struct LDKPublicKey counterparty_node_id, struct LDKThirtyTwoBytes claim_id, uint32_t target_feerate_sat_per_1000_weight, struct LDKCVec_HTLCDescriptorZ htlc_descriptors, uint32_t tx_lock_time);
56252
56253 /**
56254  * Checks if two BumpTransactionEvents contain equal inner contents.
56255  * This ignores pointers and is_owned flags and looks at the values in fields.
56256  */
56257 bool BumpTransactionEvent_eq(const struct LDKBumpTransactionEvent *NONNULL_PTR a, const struct LDKBumpTransactionEvent *NONNULL_PTR b);
56258
56259 /**
56260  * Frees any resources used by the Input, if is_owned is set and inner is non-NULL.
56261  */
56262 void Input_free(struct LDKInput this_obj);
56263
56264 /**
56265  * The unique identifier of the input.
56266  */
56267 struct LDKOutPoint Input_get_outpoint(const struct LDKInput *NONNULL_PTR this_ptr);
56268
56269 /**
56270  * The unique identifier of the input.
56271  */
56272 void Input_set_outpoint(struct LDKInput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
56273
56274 /**
56275  * The UTXO being spent by the input.
56276  */
56277 struct LDKTxOut Input_get_previous_utxo(const struct LDKInput *NONNULL_PTR this_ptr);
56278
56279 /**
56280  * The UTXO being spent by the input.
56281  */
56282 void Input_set_previous_utxo(struct LDKInput *NONNULL_PTR this_ptr, struct LDKTxOut val);
56283
56284 /**
56285  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
56286  * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
56287  * script.
56288  */
56289 uint64_t Input_get_satisfaction_weight(const struct LDKInput *NONNULL_PTR this_ptr);
56290
56291 /**
56292  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
56293  * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
56294  * script.
56295  */
56296 void Input_set_satisfaction_weight(struct LDKInput *NONNULL_PTR this_ptr, uint64_t val);
56297
56298 /**
56299  * Constructs a new Input given each field
56300  */
56301 MUST_USE_RES struct LDKInput Input_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut previous_utxo_arg, uint64_t satisfaction_weight_arg);
56302
56303 /**
56304  * Creates a copy of the Input
56305  */
56306 struct LDKInput Input_clone(const struct LDKInput *NONNULL_PTR orig);
56307
56308 /**
56309  * Generates a non-cryptographic 64-bit hash of the Input.
56310  */
56311 uint64_t Input_hash(const struct LDKInput *NONNULL_PTR o);
56312
56313 /**
56314  * Checks if two Inputs contain equal inner contents.
56315  * This ignores pointers and is_owned flags and looks at the values in fields.
56316  * Two objects with NULL inner values will be considered "equal" here.
56317  */
56318 bool Input_eq(const struct LDKInput *NONNULL_PTR a, const struct LDKInput *NONNULL_PTR b);
56319
56320 /**
56321  * Frees any resources used by the Utxo, if is_owned is set and inner is non-NULL.
56322  */
56323 void Utxo_free(struct LDKUtxo this_obj);
56324
56325 /**
56326  * The unique identifier of the output.
56327  */
56328 struct LDKOutPoint Utxo_get_outpoint(const struct LDKUtxo *NONNULL_PTR this_ptr);
56329
56330 /**
56331  * The unique identifier of the output.
56332  */
56333 void Utxo_set_outpoint(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKOutPoint val);
56334
56335 /**
56336  * The output to spend.
56337  */
56338 struct LDKTxOut Utxo_get_output(const struct LDKUtxo *NONNULL_PTR this_ptr);
56339
56340 /**
56341  * The output to spend.
56342  */
56343 void Utxo_set_output(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKTxOut val);
56344
56345 /**
56346  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
56347  * with their lengths included, required to satisfy the output's script. The weight consumed by
56348  * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
56349  */
56350 uint64_t Utxo_get_satisfaction_weight(const struct LDKUtxo *NONNULL_PTR this_ptr);
56351
56352 /**
56353  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
56354  * with their lengths included, required to satisfy the output's script. The weight consumed by
56355  * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
56356  */
56357 void Utxo_set_satisfaction_weight(struct LDKUtxo *NONNULL_PTR this_ptr, uint64_t val);
56358
56359 /**
56360  * Constructs a new Utxo given each field
56361  */
56362 MUST_USE_RES struct LDKUtxo Utxo_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, uint64_t satisfaction_weight_arg);
56363
56364 /**
56365  * Creates a copy of the Utxo
56366  */
56367 struct LDKUtxo Utxo_clone(const struct LDKUtxo *NONNULL_PTR orig);
56368
56369 /**
56370  * Generates a non-cryptographic 64-bit hash of the Utxo.
56371  */
56372 uint64_t Utxo_hash(const struct LDKUtxo *NONNULL_PTR o);
56373
56374 /**
56375  * Checks if two Utxos contain equal inner contents.
56376  * This ignores pointers and is_owned flags and looks at the values in fields.
56377  * Two objects with NULL inner values will be considered "equal" here.
56378  */
56379 bool Utxo_eq(const struct LDKUtxo *NONNULL_PTR a, const struct LDKUtxo *NONNULL_PTR b);
56380
56381 /**
56382  * Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output.
56383  */
56384 MUST_USE_RES struct LDKUtxo Utxo_new_p2pkh(struct LDKOutPoint outpoint, uint64_t value, const uint8_t (*pubkey_hash)[20]);
56385
56386 /**
56387  * Frees any resources used by the CoinSelection, if is_owned is set and inner is non-NULL.
56388  */
56389 void CoinSelection_free(struct LDKCoinSelection this_obj);
56390
56391 /**
56392  * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
56393  * requiring additional fees.
56394  */
56395 struct LDKCVec_UtxoZ CoinSelection_get_confirmed_utxos(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
56396
56397 /**
56398  * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
56399  * requiring additional fees.
56400  */
56401 void CoinSelection_set_confirmed_utxos(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCVec_UtxoZ val);
56402
56403 /**
56404  * An additional output tracking whether any change remained after coin selection. This output
56405  * should always have a value above dust for its given `script_pubkey`. It should not be
56406  * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
56407  * not met. This implies no other party should be able to spend it except us.
56408  */
56409 struct LDKCOption_TxOutZ CoinSelection_get_change_output(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
56410
56411 /**
56412  * An additional output tracking whether any change remained after coin selection. This output
56413  * should always have a value above dust for its given `script_pubkey`. It should not be
56414  * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
56415  * not met. This implies no other party should be able to spend it except us.
56416  */
56417 void CoinSelection_set_change_output(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCOption_TxOutZ val);
56418
56419 /**
56420  * Constructs a new CoinSelection given each field
56421  */
56422 MUST_USE_RES struct LDKCoinSelection CoinSelection_new(struct LDKCVec_UtxoZ confirmed_utxos_arg, struct LDKCOption_TxOutZ change_output_arg);
56423
56424 /**
56425  * Creates a copy of the CoinSelection
56426  */
56427 struct LDKCoinSelection CoinSelection_clone(const struct LDKCoinSelection *NONNULL_PTR orig);
56428
56429 /**
56430  * Calls the free function if one is set
56431  */
56432 void CoinSelectionSource_free(struct LDKCoinSelectionSource this_ptr);
56433
56434 /**
56435  * Calls the free function if one is set
56436  */
56437 void WalletSource_free(struct LDKWalletSource this_ptr);
56438
56439 /**
56440  * Frees any resources used by the Wallet, if is_owned is set and inner is non-NULL.
56441  */
56442 void Wallet_free(struct LDKWallet this_obj);
56443
56444 /**
56445  * Returns a new instance backed by the given [`WalletSource`] that serves as an implementation
56446  * of [`CoinSelectionSource`].
56447  */
56448 MUST_USE_RES struct LDKWallet Wallet_new(struct LDKWalletSource source, struct LDKLogger logger);
56449
56450 /**
56451  * Constructs a new CoinSelectionSource which calls the relevant methods on this_arg.
56452  * This copies the `inner` pointer in this_arg and thus the returned CoinSelectionSource must be freed before this_arg is
56453  */
56454 struct LDKCoinSelectionSource Wallet_as_CoinSelectionSource(const struct LDKWallet *NONNULL_PTR this_arg);
56455
56456 /**
56457  * Frees any resources used by the BumpTransactionEventHandler, if is_owned is set and inner is non-NULL.
56458  */
56459 void BumpTransactionEventHandler_free(struct LDKBumpTransactionEventHandler this_obj);
56460
56461 /**
56462  * Returns a new instance capable of handling [`Event::BumpTransaction`] events.
56463  *
56464  * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
56465  */
56466 MUST_USE_RES struct LDKBumpTransactionEventHandler BumpTransactionEventHandler_new(struct LDKBroadcasterInterface broadcaster, struct LDKCoinSelectionSource utxo_source, struct LDKSignerProvider signer_provider, struct LDKLogger logger);
56467
56468 /**
56469  * Handles all variants of [`BumpTransactionEvent`].
56470  */
56471 void BumpTransactionEventHandler_handle_event(const struct LDKBumpTransactionEventHandler *NONNULL_PTR this_arg, const struct LDKBumpTransactionEvent *NONNULL_PTR event);
56472
56473 /**
56474  * Frees any resources used by the FilesystemStore, if is_owned is set and inner is non-NULL.
56475  */
56476 void FilesystemStore_free(struct LDKFilesystemStore this_obj);
56477
56478 /**
56479  * Constructs a new [`FilesystemStore`].
56480  */
56481 MUST_USE_RES struct LDKFilesystemStore FilesystemStore_new(struct LDKStr data_dir);
56482
56483 /**
56484  * Returns the data directory.
56485  */
56486 MUST_USE_RES struct LDKStr FilesystemStore_get_data_dir(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
56487
56488 /**
56489  * Constructs a new KVStore which calls the relevant methods on this_arg.
56490  * This copies the `inner` pointer in this_arg and thus the returned KVStore must be freed before this_arg is
56491  */
56492 struct LDKKVStore FilesystemStore_as_KVStore(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
56493
56494 /**
56495  * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
56496  */
56497 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
56498
56499 /**
56500  * Frees any resources used by the GossipSync
56501  */
56502 void GossipSync_free(struct LDKGossipSync this_ptr);
56503
56504 /**
56505  * Utility method to constructs a new P2P-variant GossipSync
56506  */
56507 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
56508
56509 /**
56510  * Utility method to constructs a new Rapid-variant GossipSync
56511  */
56512 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
56513
56514 /**
56515  * Utility method to constructs a new None-variant GossipSync
56516  */
56517 struct LDKGossipSync GossipSync_none(void);
56518
56519 /**
56520  * Start a background thread that takes care of responsibilities enumerated in the [top-level
56521  * documentation].
56522  *
56523  * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
56524  * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
56525  * either [`join`] or [`stop`].
56526  *
56527  * # Data Persistence
56528  *
56529  * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
56530  * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
56531  * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
56532  * provided implementation.
56533  *
56534  * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
56535  * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
56536  * See the `lightning-persister` crate for LDK's provided implementation.
56537  *
56538  * Typically, users should either implement [`Persister::persist_manager`] to never return an
56539  * error or call [`join`] and handle any error that may arise. For the latter case,
56540  * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
56541  *
56542  * # Event Handling
56543  *
56544  * `event_handler` is responsible for handling events that users should be notified of (e.g.,
56545  * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
56546  * functionality implemented by other handlers.
56547  * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
56548  *
56549  * # Rapid Gossip Sync
56550  *
56551  * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
56552  * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
56553  * until the [`RapidGossipSync`] instance completes its first sync.
56554  *
56555  * [top-level documentation]: BackgroundProcessor
56556  * [`join`]: Self::join
56557  * [`stop`]: Self::stop
56558  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
56559  * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
56560  * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
56561  * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
56562  * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
56563  * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
56564  */
56565 MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, struct LDKGossipSync gossip_sync, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger, struct LDKCOption_WriteableScoreZ scorer);
56566
56567 /**
56568  * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
56569  * [`ChannelManager`].
56570  *
56571  * # Panics
56572  *
56573  * This function panics if the background thread has panicked such as while persisting or
56574  * handling events.
56575  *
56576  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
56577  */
56578 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
56579
56580 /**
56581  * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
56582  * [`ChannelManager`].
56583  *
56584  * # Panics
56585  *
56586  * This function panics if the background thread has panicked such as while persisting or
56587  * handling events.
56588  *
56589  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
56590  */
56591 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
56592
56593 /**
56594  * Frees any resources used by the Bolt11ParseError
56595  */
56596 void Bolt11ParseError_free(struct LDKBolt11ParseError this_ptr);
56597
56598 /**
56599  * Creates a copy of the Bolt11ParseError
56600  */
56601 struct LDKBolt11ParseError Bolt11ParseError_clone(const struct LDKBolt11ParseError *NONNULL_PTR orig);
56602
56603 /**
56604  * Utility method to constructs a new Bech32Error-variant Bolt11ParseError
56605  */
56606 struct LDKBolt11ParseError Bolt11ParseError_bech32_error(struct LDKBech32Error a);
56607
56608 /**
56609  * Utility method to constructs a new ParseAmountError-variant Bolt11ParseError
56610  */
56611 struct LDKBolt11ParseError Bolt11ParseError_parse_amount_error(struct LDKError a);
56612
56613 /**
56614  * Utility method to constructs a new MalformedSignature-variant Bolt11ParseError
56615  */
56616 struct LDKBolt11ParseError Bolt11ParseError_malformed_signature(enum LDKSecp256k1Error a);
56617
56618 /**
56619  * Utility method to constructs a new BadPrefix-variant Bolt11ParseError
56620  */
56621 struct LDKBolt11ParseError Bolt11ParseError_bad_prefix(void);
56622
56623 /**
56624  * Utility method to constructs a new UnknownCurrency-variant Bolt11ParseError
56625  */
56626 struct LDKBolt11ParseError Bolt11ParseError_unknown_currency(void);
56627
56628 /**
56629  * Utility method to constructs a new UnknownSiPrefix-variant Bolt11ParseError
56630  */
56631 struct LDKBolt11ParseError Bolt11ParseError_unknown_si_prefix(void);
56632
56633 /**
56634  * Utility method to constructs a new MalformedHRP-variant Bolt11ParseError
56635  */
56636 struct LDKBolt11ParseError Bolt11ParseError_malformed_hrp(void);
56637
56638 /**
56639  * Utility method to constructs a new TooShortDataPart-variant Bolt11ParseError
56640  */
56641 struct LDKBolt11ParseError Bolt11ParseError_too_short_data_part(void);
56642
56643 /**
56644  * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant Bolt11ParseError
56645  */
56646 struct LDKBolt11ParseError Bolt11ParseError_unexpected_end_of_tagged_fields(void);
56647
56648 /**
56649  * Utility method to constructs a new DescriptionDecodeError-variant Bolt11ParseError
56650  */
56651 struct LDKBolt11ParseError Bolt11ParseError_description_decode_error(struct LDKError a);
56652
56653 /**
56654  * Utility method to constructs a new PaddingError-variant Bolt11ParseError
56655  */
56656 struct LDKBolt11ParseError Bolt11ParseError_padding_error(void);
56657
56658 /**
56659  * Utility method to constructs a new IntegerOverflowError-variant Bolt11ParseError
56660  */
56661 struct LDKBolt11ParseError Bolt11ParseError_integer_overflow_error(void);
56662
56663 /**
56664  * Utility method to constructs a new InvalidSegWitProgramLength-variant Bolt11ParseError
56665  */
56666 struct LDKBolt11ParseError Bolt11ParseError_invalid_seg_wit_program_length(void);
56667
56668 /**
56669  * Utility method to constructs a new InvalidPubKeyHashLength-variant Bolt11ParseError
56670  */
56671 struct LDKBolt11ParseError Bolt11ParseError_invalid_pub_key_hash_length(void);
56672
56673 /**
56674  * Utility method to constructs a new InvalidScriptHashLength-variant Bolt11ParseError
56675  */
56676 struct LDKBolt11ParseError Bolt11ParseError_invalid_script_hash_length(void);
56677
56678 /**
56679  * Utility method to constructs a new InvalidRecoveryId-variant Bolt11ParseError
56680  */
56681 struct LDKBolt11ParseError Bolt11ParseError_invalid_recovery_id(void);
56682
56683 /**
56684  * Utility method to constructs a new InvalidSliceLength-variant Bolt11ParseError
56685  */
56686 struct LDKBolt11ParseError Bolt11ParseError_invalid_slice_length(struct LDKStr a);
56687
56688 /**
56689  * Utility method to constructs a new Skip-variant Bolt11ParseError
56690  */
56691 struct LDKBolt11ParseError Bolt11ParseError_skip(void);
56692
56693 /**
56694  * Checks if two Bolt11ParseErrors contain equal inner contents.
56695  * This ignores pointers and is_owned flags and looks at the values in fields.
56696  */
56697 bool Bolt11ParseError_eq(const struct LDKBolt11ParseError *NONNULL_PTR a, const struct LDKBolt11ParseError *NONNULL_PTR b);
56698
56699 /**
56700  * Frees any resources used by the ParseOrSemanticError
56701  */
56702 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
56703
56704 /**
56705  * Creates a copy of the ParseOrSemanticError
56706  */
56707 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
56708
56709 /**
56710  * Utility method to constructs a new ParseError-variant ParseOrSemanticError
56711  */
56712 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKBolt11ParseError a);
56713
56714 /**
56715  * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
56716  */
56717 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKBolt11SemanticError a);
56718
56719 /**
56720  * Checks if two ParseOrSemanticErrors contain equal inner contents.
56721  * This ignores pointers and is_owned flags and looks at the values in fields.
56722  */
56723 bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b);
56724
56725 /**
56726  * Frees any resources used by the Bolt11Invoice, if is_owned is set and inner is non-NULL.
56727  */
56728 void Bolt11Invoice_free(struct LDKBolt11Invoice this_obj);
56729
56730 /**
56731  * Checks if two Bolt11Invoices contain equal inner contents.
56732  * This ignores pointers and is_owned flags and looks at the values in fields.
56733  * Two objects with NULL inner values will be considered "equal" here.
56734  */
56735 bool Bolt11Invoice_eq(const struct LDKBolt11Invoice *NONNULL_PTR a, const struct LDKBolt11Invoice *NONNULL_PTR b);
56736
56737 /**
56738  * Creates a copy of the Bolt11Invoice
56739  */
56740 struct LDKBolt11Invoice Bolt11Invoice_clone(const struct LDKBolt11Invoice *NONNULL_PTR orig);
56741
56742 /**
56743  * Generates a non-cryptographic 64-bit hash of the Bolt11Invoice.
56744  */
56745 uint64_t Bolt11Invoice_hash(const struct LDKBolt11Invoice *NONNULL_PTR o);
56746
56747 /**
56748  * Frees any resources used by the SignedRawBolt11Invoice, if is_owned is set and inner is non-NULL.
56749  */
56750 void SignedRawBolt11Invoice_free(struct LDKSignedRawBolt11Invoice this_obj);
56751
56752 /**
56753  * Checks if two SignedRawBolt11Invoices contain equal inner contents.
56754  * This ignores pointers and is_owned flags and looks at the values in fields.
56755  * Two objects with NULL inner values will be considered "equal" here.
56756  */
56757 bool SignedRawBolt11Invoice_eq(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR a, const struct LDKSignedRawBolt11Invoice *NONNULL_PTR b);
56758
56759 /**
56760  * Creates a copy of the SignedRawBolt11Invoice
56761  */
56762 struct LDKSignedRawBolt11Invoice SignedRawBolt11Invoice_clone(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR orig);
56763
56764 /**
56765  * Generates a non-cryptographic 64-bit hash of the SignedRawBolt11Invoice.
56766  */
56767 uint64_t SignedRawBolt11Invoice_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
56768
56769 /**
56770  * Frees any resources used by the RawBolt11Invoice, if is_owned is set and inner is non-NULL.
56771  */
56772 void RawBolt11Invoice_free(struct LDKRawBolt11Invoice this_obj);
56773
56774 /**
56775  * data part
56776  */
56777 struct LDKRawDataPart RawBolt11Invoice_get_data(const struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr);
56778
56779 /**
56780  * data part
56781  */
56782 void RawBolt11Invoice_set_data(struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
56783
56784 /**
56785  * Checks if two RawBolt11Invoices contain equal inner contents.
56786  * This ignores pointers and is_owned flags and looks at the values in fields.
56787  * Two objects with NULL inner values will be considered "equal" here.
56788  */
56789 bool RawBolt11Invoice_eq(const struct LDKRawBolt11Invoice *NONNULL_PTR a, const struct LDKRawBolt11Invoice *NONNULL_PTR b);
56790
56791 /**
56792  * Creates a copy of the RawBolt11Invoice
56793  */
56794 struct LDKRawBolt11Invoice RawBolt11Invoice_clone(const struct LDKRawBolt11Invoice *NONNULL_PTR orig);
56795
56796 /**
56797  * Generates a non-cryptographic 64-bit hash of the RawBolt11Invoice.
56798  */
56799 uint64_t RawBolt11Invoice_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR o);
56800
56801 /**
56802  * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
56803  */
56804 void RawDataPart_free(struct LDKRawDataPart this_obj);
56805
56806 /**
56807  * generation time of the invoice
56808  */
56809 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
56810
56811 /**
56812  * generation time of the invoice
56813  */
56814 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
56815
56816 /**
56817  * Checks if two RawDataParts contain equal inner contents.
56818  * This ignores pointers and is_owned flags and looks at the values in fields.
56819  * Two objects with NULL inner values will be considered "equal" here.
56820  */
56821 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
56822
56823 /**
56824  * Creates a copy of the RawDataPart
56825  */
56826 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
56827
56828 /**
56829  * Generates a non-cryptographic 64-bit hash of the RawDataPart.
56830  */
56831 uint64_t RawDataPart_hash(const struct LDKRawDataPart *NONNULL_PTR o);
56832
56833 /**
56834  * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
56835  */
56836 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
56837
56838 /**
56839  * Checks if two PositiveTimestamps contain equal inner contents.
56840  * This ignores pointers and is_owned flags and looks at the values in fields.
56841  * Two objects with NULL inner values will be considered "equal" here.
56842  */
56843 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
56844
56845 /**
56846  * Creates a copy of the PositiveTimestamp
56847  */
56848 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
56849
56850 /**
56851  * Generates a non-cryptographic 64-bit hash of the PositiveTimestamp.
56852  */
56853 uint64_t PositiveTimestamp_hash(const struct LDKPositiveTimestamp *NONNULL_PTR o);
56854
56855 /**
56856  * Creates a copy of the SiPrefix
56857  */
56858 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
56859
56860 /**
56861  * Utility method to constructs a new Milli-variant SiPrefix
56862  */
56863 enum LDKSiPrefix SiPrefix_milli(void);
56864
56865 /**
56866  * Utility method to constructs a new Micro-variant SiPrefix
56867  */
56868 enum LDKSiPrefix SiPrefix_micro(void);
56869
56870 /**
56871  * Utility method to constructs a new Nano-variant SiPrefix
56872  */
56873 enum LDKSiPrefix SiPrefix_nano(void);
56874
56875 /**
56876  * Utility method to constructs a new Pico-variant SiPrefix
56877  */
56878 enum LDKSiPrefix SiPrefix_pico(void);
56879
56880 /**
56881  * Checks if two SiPrefixs contain equal inner contents.
56882  * This ignores pointers and is_owned flags and looks at the values in fields.
56883  */
56884 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
56885
56886 /**
56887  * Generates a non-cryptographic 64-bit hash of the SiPrefix.
56888  */
56889 uint64_t SiPrefix_hash(const enum LDKSiPrefix *NONNULL_PTR o);
56890
56891 /**
56892  * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
56893  * This is effectively 10^12 * the prefix multiplier
56894  */
56895 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
56896
56897 /**
56898  * Creates a copy of the Currency
56899  */
56900 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
56901
56902 /**
56903  * Utility method to constructs a new Bitcoin-variant Currency
56904  */
56905 enum LDKCurrency Currency_bitcoin(void);
56906
56907 /**
56908  * Utility method to constructs a new BitcoinTestnet-variant Currency
56909  */
56910 enum LDKCurrency Currency_bitcoin_testnet(void);
56911
56912 /**
56913  * Utility method to constructs a new Regtest-variant Currency
56914  */
56915 enum LDKCurrency Currency_regtest(void);
56916
56917 /**
56918  * Utility method to constructs a new Simnet-variant Currency
56919  */
56920 enum LDKCurrency Currency_simnet(void);
56921
56922 /**
56923  * Utility method to constructs a new Signet-variant Currency
56924  */
56925 enum LDKCurrency Currency_signet(void);
56926
56927 /**
56928  * Generates a non-cryptographic 64-bit hash of the Currency.
56929  */
56930 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
56931
56932 /**
56933  * Checks if two Currencys contain equal inner contents.
56934  * This ignores pointers and is_owned flags and looks at the values in fields.
56935  */
56936 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
56937
56938 /**
56939  * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
56940  */
56941 void Sha256_free(struct LDKSha256 this_obj);
56942
56943 /**
56944  * Creates a copy of the Sha256
56945  */
56946 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
56947
56948 /**
56949  * Generates a non-cryptographic 64-bit hash of the Sha256.
56950  */
56951 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
56952
56953 /**
56954  * Checks if two Sha256s contain equal inner contents.
56955  * This ignores pointers and is_owned flags and looks at the values in fields.
56956  * Two objects with NULL inner values will be considered "equal" here.
56957  */
56958 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
56959
56960 /**
56961  * Constructs a new [`Sha256`] from the given bytes, which are assumed to be the output of a
56962  * single sha256 hash.
56963  */
56964 MUST_USE_RES struct LDKSha256 Sha256_from_bytes(const uint8_t (*bytes)[32]);
56965
56966 /**
56967  * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
56968  */
56969 void Description_free(struct LDKDescription this_obj);
56970
56971 /**
56972  * Creates a copy of the Description
56973  */
56974 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
56975
56976 /**
56977  * Generates a non-cryptographic 64-bit hash of the Description.
56978  */
56979 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
56980
56981 /**
56982  * Checks if two Descriptions contain equal inner contents.
56983  * This ignores pointers and is_owned flags and looks at the values in fields.
56984  * Two objects with NULL inner values will be considered "equal" here.
56985  */
56986 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
56987
56988 /**
56989  * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
56990  */
56991 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
56992
56993 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
56994
56995 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
56996
56997 /**
56998  * Constructs a new PayeePubKey given each field
56999  */
57000 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
57001
57002 /**
57003  * Creates a copy of the PayeePubKey
57004  */
57005 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
57006
57007 /**
57008  * Generates a non-cryptographic 64-bit hash of the PayeePubKey.
57009  */
57010 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
57011
57012 /**
57013  * Checks if two PayeePubKeys contain equal inner contents.
57014  * This ignores pointers and is_owned flags and looks at the values in fields.
57015  * Two objects with NULL inner values will be considered "equal" here.
57016  */
57017 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
57018
57019 /**
57020  * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
57021  */
57022 void ExpiryTime_free(struct LDKExpiryTime this_obj);
57023
57024 /**
57025  * Creates a copy of the ExpiryTime
57026  */
57027 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
57028
57029 /**
57030  * Generates a non-cryptographic 64-bit hash of the ExpiryTime.
57031  */
57032 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
57033
57034 /**
57035  * Checks if two ExpiryTimes contain equal inner contents.
57036  * This ignores pointers and is_owned flags and looks at the values in fields.
57037  * Two objects with NULL inner values will be considered "equal" here.
57038  */
57039 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
57040
57041 /**
57042  * Frees any resources used by the MinFinalCltvExpiryDelta, if is_owned is set and inner is non-NULL.
57043  */
57044 void MinFinalCltvExpiryDelta_free(struct LDKMinFinalCltvExpiryDelta this_obj);
57045
57046 uint64_t MinFinalCltvExpiryDelta_get_a(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr);
57047
57048 void MinFinalCltvExpiryDelta_set_a(struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr, uint64_t val);
57049
57050 /**
57051  * Constructs a new MinFinalCltvExpiryDelta given each field
57052  */
57053 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_new(uint64_t a_arg);
57054
57055 /**
57056  * Creates a copy of the MinFinalCltvExpiryDelta
57057  */
57058 struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_clone(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR orig);
57059
57060 /**
57061  * Generates a non-cryptographic 64-bit hash of the MinFinalCltvExpiryDelta.
57062  */
57063 uint64_t MinFinalCltvExpiryDelta_hash(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR o);
57064
57065 /**
57066  * Checks if two MinFinalCltvExpiryDeltas contain equal inner contents.
57067  * This ignores pointers and is_owned flags and looks at the values in fields.
57068  * Two objects with NULL inner values will be considered "equal" here.
57069  */
57070 bool MinFinalCltvExpiryDelta_eq(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR a, const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR b);
57071
57072 /**
57073  * Frees any resources used by the Fallback
57074  */
57075 void Fallback_free(struct LDKFallback this_ptr);
57076
57077 /**
57078  * Creates a copy of the Fallback
57079  */
57080 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
57081
57082 /**
57083  * Utility method to constructs a new SegWitProgram-variant Fallback
57084  */
57085 struct LDKFallback Fallback_seg_wit_program(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
57086
57087 /**
57088  * Utility method to constructs a new PubKeyHash-variant Fallback
57089  */
57090 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
57091
57092 /**
57093  * Utility method to constructs a new ScriptHash-variant Fallback
57094  */
57095 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
57096
57097 /**
57098  * Generates a non-cryptographic 64-bit hash of the Fallback.
57099  */
57100 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
57101
57102 /**
57103  * Checks if two Fallbacks contain equal inner contents.
57104  * This ignores pointers and is_owned flags and looks at the values in fields.
57105  */
57106 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
57107
57108 /**
57109  * Frees any resources used by the Bolt11InvoiceSignature, if is_owned is set and inner is non-NULL.
57110  */
57111 void Bolt11InvoiceSignature_free(struct LDKBolt11InvoiceSignature this_obj);
57112
57113 /**
57114  * Creates a copy of the Bolt11InvoiceSignature
57115  */
57116 struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_clone(const struct LDKBolt11InvoiceSignature *NONNULL_PTR orig);
57117
57118 /**
57119  * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceSignature.
57120  */
57121 uint64_t Bolt11InvoiceSignature_hash(const struct LDKBolt11InvoiceSignature *NONNULL_PTR o);
57122
57123 /**
57124  * Checks if two Bolt11InvoiceSignatures contain equal inner contents.
57125  * This ignores pointers and is_owned flags and looks at the values in fields.
57126  * Two objects with NULL inner values will be considered "equal" here.
57127  */
57128 bool Bolt11InvoiceSignature_eq(const struct LDKBolt11InvoiceSignature *NONNULL_PTR a, const struct LDKBolt11InvoiceSignature *NONNULL_PTR b);
57129
57130 /**
57131  * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
57132  */
57133 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
57134
57135 /**
57136  * Creates a copy of the PrivateRoute
57137  */
57138 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
57139
57140 /**
57141  * Generates a non-cryptographic 64-bit hash of the PrivateRoute.
57142  */
57143 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
57144
57145 /**
57146  * Checks if two PrivateRoutes contain equal inner contents.
57147  * This ignores pointers and is_owned flags and looks at the values in fields.
57148  * Two objects with NULL inner values will be considered "equal" here.
57149  */
57150 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
57151
57152 /**
57153  * Disassembles the `SignedRawBolt11Invoice` into its three parts:
57154  *  1. raw invoice
57155  *  2. hash of the raw invoice
57156  *  3. signature
57157  */
57158 MUST_USE_RES struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ SignedRawBolt11Invoice_into_parts(struct LDKSignedRawBolt11Invoice this_arg);
57159
57160 /**
57161  * The [`RawBolt11Invoice`] which was signed.
57162  */
57163 MUST_USE_RES struct LDKRawBolt11Invoice SignedRawBolt11Invoice_raw_invoice(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
57164
57165 /**
57166  * The hash of the [`RawBolt11Invoice`] that was signed.
57167  */
57168 MUST_USE_RES const uint8_t (*SignedRawBolt11Invoice_signable_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg))[32];
57169
57170 /**
57171  * Signature for the invoice.
57172  */
57173 MUST_USE_RES struct LDKBolt11InvoiceSignature SignedRawBolt11Invoice_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
57174
57175 /**
57176  * Recovers the public key used for signing the invoice from the recoverable signature.
57177  */
57178 MUST_USE_RES struct LDKCResult_PayeePubKeySecp256k1ErrorZ SignedRawBolt11Invoice_recover_payee_pub_key(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
57179
57180 /**
57181  * Checks if the signature is valid for the included payee public key or if none exists if it's
57182  * valid for the recovered signature (which should always be true?).
57183  */
57184 MUST_USE_RES bool SignedRawBolt11Invoice_check_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
57185
57186 /**
57187  * Calculate the hash of the encoded `RawBolt11Invoice` which should be signed.
57188  */
57189 MUST_USE_RES struct LDKThirtyTwoBytes RawBolt11Invoice_signable_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57190
57191 /**
57192  *
57193  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57194  */
57195 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_payment_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57196
57197 /**
57198  *
57199  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57200  */
57201 MUST_USE_RES struct LDKDescription RawBolt11Invoice_description(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57202
57203 /**
57204  *
57205  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57206  */
57207 MUST_USE_RES struct LDKPayeePubKey RawBolt11Invoice_payee_pub_key(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57208
57209 /**
57210  *
57211  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57212  */
57213 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_description_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57214
57215 /**
57216  *
57217  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57218  */
57219 MUST_USE_RES struct LDKExpiryTime RawBolt11Invoice_expiry_time(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57220
57221 /**
57222  *
57223  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57224  */
57225 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta RawBolt11Invoice_min_final_cltv_expiry_delta(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57226
57227 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ RawBolt11Invoice_payment_secret(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57228
57229 MUST_USE_RES struct LDKCOption_CVec_u8ZZ RawBolt11Invoice_payment_metadata(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57230
57231 /**
57232  *
57233  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57234  */
57235 MUST_USE_RES struct LDKBolt11InvoiceFeatures RawBolt11Invoice_features(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57236
57237 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawBolt11Invoice_private_routes(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57238
57239 /**
57240  * Returns `None` if no amount is set or on overflow.
57241  */
57242 MUST_USE_RES struct LDKCOption_u64Z RawBolt11Invoice_amount_pico_btc(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57243
57244 MUST_USE_RES enum LDKCurrency RawBolt11Invoice_currency(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
57245
57246 /**
57247  * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
57248  *
57249  * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
57250  */
57251 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
57252
57253 /**
57254  * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
57255  * the range `0..=MAX_TIMESTAMP`.
57256  *
57257  * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
57258  *
57259  * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
57260  */
57261 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
57262
57263 /**
57264  * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
57265  * `0..=MAX_TIMESTAMP`.
57266  *
57267  * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
57268  *
57269  * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
57270  */
57271 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
57272
57273 /**
57274  * Returns the Unix timestamp representing the stored time
57275  */
57276 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
57277
57278 /**
57279  * Returns the duration of the stored time since the Unix epoch
57280  */
57281 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
57282
57283 /**
57284  * Returns the [`SystemTime`] representing the stored time
57285  */
57286 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
57287
57288 /**
57289  * The hash of the [`RawBolt11Invoice`] that was signed.
57290  */
57291 MUST_USE_RES struct LDKThirtyTwoBytes Bolt11Invoice_signable_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57292
57293 /**
57294  * Transform the `Bolt11Invoice` into its unchecked version.
57295  */
57296 MUST_USE_RES struct LDKSignedRawBolt11Invoice Bolt11Invoice_into_signed_raw(struct LDKBolt11Invoice this_arg);
57297
57298 /**
57299  * Check that the invoice is signed correctly and that key recovery works
57300  */
57301 MUST_USE_RES struct LDKCResult_NoneBolt11SemanticErrorZ Bolt11Invoice_check_signature(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57302
57303 /**
57304  * Constructs a `Bolt11Invoice` from a [`SignedRawBolt11Invoice`] by checking all its invariants.
57305  * ```
57306  * use lightning_invoice::*;
57307  *
57308  * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
57309  * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
57310  * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
57311  * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
57312  * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
57313  * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
57314  * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
57315  * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
57316  * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
57317  * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
57318  * j5r6drg6k6zcqj0fcwg\";
57319  *
57320  * let signed = invoice.parse::<SignedRawBolt11Invoice>().unwrap();
57321  *
57322  * assert!(Bolt11Invoice::from_signed(signed).is_ok());
57323  * ```
57324  */
57325 MUST_USE_RES struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ Bolt11Invoice_from_signed(struct LDKSignedRawBolt11Invoice signed_invoice);
57326
57327 /**
57328  * Returns the `Bolt11Invoice`'s timestamp (should equal its creation time)
57329  */
57330 MUST_USE_RES uint64_t Bolt11Invoice_timestamp(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57331
57332 /**
57333  * Returns the `Bolt11Invoice`'s timestamp as a duration since the Unix epoch
57334  */
57335 MUST_USE_RES uint64_t Bolt11Invoice_duration_since_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57336
57337 /**
57338  * Returns the hash to which we will receive the preimage on completion of the payment
57339  */
57340 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
57341
57342 /**
57343  * Get the payee's public key if one was included in the invoice
57344  *
57345  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57346  */
57347 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57348
57349 /**
57350  * Get the payment secret if one was included in the invoice
57351  */
57352 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_secret(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
57353
57354 /**
57355  * Get the payment metadata blob if one was included in the invoice
57356  */
57357 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt11Invoice_payment_metadata(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57358
57359 /**
57360  * Get the invoice features if they were included in the invoice
57361  *
57362  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
57363  */
57364 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11Invoice_features(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57365
57366 /**
57367  * Recover the payee's public key (only to be used if none was included in the invoice)
57368  */
57369 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_recover_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57370
57371 /**
57372  * Recover the payee's public key if one was included in the invoice, otherwise return the
57373  * recovered public key from the signature
57374  */
57375 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_get_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57376
57377 /**
57378  * Returns the Duration since the Unix epoch at which the invoice expires.
57379  * Returning None if overflow occurred.
57380  */
57381 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_expires_at(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57382
57383 /**
57384  * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
57385  */
57386 MUST_USE_RES uint64_t Bolt11Invoice_expiry_time(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57387
57388 /**
57389  * Returns whether the invoice has expired.
57390  */
57391 MUST_USE_RES bool Bolt11Invoice_is_expired(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57392
57393 /**
57394  * Returns the Duration remaining until the invoice expires.
57395  */
57396 MUST_USE_RES uint64_t Bolt11Invoice_duration_until_expiry(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57397
57398 /**
57399  * Returns the Duration remaining until the invoice expires given the current time.
57400  * `time` is the timestamp as a duration since the Unix epoch.
57401  */
57402 MUST_USE_RES uint64_t Bolt11Invoice_expiration_remaining_from_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t time);
57403
57404 /**
57405  * Returns whether the expiry time would pass at the given point in time.
57406  * `at_time` is the timestamp as a duration since the Unix epoch.
57407  */
57408 MUST_USE_RES bool Bolt11Invoice_would_expire(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t at_time);
57409
57410 /**
57411  * Returns the invoice's `min_final_cltv_expiry_delta` time, if present, otherwise
57412  * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA`].
57413  */
57414 MUST_USE_RES uint64_t Bolt11Invoice_min_final_cltv_expiry_delta(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57415
57416 /**
57417  * Returns a list of all fallback addresses as [`Address`]es
57418  */
57419 MUST_USE_RES struct LDKCVec_StrZ Bolt11Invoice_fallback_addresses(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57420
57421 /**
57422  * Returns a list of all routes included in the invoice
57423  */
57424 MUST_USE_RES struct LDKCVec_PrivateRouteZ Bolt11Invoice_private_routes(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57425
57426 /**
57427  * Returns a list of all routes included in the invoice as the underlying hints
57428  */
57429 MUST_USE_RES struct LDKCVec_RouteHintZ Bolt11Invoice_route_hints(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57430
57431 /**
57432  * Returns the currency for which the invoice was issued
57433  */
57434 MUST_USE_RES enum LDKCurrency Bolt11Invoice_currency(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57435
57436 /**
57437  * Returns the amount if specified in the invoice as millisatoshis.
57438  */
57439 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_amount_milli_satoshis(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
57440
57441 /**
57442  * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
57443  * returns [`CreationError::DescriptionTooLong`] otherwise
57444  *
57445  * Please note that single characters may use more than one byte due to UTF8 encoding.
57446  */
57447 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
57448
57449 /**
57450  * Returns the underlying description [`UntrustedString`]
57451  */
57452 MUST_USE_RES struct LDKUntrustedString Description_into_inner(struct LDKDescription this_arg);
57453
57454 /**
57455  * Get the string representation of a Description object
57456  */
57457 struct LDKStr Description_to_str(const struct LDKDescription *NONNULL_PTR o);
57458
57459 /**
57460  * Construct an `ExpiryTime` from seconds.
57461  */
57462 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
57463
57464 /**
57465  * Construct an `ExpiryTime` from a [`Duration`], dropping the sub-second part.
57466  */
57467 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
57468
57469 /**
57470  * Returns the expiry time in seconds
57471  */
57472 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
57473
57474 /**
57475  * Returns a reference to the underlying [`Duration`] (=expiry time)
57476  */
57477 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
57478
57479 /**
57480  * Creates a new (partial) route from a list of hops
57481  */
57482 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
57483
57484 /**
57485  * Returns the underlying list of hops
57486  */
57487 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
57488
57489 /**
57490  * Creates a copy of the CreationError
57491  */
57492 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
57493
57494 /**
57495  * Utility method to constructs a new DescriptionTooLong-variant CreationError
57496  */
57497 enum LDKCreationError CreationError_description_too_long(void);
57498
57499 /**
57500  * Utility method to constructs a new RouteTooLong-variant CreationError
57501  */
57502 enum LDKCreationError CreationError_route_too_long(void);
57503
57504 /**
57505  * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
57506  */
57507 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
57508
57509 /**
57510  * Utility method to constructs a new InvalidAmount-variant CreationError
57511  */
57512 enum LDKCreationError CreationError_invalid_amount(void);
57513
57514 /**
57515  * Utility method to constructs a new MissingRouteHints-variant CreationError
57516  */
57517 enum LDKCreationError CreationError_missing_route_hints(void);
57518
57519 /**
57520  * Utility method to constructs a new MinFinalCltvExpiryDeltaTooShort-variant CreationError
57521  */
57522 enum LDKCreationError CreationError_min_final_cltv_expiry_delta_too_short(void);
57523
57524 /**
57525  * Checks if two CreationErrors contain equal inner contents.
57526  * This ignores pointers and is_owned flags and looks at the values in fields.
57527  */
57528 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
57529
57530 /**
57531  * Get the string representation of a CreationError object
57532  */
57533 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
57534
57535 /**
57536  * Creates a copy of the Bolt11SemanticError
57537  */
57538 enum LDKBolt11SemanticError Bolt11SemanticError_clone(const enum LDKBolt11SemanticError *NONNULL_PTR orig);
57539
57540 /**
57541  * Utility method to constructs a new NoPaymentHash-variant Bolt11SemanticError
57542  */
57543 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_hash(void);
57544
57545 /**
57546  * Utility method to constructs a new MultiplePaymentHashes-variant Bolt11SemanticError
57547  */
57548 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_hashes(void);
57549
57550 /**
57551  * Utility method to constructs a new NoDescription-variant Bolt11SemanticError
57552  */
57553 enum LDKBolt11SemanticError Bolt11SemanticError_no_description(void);
57554
57555 /**
57556  * Utility method to constructs a new MultipleDescriptions-variant Bolt11SemanticError
57557  */
57558 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_descriptions(void);
57559
57560 /**
57561  * Utility method to constructs a new NoPaymentSecret-variant Bolt11SemanticError
57562  */
57563 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_secret(void);
57564
57565 /**
57566  * Utility method to constructs a new MultiplePaymentSecrets-variant Bolt11SemanticError
57567  */
57568 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_secrets(void);
57569
57570 /**
57571  * Utility method to constructs a new InvalidFeatures-variant Bolt11SemanticError
57572  */
57573 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_features(void);
57574
57575 /**
57576  * Utility method to constructs a new InvalidRecoveryId-variant Bolt11SemanticError
57577  */
57578 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_recovery_id(void);
57579
57580 /**
57581  * Utility method to constructs a new InvalidSignature-variant Bolt11SemanticError
57582  */
57583 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_signature(void);
57584
57585 /**
57586  * Utility method to constructs a new ImpreciseAmount-variant Bolt11SemanticError
57587  */
57588 enum LDKBolt11SemanticError Bolt11SemanticError_imprecise_amount(void);
57589
57590 /**
57591  * Checks if two Bolt11SemanticErrors contain equal inner contents.
57592  * This ignores pointers and is_owned flags and looks at the values in fields.
57593  */
57594 bool Bolt11SemanticError_eq(const enum LDKBolt11SemanticError *NONNULL_PTR a, const enum LDKBolt11SemanticError *NONNULL_PTR b);
57595
57596 /**
57597  * Get the string representation of a Bolt11SemanticError object
57598  */
57599 struct LDKStr Bolt11SemanticError_to_str(const enum LDKBolt11SemanticError *NONNULL_PTR o);
57600
57601 /**
57602  * Frees any resources used by the SignOrCreationError
57603  */
57604 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
57605
57606 /**
57607  * Creates a copy of the SignOrCreationError
57608  */
57609 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
57610
57611 /**
57612  * Utility method to constructs a new SignError-variant SignOrCreationError
57613  */
57614 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
57615
57616 /**
57617  * Utility method to constructs a new CreationError-variant SignOrCreationError
57618  */
57619 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
57620
57621 /**
57622  * Checks if two SignOrCreationErrors contain equal inner contents.
57623  * This ignores pointers and is_owned flags and looks at the values in fields.
57624  */
57625 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
57626
57627 /**
57628  * Get the string representation of a SignOrCreationError object
57629  */
57630 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
57631
57632 /**
57633  * Builds the necessary parameters to pay or pre-flight probe the given zero-amount
57634  * [`Bolt11Invoice`] using [`ChannelManager::send_payment`] or
57635  * [`ChannelManager::send_preflight_probes`].
57636  *
57637  * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
57638  * same [`PaymentHash`] has never been paid before.
57639  *
57640  * Will always succeed unless the invoice has an amount specified, in which case
57641  * [`payment_parameters_from_invoice`] should be used.
57642  *
57643  * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment
57644  * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes
57645  */
57646 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_zero_amount_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat);
57647
57648 /**
57649  * Builds the necessary parameters to pay or pre-flight probe the given [`Bolt11Invoice`] using
57650  * [`ChannelManager::send_payment`] or [`ChannelManager::send_preflight_probes`].
57651  *
57652  * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
57653  * same [`PaymentHash`] has never been paid before.
57654  *
57655  * Will always succeed unless the invoice has no amount specified, in which case
57656  * [`payment_parameters_from_zero_amount_invoice`] should be used.
57657  *
57658  * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment
57659  * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes
57660  */
57661 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice);
57662
57663 /**
57664  * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
57665  * See [`PhantomKeysManager`] for more information on phantom node payments.
57666  *
57667  * `phantom_route_hints` parameter:
57668  * * Contains channel info for all nodes participating in the phantom invoice
57669  * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
57670  *   participating node
57671  * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
57672  *   updated when a channel becomes disabled or closes
57673  * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
57674  *   may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
57675  *   down
57676  *
57677  * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
57678  * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
57679  * If `None` is provided for `payment_hash`, then one will be created.
57680  *
57681  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
57682  * in excess of the current time.
57683  *
57684  * `duration_since_epoch` is the current time since epoch in seconds.
57685  *
57686  * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
57687  * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3.
57688  * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
57689  * confirmations during routing.
57690  *
57691  * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
57692  * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
57693  * requirement).
57694  *
57695  * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
57696  * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
57697  * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
57698  * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
57699  * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
57700  * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
57701  *
57702  * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
57703  * available and the current time is supplied by the caller.
57704  */
57705 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice(struct LDKCOption_u64Z amt_msat, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u16Z min_final_cltv_expiry_delta, uint64_t duration_since_epoch);
57706
57707 /**
57708  * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
57709  * See [`PhantomKeysManager`] for more information on phantom node payments.
57710  *
57711  * `phantom_route_hints` parameter:
57712  * * Contains channel info for all nodes participating in the phantom invoice
57713  * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
57714  *   participating node
57715  * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
57716  *   updated when a channel becomes disabled or closes
57717  * * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum
57718  *   of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected
57719  *   in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node
57720  *   until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as
57721  *   desired, but note that some nodes will be trimmed if more than 3 nodes are provided.
57722  *
57723  * `description_hash` is a SHA-256 hash of the description text
57724  *
57725  * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
57726  * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
57727  * If `None` is provided for `payment_hash`, then one will be created.
57728  *
57729  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
57730  * in excess of the current time.
57731  *
57732  * `duration_since_epoch` is the current time since epoch in seconds.
57733  *
57734  * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
57735  * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
57736  * requirement).
57737  *
57738  * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
57739  * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
57740  * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
57741  * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
57742  * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
57743  *
57744  * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
57745  * available and the current time is supplied by the caller.
57746  */
57747 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(struct LDKCOption_u64Z amt_msat, struct LDKCOption_ThirtyTwoBytesZ payment_hash, uint32_t invoice_expiry_delta_secs, struct LDKSha256 description_hash, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u16Z min_final_cltv_expiry_delta, uint64_t duration_since_epoch);
57748
57749 /**
57750  * Utility to construct an invoice. Generally, unless you want to do something like a custom
57751  * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
57752  * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
57753  * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
57754  * that the payment secret is valid when the invoice is paid.
57755  *
57756  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
57757  * in excess of the current time.
57758  *
57759  * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
57760  * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
57761  * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
57762  * confirmations during routing.
57763  *
57764  * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
57765  */
57766 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
57767
57768 /**
57769  * Utility to construct an invoice. Generally, unless you want to do something like a custom
57770  * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
57771  * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
57772  * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
57773  * that the payment secret is valid when the invoice is paid.
57774  * Use this variant if you want to pass the `description_hash` to the invoice.
57775  *
57776  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
57777  * in excess of the current time.
57778  *
57779  * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
57780  * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
57781  * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
57782  * confirmations during routing.
57783  *
57784  * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
57785  */
57786 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
57787
57788 /**
57789  * See [`create_invoice_from_channelmanager_with_description_hash`]
57790  * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
57791  * available and the current time is supplied by the caller.
57792  */
57793 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
57794
57795 /**
57796  * See [`create_invoice_from_channelmanager`]
57797  * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
57798  * available and the current time is supplied by the caller.
57799  */
57800 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
57801
57802 /**
57803  * See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
57804  * This version allows for providing a custom [`PaymentHash`] for the invoice.
57805  * This may be useful if you're building an on-chain swap or involving another protocol where
57806  * the payment hash is also involved outside the scope of lightning.
57807  */
57808 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
57809
57810 /**
57811  * Read a SiPrefix object from a string
57812  */
57813 struct LDKCResult_SiPrefixBolt11ParseErrorZ SiPrefix_from_str(struct LDKStr s);
57814
57815 /**
57816  * Read a Bolt11Invoice object from a string
57817  */
57818 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ Bolt11Invoice_from_str(struct LDKStr s);
57819
57820 /**
57821  * Read a SignedRawBolt11Invoice object from a string
57822  */
57823 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ SignedRawBolt11Invoice_from_str(struct LDKStr s);
57824
57825 /**
57826  * Get the string representation of a Bolt11ParseError object
57827  */
57828 struct LDKStr Bolt11ParseError_to_str(const struct LDKBolt11ParseError *NONNULL_PTR o);
57829
57830 /**
57831  * Get the string representation of a ParseOrSemanticError object
57832  */
57833 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
57834
57835 /**
57836  * Get the string representation of a Bolt11Invoice object
57837  */
57838 struct LDKStr Bolt11Invoice_to_str(const struct LDKBolt11Invoice *NONNULL_PTR o);
57839
57840 /**
57841  * Get the string representation of a SignedRawBolt11Invoice object
57842  */
57843 struct LDKStr SignedRawBolt11Invoice_to_str(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
57844
57845 /**
57846  * Get the string representation of a Currency object
57847  */
57848 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
57849
57850 /**
57851  * Get the string representation of a SiPrefix object
57852  */
57853 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
57854
57855 /**
57856  * Frees any resources used by the GraphSyncError
57857  */
57858 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
57859
57860 /**
57861  * Creates a copy of the GraphSyncError
57862  */
57863 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
57864
57865 /**
57866  * Utility method to constructs a new DecodeError-variant GraphSyncError
57867  */
57868 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
57869
57870 /**
57871  * Utility method to constructs a new LightningError-variant GraphSyncError
57872  */
57873 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
57874
57875 /**
57876  * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
57877  */
57878 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
57879
57880 /**
57881  * Instantiate a new [`RapidGossipSync`] instance.
57882  */
57883 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
57884
57885 /**
57886  * Sync gossip data from a file.
57887  * Returns the last sync timestamp to be used the next time rapid sync data is queried.
57888  *
57889  * `network_graph`: The network graph to apply the updates to
57890  *
57891  * `sync_path`: Path to the file where the gossip update data is located
57892  *
57893  */
57894 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
57895
57896 /**
57897  * Update network graph from binary data.
57898  * Returns the last sync timestamp to be used the next time rapid sync data is queried.
57899  *
57900  * `update_data`: `&[u8]` binary stream that comprises the update data
57901  */
57902 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
57903
57904 /**
57905  * Update network graph from binary data.
57906  * Returns the last sync timestamp to be used the next time rapid sync data is queried.
57907  *
57908  * `update_data`: `&[u8]` binary stream that comprises the update data
57909  * `current_time_unix`: `Option<u64>` optional current timestamp to verify data age
57910  */
57911 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph_no_std(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data, struct LDKCOption_u64Z current_time_unix);
57912
57913 /**
57914  * Returns whether a rapid gossip sync has completed at least once.
57915  */
57916 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
57917
57918 #endif /* LDK_C_BINDINGS_H */
57919
57920 #include "ldk_ver.h"